jtpio / ipylab

Control JupyterLab from Python Notebooks with Jupyter Widgets 🧪 ☢️ 🐍
BSD 3-Clause "New" or "Revised" License
196 stars 13 forks source link

Any support for "compound panels"? #48

Open deeplook opened 4 years ago

deeplook commented 4 years ago

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

jtpio commented 4 years ago

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).

bollwyvl commented 2 years ago

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

bollwyvl commented 1 year ago

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:

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

bollwyvl commented 1 year ago

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.