parmentelat / jupyterlab-gridwidth

BSD 3-Clause "New" or "Revised" License
7 stars 2 forks source link

regression with jupyterlab 4.2 #16

Open parmentelat opened 3 weeks ago

parmentelat commented 3 weeks ago

for a couple days/weeks now, I have noticed a regression in jlab sessions that use this extension

the symptoms are

and this even with notebooks that do not have gridwidth tags at all

I need to

because at first sight what is happening it it rather mysterious

broken jupyter --version ```bash Selected Jupyter core packages... IPython : 8.25.0 ipykernel : 6.29.4 ipywidgets : 8.1.3 jupyter_client : 8.6.2 jupyter_core : 5.7.2 jupyter_server : 2.14.1 jupyterlab : 4.2.1 nbclient : 0.10.0 nbconvert : 7.16.4 nbformat : 5.10.4 notebook : 7.2.0 qtconsole : 5.5.2 traitlets : 5.14.3 ```
parmentelat commented 3 weeks ago

when using either

gridwidth-ok

parmentelat commented 3 weeks ago

here's the behaviour obtained on the same notebook with either

gridwidth-ko

krassowski commented 3 weeks ago

Can you go to Notebook settings and change the windowing mode to none from full (default since 4.2) and see what happens? Similarly, on 4.1 if you change to full can you reproduce this? I would suggest reloading JupyterLab after changing this setting.

parmentelat commented 3 weeks ago

with 4.2.1, if I go to 'none' windowing mode, the issue vanishes

what's the deal with the windowing mode ?

parmentelat commented 3 weeks ago

and conversely under 4.1.8, moving to 'full` windowing mode triggers the issue

parmentelat commented 3 weeks ago

is there a way for an extension to act on these settings ? I mean, is it OK to consider doing so ?

krassowski commented 3 weeks ago

Yes, jupyterlab-execute-time does so, but it has a setting specific to its use case. Some users may find it annoying if you switch the windowing off but as a short-term solution until you can figure out how to support windowed mode it sounds reasonable to me (provided it is well documented).

parmentelat commented 3 weeks ago

thanks @krassowski; about this:

until you can figure out how to support windowed mode I wouldn't know where to start, where is this 'windowing' thing documented ?

krassowski commented 3 weeks ago

I wouldn't know where to start, where is this 'windowing' thing documented ?

https://jupyterlab.readthedocs.io/en/stable/developer/performance.html#windowed-list

https://jupyterlab.readthedocs.io/en/stable/api/modules/ui_components.WindowedList.html

https://jupyterlab.readthedocs.io/en/stable/api/classes/notebook.NotebookWindowedLayout.html

https://jupyterlab.readthedocs.io/en/stable/api/classes/notebook.NotebookViewModel.html

parmentelat commented 3 weeks ago

thanks for the pointers

in the meanwhile I'm tempted by the short-term approach (because otherwise the disease will slowly spread to all my students as they upgrade their envs, leading to a mess..)

it feels however that it's not just a matter of changing the windowingMode setting directly - because understandbly my extension won't be allowed to modify the notebook's extension settings, iiuc from reading this https://discourse.jupyter.org/t/how-do-i-override-settings-using-my-extensions-schemadir-file/8599/2

now, how can I achieve this as an externion developer ? as opposed to an operator, which the above post only addresses - iiuc again

thanks !

krassowski commented 3 weeks ago

Does this help?

https://github.com/deshaw/jupyterlab-execute-time/blob/c020582313868db92f1b0bdbae71aeb305b29fc1/src/index.ts#L54-L66

parmentelat commented 3 weeks ago

yes thanks, I believe this should get me started

just a question though do I understand correctly that in the linked code, 'enabled' is a setting local to the execute-time extension, and it is not related to the generic 'enabled/disabled' status of an extension, is that right ? I would have thought that the activate method of the plugin would not even be triggered if the extension is disabled, no ? (in which case a test against 'enabled' would always return true...)