Fix console commands enabled status if not in main area#18238
Merged
krassowski merged 2 commits intojupyterlab:mainfrom Dec 19, 2025
Merged
Fix console commands enabled status if not in main area#18238krassowski merged 2 commits intojupyterlab:mainfrom
krassowski merged 2 commits intojupyterlab:mainfrom
Conversation
|
Thanks for making a pull request to jupyterlab! |
3 tasks
krassowski
reviewed
Dec 18, 2025
| return ( | ||
| tracker.currentWidget !== null && | ||
| tracker.currentWidget === shell.currentWidget | ||
| tracker.currentWidget.node.contains(document.activeElement) |
Member
There was a problem hiding this comment.
Maybe
Suggested change
| tracker.currentWidget.node.contains(document.activeElement) | |
| tracker.currentWidget === shell.currentWidget || tracker.currentWidget.node.contains(document.activeElement) |
Thinking of cases when nothing is focused or when using command palette (in which case the command palette is active)
Contributor
Author
There was a problem hiding this comment.
Good catch, thanks.
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
krassowski
approved these changes
Dec 19, 2025
This was referenced Jan 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows to use a console out of the main area.
Most of the commands associated to the console (
run,clear,restart-kernel...) are currently enabled only if the console is in the main area.This PR updates the
isEnabled()function to allow running these commands as soon as the console has the focus.References
Related to jupyter/notebook#7790, where we'd like to open a console in the side panel, next to a Notebook. This
isEnabled()function has to be patched.Code changes
Ensure that the console has the focus instead of expecting the console to be the main area current widget.
User-facing changes
None
Backwards-incompatible changes
None