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

Visual clue for Data Viewer substring search #7628

Closed
ronglums opened this issue Sep 22, 2021 · 20 comments · Fixed by #7842
Closed

Visual clue for Data Viewer substring search #7628

ronglums opened this issue Sep 22, 2021 · 20 comments · Fixed by #7842
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug data-viewer papercut 🩸 Something affecting the productivity of the team verified Verification succeeded
Milestone

Comments

@ronglums
Copy link

ronglums commented Sep 22, 2021

VS Code 1.61.0-insider + Jupyter extension v2021.9.1001261101

  1. Open a list in the Data Viewer
  2. In the filter box, type in a substring of a value in the list

expected: Any value that contains the typed-in string shows up
actual: no value shows up unless an asterisk is added. This is quite confusing. I understand why we added the "*" support but it would be nice to give users visual clues that an asterisk is required if they want to perform substring search

image

image

@ronglums ronglums added bug Issue identified by VS Code Team member as probable bug nb-golden papercut 🩸 Something affecting the productivity of the team labels Sep 22, 2021
@greazer greazer added this to the September 2021 milestone Sep 23, 2021
@greazer
Copy link
Contributor

greazer commented Sep 23, 2021

Related to #7090

@DonJayamanne DonJayamanne removed their assignment Sep 27, 2021
@rchiodo rchiodo modified the milestones: September 2021, October 2021 Sep 28, 2021
@rchiodo
Copy link
Contributor

rchiodo commented Oct 6, 2021

What if I just changed it to always include * on the end? That's essentially what it used to do. Instead of exact match it was 'includes'

@rchiodo
Copy link
Contributor

rchiodo commented Oct 6, 2021

That would probably match the wanted behavior for most people.

@miguelsolorio
Copy link

also found filtering to be odd. my expectation is that filtering via text would filter results for whatever characters it contains and not an exact match. Other spreadsheets apps filter slightly different but aren't exact matches:

CleanShot 2021-10-06 at 15 33 17@2x

CleanShot 2021-10-06 at 15 41 48@2x

@rchiodo
Copy link
Contributor

rchiodo commented Oct 6, 2021

@misolori what do you think of the changes here:

microsoft/vscode-docs#4869

Essentially what will happen is:

  • If user types a string without any regex escapable chars in it, we'll turn the match in to ^.*{user text}.*$. This means any row that contains the text (case insensitive) the user typed will match
  • If user types a string beginning with '=', we'll do this instead ^{user text}$. Meaning any row that exactly matches the string will match
  • If user types something with regex chars in it (like '.' or '*' or '+' or ')'), we'll just use the user text as the regex. All rows matching the regex will be returned.

An example.

  • User types 'ar' in your list of rows above. Airfare would match, Car Rental would match, Fee Interest/Charge etc.
  • User types '.*ar ' in your list of rows above. Only Car rental would match (because of the space)
  • User types '=Airfare', then only Airfare would match.

@miguelsolorio
Copy link

That maps to what I expected 👏 👍

@ronglums
Copy link
Author

ronglums commented Oct 6, 2021

Thanks @rchiodo! I like the change. The only question I have is how do we let users know about using "=" for exact match? Maybe a placeholder text "Use "=" for exact match" when they click into the filter box?

@rchiodo
Copy link
Contributor

rchiodo commented Oct 6, 2021

The idea is documentation (see the PR I linked above). We all chatted about it and thought it wouldn't fit. Filter box is usually only 5 to 10 chars wide.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 6, 2021

Here's the text from that pr:

Filtering rows

Filtering rows in the data viewer can be done by typing in the textbox at the top of each column. Type a string you want to search for and any row that has that string in the column will be found:

Data Viewer

If you want to find an exact match, prefix your filter with '=':

Data Viewer

More complex filtering can be done by typing a regular expression:

Data Viewer

@miguelsolorio
Copy link

Another thing to add, which we use in the search input, is to show the syntax when the user is focused on the input only so it's not always busy:

CleanShot 2021-10-06 at 16 29 14@2x

@ronglums
Copy link
Author

ronglums commented Oct 6, 2021

@misolori yep that's what I was thinking but our filter box is too short to fit in the text I guess..

@rchiodo
Copy link
Contributor

rchiodo commented Oct 6, 2021

Yeah this is the default for me when opening the titanic data set

image

Probably enough for 5 characters

@rchiodo
Copy link
Contributor

rchiodo commented Oct 6, 2021

We could put a hover tooltip though. Something like:

Type to search.
Use =<text> for an exact match.
Regular expressions also supported.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 7, 2021

Hover is turning out to be more difficult than I thought. We're using this fluent-ui here and they don't have a convenient way to add a tooltip

@rchiodo
Copy link
Contributor

rchiodo commented Oct 7, 2021

After discussing at standup, we probably need something that makes this work like other search inside of VS code. So an explicit button for

  • Case match
  • Whole world
  • Regex or not

@DonJayamanne DonJayamanne added the verified Verification succeeded label Oct 27, 2021
@burkeholland
Copy link

Noting that I ran into this in the Golden Scenario this week and I could not figure out how to do an exact match filter.

filter-exact-match.mp4

@justindorsey75
Copy link

I have been looking around for some documentation regarding the use of regex flags with the data viewer but could not find anything. Is this supported and if so what is the proper syntax for using in the data viewer? For say a case insensitive regex search for example which is the /i flag.

@rchiodo
Copy link
Contributor

rchiodo commented May 13, 2022

Documentation for the filtering is here:
https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_filtering-rows

You should be able to enter anything that you can put into a javascript regex but you can't control the global options (like multiline or insensitive). So case insensitivity requires more complex expressions. You basically have to use | on both flavors of the character you're looking for.

@justindorsey75
Copy link

justindorsey75 commented May 13, 2022

Thank you for the quick response. I looked over the documentation as well as the JavaScript documentation that you sent over. Thank you for sending that. Based on what I read it looks like JavaScript does not support inline mode modifiers such as "(?I)sometext(?-i).*" This is a mode modifier for a case and sensitive search that is inline.

I was thinking this could be used as an alternative to global flags. Can you confirm if that is the case? If so are there any feature requests currently for either global modifiers support or inline mode modifier support? If not I will likely put any feature request for it or whatever you would suggest is the best route for requesting this feature. Thank you again for your assistance.

@rchiodo
Copy link
Contributor

rchiodo commented May 14, 2022

Javascript doesn't support inline mode modifiers AFAIK. But you can create sets of characters that should match.

You can enter a feature request either in the discussions forum:
https://github.com/microsoft/vscode-jupyter/discussions/categories/new-ideas

Or by just entering a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug data-viewer papercut 🩸 Something affecting the productivity of the team verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants