notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Make left/right areas visible in RetroLab for extensions

Open JasonWeill opened this issue 4 years ago • 5 comments
trafficstars

This issue is a successor to jupyter/retrolab#257.

Problem

Extensions in RetroLab may not appear if they need to add items to the left or right areas. These areas are not present in RetroLab and cannot be shown.

Proposed Solution

Allow users to install extensions that show up in the left and right panels. Do not show the left and right tab bars, as is done in JupyterLab, but instead show each extension in the View menu as a cascading submenu item. The left and right panels should have an X (close) button to dismiss them. Left and right panels should appear in a horizontal grid with the main area, not overlapping the main area.

Additional context

@jtpio showed @ellisonbg and myself a concept to let users hide tab bars and side panels on the left and right of a notebook: https://gist.github.com/jtpio/4e9a3d435d7c3950dc4150c10abbb1d7

JasonWeill avatar Nov 03 '21 18:11 JasonWeill

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Nov 03 '21 18:11 welcome[bot]

Thanks @jweill-aws for opening this issue :+1:

Do not show the left and right tab bars, as is done in JupyterLab, but instead show each extension in the View menu as a cascading submenu item

This sound like a nice approach. If we start having the tab bars (also called activity bar in JupyterLab 4.0.0ax), then it might look too similar to the existing the Simple Interface.

TOC2 is one of the popular extensions for the classic notebook, and it could be interesting to take a look at it for inspiration / reference:

toc2

jtpio avatar Nov 04 '21 10:11 jtpio

In https://github.com/jupyterlab/retrolab/issues/257 there is a section about reusing the LabShell from JupyterLab. But maybe we don't need to go down that road for now, and instead expand the current RetroShell to allow for the left and right areas. There would also be new public methods to show the these areas.

Do not show the left and right tab bars, as is done in JupyterLab, but instead show each extension in the View menu as a cascading submenu item

For this there could be a plugin that lists the available widgets in the left and right areas, and creates the menu entries accordingly.

jtpio avatar Nov 04 '21 10:11 jtpio

For this there could be a plugin that lists the available widgets in the left and right areas, and creates the menu entries accordingly.

This could be based on the shell.widgets() method, after we add support for the left and right areas:

https://github.com/jupyterlab/retrolab/blob/2a96903699b66544a2c3c076cc5583e35d79dca7/packages/application/src/shell.ts#L171-L182

With this method we can dynamically retrieve the list of widgets that were added to the left / right areas by other extensions.

The plugin could then also use the shell.activateById() method to decide which of the widgets in the left and right area currently has the focus. For now it only handles the main area:

https://github.com/jupyterlab/retrolab/blob/2a96903699b66544a2c3c076cc5583e35d79dca7/packages/application/src/shell.ts#L106-L114

The plugin handling that logic could then live in the application-extension package alongside other application related plugins, using the public methods on app.shell. For example this plugin controls the visibility of the header:

https://github.com/jupyterlab/retrolab/blob/2a96903699b66544a2c3c076cc5583e35d79dca7/packages/application-extension/src/index.ts#L449-L514

jtpio avatar Nov 05 '21 17:11 jtpio

I'm working on adding the toc-extension package to the retrolab monorepo, as that seems to be highly requested as a first extension. There are a substantial amount of dependencies on this extension; one changelist I have has over 500 new files just to get compilation working.

JasonWeill avatar Nov 05 '21 21:11 JasonWeill