Skip to content
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

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

johnpoth
Copy link
Collaborator

@johnpoth johnpoth commented Oct 7, 2019

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!

Copy link
Owner

@astefanutti astefanutti left a 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:
    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!

lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Show resolved Hide resolved
@astefanutti
Copy link
Owner

I've thought a bit about the best way to integrate the filter and come up with:
Kubebox  - namespaces filter
It's a bit more UI work, but that would solve some of the issues mentioned above. Besides, it'd make obvious for users that filtering is possible.

WDYT?

@johnpoth
Copy link
Collaborator Author

johnpoth commented Oct 22, 2019

Excellent feedback ! I think we can definitely afford having an extra field for Search. Let me work some magic and update this PR

@astefanutti
Copy link
Owner

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, ...

@johnpoth
Copy link
Collaborator Author

PR updated, lint errors may apply

@astefanutti
Copy link
Owner

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?

@johnpoth
Copy link
Collaborator Author

PR updated

Copy link
Owner

@astefanutti astefanutti left a 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 :)

lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
@johnpoth
Copy link
Collaborator Author

@astefanutti I've push some changes to address some sizing issues I had, I'll take a look at your comments ASAP

@johnpoth johnpoth force-pushed the namespace-search branch 2 times, most recently from 3425feb to be28305 Compare November 29, 2019 14:24
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
lib/ui/namespaces.js Outdated Show resolved Hide resolved
@johnpoth
Copy link
Collaborator Author

johnpoth commented Dec 2, 2019

Should be ok! Thanks !

@astefanutti
Copy link
Owner

Awesome! Thanks!

@astefanutti astefanutti merged commit 8ac167a into astefanutti:master Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search filter in namespace modal dialog Quick jump a namespaces ?
2 participants