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

Testing: Rich Content Search in Open Notebooks #177709

Closed
3 tasks done
andreamah opened this issue Mar 20, 2023 · 1 comment
Closed
3 tasks done

Testing: Rich Content Search in Open Notebooks #177709

andreamah opened this issue Mar 20, 2023 · 1 comment

Comments

@andreamah
Copy link
Contributor

andreamah commented Mar 20, 2023

Refs #164926

Complexity: 5

Create Issue


Set up

Ensure that search.experimental.notebookSearch is enabled and you're on the latest Insiders.

Intro

The goal of this testplan items is to test showing rich content results when searching in OPEN notebooks.

Last iteration, I already had a testplan item for working with inputs (#174724), but with my latest changes, you should now be able to toggle whether you want to search read-only content (code outputs and rendered markdown) also.

Tiny demo:

notebook-search.mp4

What is "Rich Content" in notebooks? What should I be seeing?

Showing "rich/rendered content" means that it's showing the result as seen in the notebook editor rather than just in the raw .ipynb file.

To help explain, here's an example I used for my last testplan:

"print(\"Hello World\")",

would look like

print("Hello World")

in the notebook. You should see the first (raw) one when notebooks are closed and the second (processed/rich) one when the notebook is opened and rendered. This is because it uses the notebook editor's find widget when the notebook is open to find search results.

Filter Meanings

You might be asking: what do the filter options on the notebook toggle even mean?

image

Markdown Source vs. Rendered Markdown

You can only choose one of these two options. Consider the following markdown.

***Hello***World

Which renders to:
HelloWorld

Searching ***Hello*** with the Markdown Source option would match it, but it wouldn't match for Rendered Markdown.

When searching for Rendered Markdown, it's a little trickier. If the cell with ***Hello***World is in preview mode, then a Search for HelloWorld would match. Otherwise, if the cell is in edit mode, the cell will not match.

Note that, if the cell with ***Hello***World is in preview mode and you find a match using the Rendered Markdown option, then clicking on the result to jump to it will change the cell to editing mode.

In this case, the search preview in the results list would show ***Hello***World if searching for Markdown Source and and HelloWorld if searching for Rendered Markdown.

Code Cell Source vs. Cell Output

Both of these options can be enabled at once, and this is a little more straightforward. For Code Cell Source, it looks for the text in code cells. For Cell Output, it will search any text that results from running the cell.

Testing

These testing steps are largely the same as the last iteration's testplan, with a few extra steps to ensure that the new output works. The new toggle for notebooks should only appear when a notebook is open. (NEW) steps are steps that I added to ensure that outputs and toggling them are supported, so please take extra care to ensure they work! :)

  1. Open a workspace that has notebooks.

  2. Test the new search functionality. You should see the "rich content" results appear when you:
    a. Open a notebook with search results, either from the explorer or from the search results itself.
    b. Perform a search and there are results in a currently opened notebook.

  3. (NEW) The results that are from read-only results should only have the x action button and not the replace one, even if the replace input is visible. When the replace input is visible, writeable content (code input and markdown preview) should have the replace action button and show the replacement preview. See the difference in writeable/read-only content here:
    Image from Gyazo

  4. (NEW) Changing the toggle options should re-trigger the search. Results should be correct according to the filter (for open notebooks).

  5. Closing the notebook with rich search content shouldn't affect the search results, and re-clicking the rich results should open the notebook at the correct places. However, if you re-search after closing the notebook, it will return to giving raw results.

  6. Replace and Replace All functionalities should work, in addition to Dismiss for the results.
    a. (NEW) When you replace all in a folder or workspace, the results for the read-only results (rendered markdown and code output) should persist

  7. Dirty changes in notebooks that are open and have results in the search view should reflect in the search results.

  8. Results should be properly highlighted when you open the file. Jumping to a result when clicking on it should work.

  9. (NEW) Reloading the window should persist the results toggle state.

  10. Setting the experimental flag to false will restore search to its default behavior.

(Bigger) known bugs:

Thanks for testing!! :^)

@andreamah andreamah added this to the March 2023 milestone Mar 20, 2023
@ghost ghost assigned sandy081, karrtikr and lramos15 Mar 21, 2023
@sandy081
Copy link
Member

sandy081 commented Mar 21, 2023

Searching for milestone:"March 2023" in VS Code source code is not returning any search results - Is this expected? Because I see the string when I open github issues notebook for eg api.github-issues.

Edit: Seems expected!

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

4 participants