feat(cli): add scrolling, sorting and filtering to vector top#24355
feat(cli): add scrolling, sorting and filtering to vector top#24355thomasqueirozb merged 15 commits intovectordotdev:masterfrom
vector top#24355Conversation
|
@vectordotdev/vector just checking if this can get reviewed. I know #24364 was mentioned in the issue as a possible conflict, but I don't this these 2 affect each other. Any conflict that arises should be trivial to solve. |
There was a problem hiding this comment.
Very nice! Thanks for this. Just a few minor things to be addressed improved.
Additionally, do you think it is possible to add some kind of indicator that we're filtering by a column? I was thinking of something like ID (filter) and having filter be in yellow. This is just an idea of course. Right now we have no indication that we're filtering or not and this would be nice to have since the components just "disappear" right now.
We could also add some indication that we're sorting but that is less important than the filtering indicator.
FYI I really enjoy having the / as a keybind to quickly filter components :)
Additional note: I checked for merge conflicts with that other PR and this one doesn't seem to touch any files in common so we should be good to merge without worrying about conflicts.
Thanks!
That sounds good. I can play around with it for a bit.
There is already an indication for sorting (https://github.com/vectordotdev/vector/pull/24355/changes#diff-bfd3603fead9464708657861b2ab35789a27a03e089982109c13f40e8c2c34c6R229) - the column header gets highlighted.
I am glad - I tried to cover the most common keybinds one would expect out of a tool like this.
Yeah, I thought that was the case, because I really just worked with the UI code. |
Co-authored-by: Thomas <thomasqueirozb@gmail.com>
|
I have settled for |
|
@thomasqueirozb I think I have covered all of the comments. Let me know if this looks alright. |
thomasqueirozb
left a comment
There was a problem hiding this comment.
Tested locally after changes and everything seems to be right, including CLI flags. Everything looks good, thanks!
Summary
This adds new features requested in #24337:
The default keybinds were partly inspired by
htop, the usual keybinds (arrows) and the usualvimkeybinds.Filtering input is very basic - it doesn't support moving cursor around, only writing / deleting one character at a time. I couldn't justify adding a whole new complex component or a crate for a single input field.
Vector configuration
This is just a basic configuration, with many repeated components, to test scrolling, sorting and filtering:
How did you test this PR?
Ran Vector with the above configuration and ran
vector topseparately.?can be used to show the help window with all the keybinds for scrolling, sorting and filtering.vector top --helpcan be used to show the newly added CLI arguments, to start up with sort/filter options.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References
Notes
@vectordotdev/vectorto reach out to us regarding this PR.pre-pushhook, please see this template.make fmtmake check-clippy(if there are failures it's possible some of them can be fixed withmake clippy-fix)make testgit merge origin masterandgit push.Cargo.lock), pleaserun
make build-licensesto regenerate the license inventory and commit the changes (if any). More details here.