ipylab icon indicating copy to clipboard operation
ipylab copied to clipboard

Any support for "compound panels"?

Open deeplook opened this issue 5 years ago • 4 comments

I think it's not existing yet, but it would be very nice to have some workspace-like support for panels. This would allow to create panel sets with some predefined layout as in the attached example from the start. At the moment I can create these only as a sequence filling up (and cluttering) the space, and I have to drag and drop them heavily to achieve some desired layout. I have used HBox/VBox hierachies before, but this is just so much more dynamic. ;)

codeview

deeplook avatar Jul 14 '20 09:07 deeplook

Thank @deeplook for opening and this and the screencast!

Yes it should eventually support restoring workspaces programmatically, so it becomes possible to script the UI in Python even more (by supporting the underlying Lumino layout format, or hooking into the lab workspace restoration).

jtpio avatar Jul 27 '20 13:07 jtpio

Some more stuff here: https://github.com/jupyterlab/jupyterlab/issues/12644#issuecomment-1169853103

bollwyvl avatar Jun 30 '22 00:06 bollwyvl

I might be able to take a look at this in the near term.

I'm thinking the rough python API would be something like:

app = JupyterFrontEnd()
app.shell.workspace.data = {"layout-restorer:whatever": {}}
app.shell.workspace.metadata = {"layout-restorer:whatever": {}}

Presumably these would also be observable as individual traitlets. Going deeper into the model is probably not advisible as the children tabpanels come and go.

This would allow:

  • listing the current open panels
  • interactively updating the list of documents... within reason
    • it's probably not trivial to add ipylab panels declaratively via the restorer data
    • maybe we need some commands?
  • messing with all the sidebars, etc.

This would work... poorly in retro/notebook 7 of course, though...

bollwyvl avatar Aug 10 '23 16:08 bollwyvl

Hm, one thought here: this might require a new widget_serialization kind of thing, with opaque Activity placeholders for things not create by ipylab (like the Notebook that launches them). It's also maybe worth separating the workspace into a WorkspaceManager which can handle multiple named things, potentially switching between them, as well as not incurring the sync overhead if nobody is listening to workspaces.

bollwyvl avatar Aug 10 '23 17:08 bollwyvl