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

Stabilize cell height when scrolling #17132

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krassowski
Copy link
Member

References

Code changes

Adds cellHeightStabilization and assumeHeightStabilityAfter options:

  • cellHeightStabilization: Whether to pin height of the cells when scrolling to stabilize viewport (prevent jitter), and for how long since the last scroll event (in milliseconds).
  • assumeHeightStabilityAfter: If cell height stabilization is enabled, how many milliseconds should pass since the last height measurement for the stabilization algorithm to be allowed to pin the cell height

To be done:

  • minimise public API additions (widgetSizes exposure/_getCellIndex method)
  • confirm the default choices:
    • should assumeHeightStabilityAfter be 5 seconds favouring some widgets rendering for up to seconds and less frequent output "unroll" animation, or should it be 1 second favouring more stability when scrolling but less frequent "unroll" animations?
    • what should cellHeightStabilization be? Ideally it is as large as to catch consecutive scroll events (i.e. >= interval between mouse scroll wheel steps, or mouse movements when using scrollbar), and as small as to minimise the time before the outputs are "unrolled" after the scroll stopped.

User-facing changes

Scrolling is no longer jittery.

Before After
TBD TBD

Backwards-incompatible changes

None

@krassowski krassowski added the bug label Jan 1, 2025
@krassowski krassowski added this to the 4.4.0 milestone Jan 1, 2025
Copy link

Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link: Binder

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

Successfully merging this pull request may close these issues.

Scrolling over notebook got unexpected jump backs Scroll Jumps and jarring effect with full windowing mode
1 participant