posit-dev / posit-dev/positron

Natural text expression filtering for the Data Explorer

Open
#9,596 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: data explorer
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:

Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.