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

CTRL+F/CMD+F overrides browser's Find function with custom code #7380

Open
JasonWeill opened this issue May 23, 2024 · 8 comments
Open

CTRL+F/CMD+F overrides browser's Find function with custom code #7380

JasonWeill opened this issue May 23, 2024 · 8 comments
Labels

Comments

@JasonWeill
Copy link
Collaborator

Description

When the user presses CTRL+F or CMD+F, custom JupyterLab code for Find appears. This behavior differs from the classic notebook (https://github.com/jupyter/nbclassic/) which does not override these shortcut keys, and which instead allows the browser's built-in search bar to be displayed and used.

Expected behavior

By default, in Notebook 7, CTRL+F or CMD+F should cause the browser's default search user interface to display.

Context

This was spun off from #7041, originally filed by @jph00.

Jupyter Notebook should not override browsers' built-in keyboard shortcuts, wherever possible.

Virtual rendering may cause the browser's search box to search only a portion of the notebook; unrendered cells may not be made available to the browser.

@JasonWeill JasonWeill added bug status:Needs Triage Applied to issues that need triage labels May 23, 2024
@RRosio RRosio removed the status:Needs Triage Applied to issues that need triage label May 28, 2024
@jtpio
Copy link
Member

jtpio commented May 30, 2024

Jupyter Notebook should not override browsers' built-in keyboard shortcuts, wherever possible.

Yes this used to be the case before: #6905 (comment)

Virtual rendering may cause the browser's search box to search only a portion of the notebook; unrendered cells may not be made available to the browser.

This was indeed changed in #6905 because of the new implementation of the notebook.

@ai-robert
Copy link

@jtpio just to understand, does that mean the current behavior is intentional or is it just a side effect? and is there a way to turn it off? And perhaps most importantly, I'm designing a college course (ETA Fall 2025) that will have students run jupyter. To help them set up their environment I plan to give them either a pip requirements file or an anaconda configuration to help them set up what they need for the course. Would there be a way using one of those two methods to make the browser search the default search behavior upon setup, so I don't need to ask the students to go into settings to customize that?

@jtpio
Copy link
Member

jtpio commented Aug 14, 2024

@ai-robert yes this is intentional because of how the notebook component works in JupyterLab / Jupyter Notebook. See the comment above:

This was indeed changed in #6905 because of the new implementation of the notebook.

To turn it off, you should be able to provide a custom settings file to disable the related keyboard shortcut. Or disable the notebook windowing mode (default is full) so all the cells are displayed on the page, which should help search on the whole page with the built-in browser search.

See https://jupyter-notebook.readthedocs.io/en/stable/notebook.html#searching for more information. Happy to improve docs on this if you feel like opening a PR to make some edits please feel free, thanks!

@dreampuf
Copy link

dreampuf commented Sep 5, 2024

Can we have a simple way to disable it? I really doubt searching is working properly. It can't find what I need in most cases. The browser's search works well for both code and output.

image

@jtpio
Copy link
Member

jtpio commented Sep 5, 2024

@dreampuf were you able to try the suggestion from the above comment?

To turn it off, you should be able to provide a custom settings file to disable the related keyboard shortcut. Or disable the notebook windowing mode (default is full) so all the cells are displayed on the page, which should help search on the whole page with the built-in browser search.

Or are you suggesting there should be a more visible and explicit setting (or menu item) to disable the built-in search?

@krassowski
Copy link
Member

I really doubt searching is working properly. It can't find what I need in most cases

Can you open an issue with reproducible example? If you refer to searching in outputs, you currently need to click on the filters icon and select "Search Cell Outputs".

image

I believe there is a broad agreement that this should be enabled by default:

@krassowski
Copy link
Member

explicit setting (or menu item) to disable the built-in search

This was also brought up in jupyterlab/jupyterlab#16741 2 days ago. I think there should be an escape hatch for users to disable the built-in search, while also believing that there is a need to improve the defaults (as above) so that users do not need/want to disable it ;)

@dreampuf
Copy link

dreampuf commented Sep 8, 2024

@jtpio @krassowski, I don't know the contexts in full window mode, so I did some searching on the keywords.
https://blog.jupyter.org/jupyterlab-4-2-and-notebook-7-2-are-available-b5e6b3c753de

If the full mode is the way to improve the performance, I'm ok with having a customized search box. However, the downside would be the different behavior compared to browsers.
Explicit options to enable output search would help, and if its default could align the behavior with the browser's, it would be even better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants