jupyter-widgets / jupyterlab-sidecar

A sidecar output widget for JupyterLab
BSD 3-Clause "New" or "Revised" License
247 stars 39 forks source link

Use sidecar as a jupyterlab tab? #49

Closed ianhi closed 3 years ago

ianhi commented 4 years ago

This sidecar is great! One thing that would improve it for me would be the ability to pull the side car off as it's own jupyterlab tab so I have more freedom in positioning and resizing it. Jupyterlab has the ability to create a new view of cell output in a new tab (https://youtu.be/Asa_ML45HP8) but there doesn't seem to be a way to do this from python like this widget does. It also doesn't capture the output from the appearing in the original cell like this widget does.

If this is both viable and desirable then maybe it could be available as a context menu option on the tab in the sidebar?

thomasaarholt commented 4 years ago

It would be very nice to be able to place sidecars in other directions than just on the right. As far as I'm aware, there are a couple of ways this could be implemented.

One way is to duplicate the current "right-side" behavior for left, top and bottom. I haven't tested it, but I believe a partial PR for this exists in #8. A slight issue with this is that the current mechanism for hiding/revealing/closing sidecars only exists on the right side of the window.

However, I like your alternative better. It would be nice to take advantage of the existing jupyterlab window functionality. Being able to call Sidecar(position='left') and have a new tab appear would be really nice.

ianhi commented 4 years ago

For the left positioning you can swap sides from the context menu:

image

but it can be positioned in kinda strange ways, and also you lose the ability to close it: image

If it ends up being that floating tabs don't have a place in this extension then at the very least it could serve as a nice launching point for a separate extension like this but with tabs. though I'm struggling to think of as snappy a name for such an extension.

ianhi commented 4 years ago

It may even be enough just to change the 'right' to 'main' in this line

https://github.com/jupyter-widgets/jupyterlab-sidecar/blob/91438487c96365f1b4d120c5af288ca762b0ac9e/src/plugin.ts#L68

ianhi commented 4 years ago

which is indeed exactly what the PR you mentioned does

krassowski commented 3 years ago

I think that it can be closed now as #8 was just merged :) :tada:

ianhi commented 3 years ago

I think that it can be closed now as #8 was just merged :) tada

Indeed. thanks!