Fix toggling the side panels from menu#7799
Conversation
This reverts commit 728807f.
|
I wanted to replace the menu item or the command relative to the TOC and the debugger, with a commands toggling the side panel. Perhaps fixing #7147 should be done upstream in Jupyterlab, by changing the commands to toggle instead of activate ? |
There was a problem hiding this comment.
I tried unsuccessfully to replace the upstream shortcuts, but it seems to also disable the new shortcuts
"jupyter.lab.shortcuts": [
{
"command": "toc:show-panel",
"disabled": true,
"keys": ["Accel Shift K"],
"selector": "body"
},
{
"command": "toc:toggle-panel",
"keys": ["Accel Shift K"],
"selector": "body"
},
{
"command": "debugger:show-panel",
"disabled": true,
"keys": ["Accel Shift E"],
"selector": "body"
},
{
"command": "debugger:toggle-panel",
"keys": ["Accel Shift E"],
"selector": "body"
}
]
Finally the menu item can be disabled from the settings. |
| "disabled": true | ||
| }, | ||
| { | ||
| "command": "toc:toggle-panel", |
There was a problem hiding this comment.
Does this menu entry show up if the TOC extension is disabled?
There was a problem hiding this comment.
No, the command is created only if the TOC tracker token (ITableOfContentsTracker) is provided https://github.com/jupyter/notebook/pull/7799/files#diff-9bfcf1dd55d0d858225f19d220d93e635e9f83f14bd735a3958156a244345d24R786.
This is the same for the debugger, which expects IDebuggerSidebar token.
This PR reverts #7178.
#7178 changes the behavior of
panel.expand(), and toggle the panel instead of expanding it. Therefore, the commandshell.activateByIdcan collapse the side panel, which is not the expected behavior most of the time.References
Fixes (again) #7147
Fixes #7534
Fixes #7790 (comment)
Related to jupyterlab/jupyter-chat#105 (comment) (workaround at https://github.com/jupyterlab/jupyter-chat/blob/5b4040e83374470375eb090683f4850f9df7dd2d/packages/jupyterlab-chat-extension/src/index.ts#L697-L699)
Code changes
User-facing changes
Do not hide a side panel when using
shell.activateById()anymore.Backwards-incompatible changes
None