-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Improve the keybinding input guard using proposed lumino features #15927
Conversation
Thanks for making a pull request to jupyterlab! |
This still requires jupyterlab/lumino#689 but I am marking this as ready for review as it can be tested by linking local installation of lumino with jupyterlab/lumino#689 applied. |
How to test it:
|
The failing |
The CI will be fixed once we merge #16078. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @krassowski it looks good to me.
I guess we want to merge first #16078 to ensure the tests are passing for this one too.
The failures of:
are persistent across three re-runs - I will investigate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @krassowski
…pyterlab#15927) * Fix saving shortcut not preventing default * Run `Command + Shift + c` immediately too * Command + S for saving on Mac * Use lumino's `holdKeyBindingExecution` and disable `preventDefault` on inline completer shortcuts * Fix compilation by adding type argument * Upgrade lumino packages to v2024.3.25 * Short-circuit on `keyup` too, disconnect handlers when done * Wait for command mode confirmation in search test
References
Ctrl + S
triggle browser's "save page", not save notebook in4.1.3
#15912 we learned that this had more side effects than intended; namely some default browser actions (like saving) were no longer prevented due to change in when theprocessKeydownEvent
is called; this lead to two conclusions:processKeydownEvent()
preventDefault
and to hold execution until a promise resolves (and to cancel execution if it resolves to false).This PR requires a new lumino release and may need to wait for 4.2.0; a short-term solution (hotfix) for JupyterLab 4.1.4 is available in #15913.
The CI on this PR is expected to fail until jupyterlab/lumino#689 is merged, released and we bump versions here.
Fixes #15744
Also relates to #4301
Code changes
Use new
holdKeyBindingExecution()
to improve the logic from #15790 and mark the problematic shortcuts withpreventDefault: false
.User-facing changes
"preventDefault": false
conflicts with default browser action such as typing a character, it will not be executed, and it the default browser action will be executed.Backwards-incompatible changes
None