posit-dev / posit-dev/positron
Natural text expression filtering for the Data Explorer
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 183
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 206
Description
This is a proposal for a faster way of entering filters in the Data Explorer. Today, entering even a basic filter requires a lot of scrolling through long drop lists and clicking; this has the advantage of preventing users from entering anything invalid, but it isn't very fast.
If you create a filter, we render a text version of the filter in the explorer:
What if we allowed users to just type that expression directly? It could look like this:
- A button creates an empty, white text box in the toolbar that looks like one of the existing "applied filter" boxes. It's also possible to create one of these with a command, for keyboard access.
- As the user starts typing, we auto-complete column names, with Tab to accept.
- Most common comparison operators are accepted, values can be quoted or not, etc. We will need a very basic grammar for these expressions we can validate against.
- The moment the filter is syntactically valid, it is applied provisionally. Any further edits to the filter (that leave the filter in a syntactically valid state) are applied in real time after a short debounce period.
- It's easy to commit the filter (adding it to the set of applied filters in the toolbar) with Enter or discard it with Esc.
It is probably unrealistic and expensive to support entering every possible filter expression in this way, but it seems likely that > 90% of filters are simple enough to be expressed quickly in this format.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by locating the Data Explorer's existing applied-filter rendering and toolbar entry points, then trace how filters are validated and applied. Done means users can create a text filter, receive column-name completion, apply valid expressions provisionally, and commit or discard them with Enter or Esc.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100