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

console: filter tasks list #131

Open
hawkw opened this issue Sep 10, 2021 · 4 comments
Open

console: filter tasks list #131

hawkw opened this issue Sep 10, 2021 · 4 comments
Labels
C-console Crate: console. E-hard Effort: hard. S-feature Severity: feature. This is adding a new feature.

Comments

@hawkw
Copy link
Member

hawkw commented Sep 10, 2021

It would be nice to be able to filter which tasks are displayed in the tasks list.

Some ways we might want to filter the tasks list:

  • By name (with a regex?)
  • By target (with a regex?)
  • By fields:
    • by the presence of a field with a given name
    • by the value of a field with a given name (regex?)

Since we would want to allow filtering on different columns in the task list, we would need some UI for selecting which column is being filtered on, as well as for writing the actual filter. Here's a simple proposal:

  • When the user presses a particular key, a text entry box is opened to type in a filter pattern
  • Using the arrow keys in the filter entry mode selects which column is filtered on, rather than which column sorts the task list
  • pressing some other key (enter?) adds the filter, and returns the user to the mode where the arrow keys select the column to sort by

Questions:

  • Do we want to support multiple filters? We probably do, but that complicates the UI
    • Opening the filter entry box again would then create a new filter, rather than editing the current filter
    • There would need to be some way to edit an existing filter as well
    • Perhaps we should add a UI box that lists all the current filters?
    • Some kind of command for clearing all filters
  • How to combine patterns in filters? e.g. users might want to have OR filters or AND filters...

Most of these questions are things we can punt on for an MVP implementation, especially if we only allow a single filter at a time. But, we'll want to figure them out eventually.

UI inspiration:

  • htop (which only allows filtering on one column, the process's name):
    image
  • atuin history search:
    image
@hawkw hawkw added S-feature Severity: feature. This is adding a new feature. E-hard Effort: hard. C-console Crate: console. labels Sep 10, 2021
@hawkw
Copy link
Member Author

hawkw commented Sep 10, 2021

I marked this as E-hard because a complete, full-featured filtering implementation is going to be a big pile of work (see the "questions" section above). However, an initial MVP where there's only one active filter at a time is probably relatively easy...

@seanmonstar
Copy link
Member

There's also other things we'd probably want to be able to "enter" dynamically, like rewinding to a certain spot, or changing a config value, etc.

@hawkw
Copy link
Member Author

hawkw commented Sep 10, 2021

There's also other things we'd probably want to be able to "enter" dynamically, like rewinding to a certain spot, or changing a config value, etc.

Yeah, it would make sense to have stuff like text boxes and other UI components eventually be general-purpose...

@zaharidichev
Copy link
Collaborator

Would it make sense to split the task up a bit and start with an implementation of a filter query box that we can bring up with some kind of a key combination and just fiture out a filtering syntax that incorporates the column(s) that we are filtering by. Someting like: polls > 1;target=="tokio::task". When that works, we can think of a way to make it easier to populate the columns we filter on by using the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-console Crate: console. E-hard Effort: hard. S-feature Severity: feature. This is adding a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants