Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dancing Page #257

Open
microcoder opened this issue Jan 11, 2025 · 9 comments
Open

Dancing Page #257

microcoder opened this issue Jan 11, 2025 · 9 comments
Labels
bug Something isn't working

Comments

@microcoder
Copy link

Description

When enabled extension jupyterlab-myst and when you use mouse wheel then notebook start dancing with images in notebook or when you use built-in support mermaid generation images

2025-01-11.08-31-58.mp4

A notebook for example:

dancing-page.ipynb.txt

@microcoder microcoder added the bug Something isn't working label Jan 11, 2025
@jangenoe
Copy link

I believe installing 4.4.0a2 should help here (it did for me):

pip install jupyterlab==4.4.0a2

See the solution by @krassowski in jupyterlab/jupyterlab#17064

@krassowski
Copy link

Thanks for the ping! If 4.4.0a2 does not help it may require jupyterlab/jupyterlab#17132

@microcoder
Copy link
Author

microcoder commented Jan 16, 2025

No, 4.4.0a2 did not help. In my case, the issue appears when the extension jupyterlab-myst is enabled. When I turn to disabled the extension, I don't see this problem.

@microcoder
Copy link
Author

microcoder commented Jan 16, 2025

Hmmm... I tried to follow this note and the issue went away!

When I turn in Settings EditorNotebookWindowing mode from full to defer the issue don't happens! I switched many times and the issue goes away when Windowing mode==defer

I have next extensions:

ubuntu@jupyter:~$ jupyter labextension list
JupyterLab v4.4.0a2
/home/ubuntu/.jupyter_venv/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
        jupyterlab-execute-time v3.2.0 enabled OK (python, jupyterlab_execute_time)
        jupyterlab_scenes v2.0.0-alpha1 disabled OK (python, jupyterlab_scenes)
        nbdime-jupyterlab v3.0.2 enabled OK
        spreadsheet-editor v0.7.2 enabled OK (python, jupyterlab-spreadsheet-editor)
        jupyter-matplotlib v0.11.6 enabled OK
        jupyterlab-quarto v0.3.5 disabled OK (python, jupyterlab-quarto)
        jupyterlab-myst v2.4.2 enabled OK 🔒 (plugins: jupyterlab-myst:executor locked) (python, jupyterlab_myst)
        @jupyter-widgets/jupyterlab-manager v5.0.13 enabled OK (python, jupyterlab_widgets)
        @jupyter-lsp/jupyterlab-lsp v5.1.0 enabled OK (python, jupyterlab-lsp)
        @jupyterlab/git v0.50.2 enabled OK (python, jupyterlab-git)


Disabled extensions:
    @jupyterlab/completer-extension:base-service
    @jupyterlab/fileeditor-extension:language-server
    @jupyterlab/lsp-extension:settings
    @jupyterlab/notebook-extension:language-server
    jupyterlab-quarto (all plugins)
    jupyterlab-quarto:@quarto/mermaid
    jupyterlab_scenes (all plugins)

@krassowski
Copy link

It sounds like it:

The problem is that some renderers like myst resize the cell during the rendering sequence, so they shift viewport as new cells are added to viewport. This pushes other cells out of the viewport, detaches them and attaches others - which can even result in an infinite feedback loop. There are two ways to solve it:

  • a) force the cell to not resize for some time after it is scrolled into the viewport
  • b) never detach/hide cells which have unstable renderer (reduces performance gains)

I explored (a) in jupyterlab/jupyterlab#17132 but it looks really tricky to get this one right as there are many corner cases and unanswered questions (for how long should we stabilise the cell? When we can assume the user stopped scrolling? etc). We may need to go for (b).

@fperez
Copy link
Contributor

fperez commented Feb 8, 2025

Thanks @RRosio for tagging this, I didn't realize it could be connected to MyST!

I can absolutely confirm that the problem disappears when uninstalling jupyterlab-myst from the environment.

Not sure what the best course of action is, @krassowski, and I'm sorry to hear it's such a tricky problem. But at this time, I think sacrificing some performance gains is acceptable, given that the current scenario basically makes JupyterLab unusable :(

@itsmoa
Copy link

itsmoa commented Feb 8, 2025

Thanks!

Following these steps to changing window mode to defer seems to have solved the issue. jupyterlab/jupyterlab#15795 (comment)

In Settings Editor → Notebook → Windowing mode - Defer

I did not have jupyterlab myst installed

@fperez
Copy link
Contributor

fperez commented Feb 8, 2025

Thanks for reporting this, @itsmoa ! That makes it more, ahem, interesting 😉! I have no clue then - in my case it was very clear: I un/reinstalled lab-myst several times, and the problem's presence perfectly correlated with lab-myst.

It's always possible that two different things are triggering the same annoying behavior, though. In my case, I wasn't touching the windowing mode at all. So who knows, perhaps what the MyST extension does has a similar effect as the windowing settings? Just speculating here, though - I don't know for sure and I'm not at all familiar with those code paths.

@krassowski
Copy link

The issue with jupyterlab-myst only affects the default full windowing mode. There are two solutions indeed:

While I do not like it, for now jupyterlab-myst could default users to defer mode. This is what https://github.com/parmentelat/jupyterlab-gridwidth does as it is not compatible with the full windowing mode for other reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants