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

Test Closed Notebook Search #188695

Closed
3 tasks done
andreamah opened this issue Jul 24, 2023 · 3 comments
Closed
3 tasks done

Test Closed Notebook Search #188695

andreamah opened this issue Jul 24, 2023 · 3 comments

Comments

@andreamah
Copy link
Contributor

andreamah commented Jul 24, 2023

Refs #173726

Complexity: 4

Create Issue


Intro:

Hi! 👋

This has to do with using the search widget to search for notebook content. Like in previous TPIs, the search widget should be able to search fully in open notebooks. However, when a notebook was closed, the search widget always searched the raw source text of the notebook. In the TPI linked above, you could see how opening a search result changed the search result preview's text so that it matches the "rich" version of the text that you view from the notebook editor. With my changes, I'm aiming to show "rich" results before you open the notebooks. These will be limited to only searching notebook INPUTS for now (code and markdown input) when a notebook is closed. This means that it's normal to see extra results appear (or results changing preview text) when you open a notebook (either from a result or not) because opening a notebook triggers another search that should also show results for outputs and rendered content.

DEMO:

closed-notebook-search.mp4

Set up:

Enable search.experimental.closedNotebookRichContentResults. Just to be sure that you're in a good state, please also reload the window after you do this.

Testing:

Test that:

  1. searching in closed notebooks shows only matches that are in notebook inputs and not notebook outputs.
  2. searching in closed notebooks shows "rich" content.

For example, you can have a cell that contains the python:

    print('hello')
            print('hello')
        print('hello')

And the search result in the closed notebook should NOT have quotes.

Incorrect:
image

Correct:
image

  1. Clicking on a search result should open the document at the appropriate location. Please be aware that this might not always work upon opening the notebook due to this bug. Also, this bug might prevent the current match from being highlighted correctly upon clicking on a search result.
  2. searching in non-notebooks is as expected still.
  3. Please just play around the feature and leave feedback on what you think!

Future work

For the future, I'm planning on improving on these two areas:

  • Performance of the notebook search (especially in remote scenarios). Issue here
  • Potentially adding support for searching outputs in closed notebooks.
    • In this case, possibly facilitating better switch between closed and open notebook search (since filter icon suddenly appears for searching open notebooks, but not closed).
@vscodenpa vscodenpa added this to the July 2023 milestone Jul 24, 2023
@karrtikr karrtikr removed their assignment Jul 25, 2023
@karrtikr
Copy link
Contributor

Nice addition, works great.

@DonJayamanne
Copy link
Contributor

Works as expected, awesome

@DonJayamanne DonJayamanne removed their assignment Jul 25, 2023
@sbatten sbatten assigned digitarald and unassigned sbatten Jul 25, 2023
@digitarald
Copy link
Contributor

Sweet, love how well this worked in my data science workspace.

@digitarald digitarald removed their assignment Jul 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants