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

Unable to Scroll Up in Jupyter Notebook #7520

Open
ruidazeng opened this issue Nov 17, 2024 · 14 comments
Open

Unable to Scroll Up in Jupyter Notebook #7520

ruidazeng opened this issue Nov 17, 2024 · 14 comments
Labels

Comments

@ruidazeng
Copy link

Description

When attempting to scroll up in a Jupyter notebook, the view automatically bounces back down to the current position. This prevents the user from reviewing earlier cells or content above the current view.

Reproduce

  1. Open a Jupyter notebook.
  2. Execute a few cells to create scrollable content.
  3. Attempt to scroll up to view earlier content in the notebook.
  4. Observe the behavior: the view bounces back to the current execution cell.

Expected behavior

It should let me scroll up.

@ruidazeng ruidazeng added bug status:Needs Triage Applied to issues that need triage labels Nov 17, 2024
@ruidazeng
Copy link
Author

This persists across different machines. Tried it on my Windows 10 and MacOS as well.

Every time I scroll up, it pulls up down to the starting position randomly.

@RRosio
Copy link
Collaborator

RRosio commented Nov 19, 2024

Thank you for opening this issue @ruidazeng! Could you share the version of Jupyter Notebook that you are using? We were not able to reproduce this on the triage call, but if you could share a video of the steps to reproduce and the behaviour you are seeing that may be helpful!

@krassowski
Copy link
Member

This is quite likely jupyterlab/jupyterlab#15795

The exciting part is that you say you can reproduce this reliably. If you can share the notebook which allows that and exact repro instructions as mentioned by Rosio I may be able to fix it.

@ruidazeng
Copy link
Author

This is quite likely jupyterlab/jupyterlab#15795

The exciting part is that you say you can reproduce this reliably. If you can share the notebook which allows that and exact repro instructions as mentioned by Rosio I may be able to fix it.

I am using Jupyter 7.2.2 notebook. It seems similar to jupyterlab/jupyterlab#15795 indeed, I am unable to scroll away from active cells randomly. Sometimes I can, sometimes I can't, but this issue persists across my two laptops.

@RRosio
Copy link
Collaborator

RRosio commented Nov 26, 2024

@ruidazeng thank you for the follow-up information! If you find a case where this can be reproduced consistently and can by any chance share the notebook file contents, that would be helpful!

Also, although you are using Notebook and if you can try out JupyterLab 4.4.0a0 which includes Mike's fix (jupyterlab/jupyterlab#16950) and provide any feedback in the JupyterLab issue, that would be great!

@ruidazeng
Copy link
Author

@ruidazeng thank you for the follow-up information! If you find a case where this can be reproduced consistently and can by any chance share the notebook file contents, that would be helpful!

Also, although you are using Notebook and if you can try out JupyterLab 4.4.0a0 which includes Mike's fix (jupyterlab/jupyterlab#16950) and provide any feedback in the JupyterLab issue, that would be great!

I am not able to share the exact notebook file contents, but essentially what I've noticed is this behavior tend to happen when I am doing the following three things:

(1) when I am using Python requests module to make a large amount of REST API calls (about 2-3 minutes) then storing them into a data structures (the data structure chosen doesn't seem to matter, since it occurred on both pandas dataframe and just a default list); when the calls are happening, I am unable to scroll as the page takes me right back.

(2) when I am using Python ipywidgets module to interactively interact with the users. I've used both checkboxes and sliders and this issue has persisted.

(3) when i am using Python's default input() function to get input from the user in std.in. When we are waiting on the user's input, I am unable to scroll as the page takes me right back.

@krassowski
Copy link
Member

Any chance you could provide a sanitized version of the affected notebook? I tried reproducing going by (3) and could not reproduce it:

(3) when i am using Python's default input() function to get input from the user in std.in. When we are waiting on the user's input, I am unable to scroll as the page takes me right back.

Image

(the recording is choppy but scrolling locally is smooth)

@davidvandebunte
Copy link

I'm able to reproduce reliably with the attached R notebook Preface.ipynb.txt. I added the extension .txt to attach it only because .ipynb is apparently an unsupported format. A demo of getting stuck at the bottom of the notebook:

ScrollResetFromBottom.webm

@ruidazeng
Copy link
Author

I'm able to reproduce reliably with the attached R notebook Preface.ipynb.txt. I added the extension .txt to attach it only because .ipynb is apparently an unsupported format. A demo of getting stuck at the bottom of the notebook:

ScrollResetFromBottom.webm

Does this happen on other notebooks for you as well?

@krassowski I have tried to sanitize it but after sanitation the bug isn't being re-produced reliably like before anymore

@jtpio
Copy link
Member

jtpio commented Dec 24, 2024

This should normally be fixed in the notebook 7.4 pre-release: https://github.com/jupyter/notebook/releases/tag/v7.4.0a0

If you want to try to make sure that's the case:

pip install notebook==7.4.0a0

For now the fix is only available in these JupyterLab 4.4 and Notebook 7.4 pre-releases. But it could be backported to 4.3.x / 7.3.x if it doesn't have undesired side effects.

@davidvandebunte
Copy link

Does this happen on other notebooks for you as well?

I've only run into this with this particular notebook, but I'll keep my eye out for it on others.

@ruidazeng
Copy link
Author

This should normally be fixed in the notebook 7.4 pre-release: https://github.com/jupyter/notebook/releases/tag/v7.4.0a0

If you want to try to make sure that's the case:

pip install notebook==7.4.0a0

For now the fix is only available in these JupyterLab 4.4 and Notebook 7.4 pre-releases. But it could be backported to 4.3.x / 7.3.x if it doesn't have undesired side effects.

Great to hear that. What was the underlying cause and the fix applied to address this issue? Maybe i could try to backport this to Notebook 7.3.x

@jtpio
Copy link
Member

jtpio commented Dec 26, 2024

Great to hear that. What was the underlying cause and the fix applied to address this issue?

It was fixed in the @codemirror/view package, and JupyterLab updated to the newer version in jupyterlab/jupyterlab#17064 (more info in the linked issues) to grab the fix.

Maybe i could try to backport this to Notebook 7.3.x

Thanks! I think one of the questions was about the new keyboard shortcuts that may cause some disruptions to some users. There is an issue to track this: jupyterlab/jupyterlab#17080. If you would like to give this a try and report there, that would be highly appreciated, thanks!

@krassowski
Copy link
Member

We can disable these shortcuts in backport if in doubt. Still, more user testing would reassure us that it is safe to backport the CodeMirror version updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants