Skip to content

Resizing of panels is slow when there are many nodes in resized notebooks/widgets #505

Open
@krassowski

Description

@krassowski

Description

Resizing split/dock panels is slow. #504 proposes a solution for bottom-down resizing which is specific to Chrome.

Reproduce

As in #504 but left-right.

Expected behavior

Resizing does not jitter the UI allowing users to precisely set the layout they need at a first attempt.

Proposed solution

When we start the drag action of a SplitPanel we could throttle the relayout of the contents.
This requires isolating the contents of the panel to preserve its layout by pinning width and height, adding contain:strict and then updating the width/height every once in a while to match the size of the outer container.

There is a trade-off: throttling the contents updates would mean that contents are sometimes out of sync with the container size. Some applications deal with this by stretching the contents in compositor (using transform: scale) but it only looks good if the content has little text and resizes proportionally rather than reflowing.

Ideally we would be able to only isolate the problematic elements. With windowed notebook in 4.x we are not concerned about the notebook having many cells but about cells having large outputs*, e.g. an SVG with 1000s elements ; if we could contain the SVG size (throttle its updates) for the time of resizing, the UX would be much nicer as the overall layout of notebook would still reflow smoothly.

Technically we would need to implement a special method in split panel children to handle requests:

  • "isolate large elements" (invoked by SplitPanel when user starts resizing)
  • "update size of isolated elements" (invoked by SplitPanel with throttling on mousemove when resizing)

*) or by individual cells having incredibly long code, say thousands of lines

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedPlease work on this if you are interestedperformanceAddresses performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions