notebook icon indicating copy to clipboard operation
notebook copied to clipboard

JN 7.0. → Remembering layout of View panels upon saving and reopening a notebook

Open MichalRIcar opened this issue 2 years ago • 8 comments
trafficstars

Hello,

I would like to propose that new JN 7.0 notebook keeps info about the last state of user's layout - e.g. let's say that notebook's View setup is left panel Table of Contents, right panel is Debugger - and once saved with this layout it will be activated upon opening.

Or at least add it to Settings as an option, pls - whether to respect saved layout upon opening.

Best, Michal

MichalRIcar avatar Jul 28 '23 16:07 MichalRIcar

Thanks @MichalRIcar for the suggestion.

This is a feature that exists in JupyterLab. For now Notebook 7 does not implement it but it could be considered.

Or maybe you would be able to use JupyterLab directly instead of Notebook 7?

jtpio avatar Aug 03 '23 07:08 jtpio

Hello @jtpio,

thank you for considering it as I see it as very useful feature.

My solutions are for users, thus JN works as a frontend rather than dev env. JL doesn't really provide such clean and intuitive environment. Even though differences between JN and JL are not substantial from dev point of view, somehow it feels very different from user point of view..

Best, Michal

MichalRIcar avatar Aug 07 '23 20:08 MichalRIcar

Hi @jtpio ,

I have long notebooks, and a Table of Contents helps a lot. In Notebook 7 I need to go to View -> Table of Contents every time I open the notebook instead of just clicking on the already opened Table of Contents as it was in the previous version. So it's a regression that makes me go back to Notebook 6.

ViacheslavLabs avatar Aug 17 '23 17:08 ViacheslavLabs

JupyterLab is nice, but Jupyter Notebook is may be easier for some. I would appreciate this feature.

fjhickernell avatar Jul 29 '24 14:07 fjhickernell

If someone would like to give a shot at implementing this feature, please feel free!

Happy to provide some help and guidance.

jtpio avatar Aug 14 '24 14:08 jtpio

@jtpio Could you please provide some guidance on how to approach this? Would love to have a try but not sure where to start.

And to second some of the opinions here: Jupyter lab is nice but after trying it for a while I still prefer Jupyter notebook---more responsive, especially when working on a large notebook. Each notebook having its own tab provides additional conveniences (tab grouping, etc.).

dwmit avatar Nov 05 '24 19:11 dwmit

Thanks @dwmit!

To achieve layout restoration, Jupyter Notebook would probably have to include a ILayoutRestorer, similar to the one in JupyterLab: https://github.com/jupyterlab/jupyterlab/blob/7de5d18738f49b1bc05856be1242065302c985ca/packages/application-extension/src/index.tsx#L836-L921

Not sure we'll be able to reuse the one from JupyterLab directly though, as the restoration logic in Jupyter Notebook will likely be slightly different.

So a first step could be to start introducing this ILayoutRestorer, and update the application shell to make use of it: https://github.com/jupyter/notebook/blob/main/packages/application/src/shell.ts

jtpio avatar Nov 06 '24 08:11 jtpio

I use Jupyter Notebooks since I like heaving them spread across multiple Chrome windows. I would like for the TOC to open automatically when I open or reload a notebook. Not the biggest deal in the world, but would be really helpful.

oakif avatar Feb 17 '25 21:02 oakif