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

Fix search highlights removal on clearing input box #15690

Merged
merged 3 commits into from Jan 29, 2024

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Jan 24, 2024

References

Fixes #15688

Code changes

  • add integration test
  • add unit test
  • fix the problem by ending search when input query is empty

User-facing changes

Clearing search box clears active search.

Before After
before after

Backwards-incompatible changes

None

@krassowski krassowski added the bug label Jan 24, 2024
@krassowski krassowski added this to the 4.0.x milestone Jan 24, 2024
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

@krassowski
Copy link
Member Author

Note: the only failing test (Notebook scrolls to heading) is unrelated #15670.

@krassowski krassowski changed the title Fix search highlights removal on clearing input bux Fix search highlights removal on clearing input box Jan 25, 2024
@krassowski
Copy link
Member Author

@JasonWeill would you be willing to review this PR and #15703 which we could include in a small 4.0.x release?

@JasonWeill
Copy link
Contributor

@krassowski I checked out this branch and I ran the following commands in a fresh Conda environment with all Apple Silicon-related dependencies already installed:

pip install -e ".[dev,test]"
jlpm install
jlpm run build  # Build the dev mode assets (optional)

After running jupyter lab, I opened a notebook with one cell, a Markdown cell with "Now is the time for all good men to come to the aid of their country":

image

I then opened the search box and searched for Now, which worked as expected:

image

When I backspace to N, the search highlights are correct, case insensitively:

image

… but then when I backspace over N, the search continues to highlight all instances of N, until I dismiss the search box:

image

@krassowski
Copy link
Member Author

After running jupyter lab, I opened a notebook with one cell,

Thank you for testing it @JasonWeill. Do you see the red strip dev mode indicator at the top of the page? If not it is likely that you are served production assets from older version - can you try shutting jupyterlab and starting again with jupyter lab --dev-mode?

@JasonWeill
Copy link
Contributor

@krassowski Thank you! I relaunched in dev mode and things look good. Should be good to merge once UI tests are updated (if necessary).

@krassowski krassowski merged commit b1d2858 into jupyterlab:main Jan 29, 2024
80 of 81 checks passed
@krassowski
Copy link
Member Author

@meeseeksdev please backport to 4.0.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyterlab that referenced this pull request Jan 29, 2024
krassowski added a commit that referenced this pull request Jan 30, 2024
…ox (#15712)

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search highlights don't get removed when removing the search query
2 participants