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

Change documentsearch shortcut selector to searchable class #6237

Merged

Conversation

@aschlaep
Copy link
Member

@aschlaep aschlaep commented Apr 24, 2019

This addresses bullet 1 in #6217. When the active widget changes, the documentsearch extension checks if it is searchable and applies the jp-mod-searchable class if it doesn't have it already. Then the Accel F and other shortcuts are scoped to only this class, so that they'll pass through to the browser when the focus is outside a searchable widget.

@afshin @jasongrout

@jupyterlab-dev-mode
Copy link

@jupyterlab-dev-mode jupyterlab-dev-mode bot commented Apr 24, 2019

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

afshin
afshin approved these changes Apr 24, 2019
Copy link
Member

@afshin afshin left a comment

Nice. Thank you!

👍

Copy link
Member

@afshin afshin left a comment

I thought about this PR some more. To make document search available to non-JupyterLab applications more easily, this ILabShell logic could be in its own JupyterFrontEndPlugin<void> so that the main search plugin that adds the commands installs without that hard dependency.

@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Apr 24, 2019

To elaborate for @aschlaep - this would just be splitting this one piece of logic involving the labshell into its own plugin. A test of how this makes things more flexible would be adding document search to the plain notebook example at https://github.com/jupyterlab/jupyterlab/tree/master/examples/notebook.

@aschlaep
Copy link
Member Author

@aschlaep aschlaep commented Apr 25, 2019

I moved the css class application to its own plugin and added documentsearch to the notebook example, with help from @jasongrout!

Copy link
Member

@blink1073 blink1073 left a comment

Very nice, thanks!

@blink1073 blink1073 merged commit 11d2e8f into jupyterlab:master Apr 27, 2019
9 checks passed
@jasongrout jasongrout added this to the 1.0 milestone Apr 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants