ipylab icon indicating copy to clipboard operation
ipylab copied to clipboard

Problem with split panel on Mac

Open kolibril13 opened this issue 1 year ago • 4 comments

In JLab Version 4.1.8, on Mac I get a bug when running the below script:

from ipylab import JupyterFrontEnd, SplitPanel
from ipywidgets import IntSlider

app = JupyterFrontEnd()

split_panel = SplitPanel()

slider_ctrl = IntSlider(min=0, max=100, step=1, description='Slider Control:',)


# add the widgets to the split panel
split_panel.children = [
    slider_ctrl
]

app.shell.add(split_panel, 'main', { 'mode': 'split-right' })
split_panel

split_panel.title.label = 'A SplitPanel'
split_panel.title.icon_class = 'jp-PythonIcon'
split_panel.title.closable = True
split_panel.orientation = 'vertical'

The panel just stays grey when I run the script. Only when I move the panel to the left or when I zoom in and out the widget appears.

That happens both in google chrome and in safari on local jupyter.

https://github.com/jtpio/ipylab/assets/44469195/7d921254-863e-403e-be2c-d32454f8a306

Interestingly, this bug does not occur when running this script on https://ipylab.readthedocs.io/en/latest/lite/lab/?path=widgets.ipynb

kolibril13 avatar Jun 06 '24 20:06 kolibril13

Just echoing the same experience on Mac (widget only appears after zooming in/out). In addition, there seems to be an inconsistency with where the first widget in children is displayed. With split-bottom the widget is displayed where one would expect but, with split-right, it is incorrectly displayed (see below).

Screenshot 2024-07-17 at 3 53 43 PM Screenshot 2024-07-17 at 3 53 14 PM

shb84 avatar Jul 17 '24 20:07 shb84

In Chrome on a Mac, JL 4.1.8, trying to render the simple slider widget in a panel of its own as per the demo fails for me:

image

The "render into the top bar" seems to work okay.

psychemedia avatar Jul 25 '24 15:07 psychemedia

We looked at this issue with @kolibril13 today during the PyData Paris 2024 sprints.

I can also reproduce it locally with JupyterLab 4 on Ubuntu in Chrome:

ipylab-splitpanel-issue.webm

But it seems to be working fine with JupyterLab 3. So it's likely caused by a change in JupyterLab 4, or in Lumino 2 (since JupyterLab 4 uses Lumino 2), that we would need to handle here in ipylab.

jtpio avatar Sep 27 '24 13:09 jtpio

If someone would like to look into this issue, that would likely require checking the use of the SplitPanel in the ipylab code base, and see if some CSS needs to be added or tweaked to be compatible with the latest JupyterLab 4 and Lumino 2.

jtpio avatar Jun 24 '25 15:06 jtpio