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

Use content-visibility with contain-intrinsic-size for size caching in windowed notebooks #16327

Open
krassowski opened this issue May 14, 2024 · 0 comments
Labels
enhancement tag:Virtual Rendering Lazy and virtual rendering of notebook issues and PRs
Milestone

Comments

@krassowski
Copy link
Member

krassowski commented May 14, 2024

Problem

The full windowing mode implementation is difficult to maintain when accounting for scrolling and cell output height changes interactions, and estimation of cell height. Because we calculate the total size of the container ourselves, the scrolling logic needs to account for many things which browser already can do way better and smoother.

As seen in #16326 the current implementation is problematic if the cell output content re-renders in response to visibility change; because in principle:

using content-visibility: hidden; instead of display: none; preserves the rendering state of content when hidden [MDN]

it could resolve such issues.

Proposed Solution

Limit height caching beyond initial estimation - offload all of this to the browser by using content-visibility and contain-intrinsic-size.

Additional context

This aligns neatly with a potential solution to overcome the limitations of using native search in the full windowed notebooks (#16328) by using hidden: until-found which has an equivalent effect to content-visibility: hidden.

As of May 2024 the browser support is not sufficient to ship such an implementation - Firefox and Safari only provide partial support for content-visibility (https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility).

@krassowski krassowski added enhancement tag:Virtual Rendering Lazy and virtual rendering of notebook issues and PRs status:Needs Triage Applied to new issues that need triage labels May 14, 2024
@krassowski krassowski added this to the 5.0.0 milestone May 14, 2024
@JasonWeill JasonWeill removed the status:Needs Triage Applied to new issues that need triage label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement tag:Virtual Rendering Lazy and virtual rendering of notebook issues and PRs
Projects
None yet
Development

No branches or pull requests

2 participants