-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add a scratch-pad console to the notebook #7790
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
base: main
Are you sure you want to change the base?
Conversation
…ension:commands to avoid conflict
…ole tracker updated (required to execute code)
When the command is executed, it seems that a We can see in the screen recording below that the command is executed, though, but the console needs to be reopened. record-2025-12-18_16.03.53.webm |
| app.commands | ||
| .listCommands() | ||
| .filter((id) => COMMANDS_TO_PATCH.includes(id)) | ||
| .forEach((id) => { | ||
| (app.commands as any)._commands.get(id).isEnabled = () => | ||
| tracker.currentWidget !== null && | ||
| tracker.currentWidget.node.contains(document.activeElement); | ||
| }); |
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.
allow the console commands to run in the side panel
This patch updates the isEnabled function for the commands, to allow running the commands in the side panel.
It should be fixed with jupyterlab/jupyterlab#18238.
| "@jupyter-notebook/notebook-extension": true, | ||
| "@jupyter-notebook/terminal-extension": true, | ||
| "@jupyterlab/application-extension": [ | ||
| "@jupyterlab/application-extension:commands", |
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.
This extension is not enabled anymore, except for the tree view, because it already uses the Ctrl + B shortcut.
AFAIK the commands in this extension may not be necessary for the Notebook view (not sure it is necessary at all, most of them requires a LabShell to work).
This PR allows to open a console next to a Notebook (scratch-pad like), sharing the same kernel.
there are several way to open it from a Notebook view:
menu>new>Scratch-pad consoleCtrl + BFixes #7707
Remaining tasks:
activateByIdtoggle side panel instead of expanding it #7534)