notebook icon indicating copy to clipboard operation
notebook copied to clipboard

`activateById` toggle side panel instead of expanding it

Open brichet opened this issue 1 year ago • 1 comments

Please answer the following questions for yourself before submitting an issue

  • [x] I checked the documentation and found no answer
  • [x] I checked to make sure that this issue has not already been filed
  • [x] I'm reporting the issue to the correct repository

Description

Using the shell function activateById on a side panel widget may result to the opposite behavior, if the widget was already opened.

It may be related to https://github.com/jupyter/notebook/pull/7178. AFAIU the PR, if the id is provided and the current widget has this ID (it is opened), the expand will collapse the panel.

Reproduce

Hard to reproduce, it needs a extension that provide a sidepanel, and which call the shell.activateById on this sidepanel when it opened. See context to reproduce it.

Expected behavior

The sidepanel to remain opened.

Context

Found when testing jupyterlab_chat. This line is used to ensure that the sidepanel is open, but the sidepanel is collapsed instead.

cc. @haok1402

brichet avatar Dec 05 '24 10:12 brichet

https://github.com/jupyter/notebook/pull/7178 has been include to fix https://github.com/jupyter/notebook/issues/7147.

But these changes have led to some unexpected behavior, as the table of contents is not initially intended to be hidden by the menu, in Jupyterlab.

My opinion is that this PR should be reverted, and the menu action changed upstream in Jupyterlab, to toggle the panel instead of only activate it.

brichet avatar Dec 09 '24 08:12 brichet