-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add search filter when displaying namespaces Fixes #15 and #49 #65
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very cool!
Here are my feedback:
- I would propose to rename it to Filter rather than Search
- The search box label position is off when the search result is large enough to be scrolled. I'm not sure how it relates to:
kubebox/lib/ui/blessed/element.js
Lines 91 to 99 in 803ed24
var reposition = function () { self._label.rtop = (self.childBase || 0) - self.itop; if (!self.screen.autoPadding) { self._label.rtop = self.childBase || 0; } // PATCH BEGIN if (!self._label.detached) self.screen.render(); // PATCH END }; - An exception is thrown when the search box is displayed, then close with ESC, and pressing the left key
- The left and right arrow keys should not probably trigger the filter, TAB should probably be excluded too
- Pressing
q
should show the filter rather than exiting the process - The selection before the filter activates could be restored when it deactivates
- I wonder whether it'd be better to hide the filter when it's emptied
- Nit: properly format the code
Thanks for your patience!
Excellent feedback ! I think we can definitely afford having an extra field for Search. Let me work some magic and update this PR |
Cool, I think we'll be able to generalise the work done for the namespaces and reuse it so that we can provide filtering for other widgets like pods, logs, ... |
PR updated, lint errors may apply |
It seems the PR hasn't picked up the changes. I think the PR was created from your fork, while you've pushed the branch to this repository. Would you mind pushing to your fork as well? |
fa0628d
to
f2f51ad
Compare
PR updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! Works great! If you could give some lint love, that'd be even better :)
f2f51ad
to
4d57a5c
Compare
@astefanutti I've push some changes to address some sizing issues I had, I'll take a look at your comments ASAP |
3425feb
to
be28305
Compare
be28305
to
17f3e5c
Compare
Should be ok! Thanks ! |
Awesome! Thanks! |
Fixes #15 and fixes #49.
Adds search bar to namespace selection. Search is triggered when user starts typing. Further improvements might include highlighting match.
Thanks!