Skip to content

Optimize resizing dock panels (with an opt-out)#18877

Merged
krassowski merged 3 commits into
jupyterlab:mainfrom
krassowski:responsive-resize
May 19, 2026
Merged

Optimize resizing dock panels (with an opt-out)#18877
krassowski merged 3 commits into
jupyterlab:mainfrom
krassowski:responsive-resize

Conversation

@krassowski
Copy link
Copy Markdown
Member

@krassowski krassowski commented May 13, 2026

References

This will allow us to get feedback on this change during the beta cycle, without having to commit to extended API surface in lumino yet.

Code changes

  • Adds optimizeResize Shell setting
  • Adds OptimizedDockPanelSvg subclass of DockPanelSvg
  • Uses OptimizedDockPanelSvg in the LabShell

User-facing changes

Resizing is faster. This can be verified by running:

BENCHMARK_NUMBER_SAMPLES=20 jlpm test:benchmark --grep "Notebook Resize"
Mode n avg median sd min max
optimized 20 736 ms 731 ms 19 ms 718 ms 804 ms
unoptimized 20 1444 ms 1440 ms 16 ms 1422 ms 1473 ms
To recreate table above
import json, statistics
data = json.load(open('~/jupyterlab/galata/benchmark-results/lab-benchmark.json'))
by_mode = {}
for r in data['values']:
    by_mode.setdefault(r['file'], []).append(r['time'])

for name, times in sorted(by_mode.items()):
    n = len(times)
    avg = sum(times)/n
    med = statistics.median(times)
    sd = statistics.stdev(times)
    print(f'{name}: n={n}  avg={avg:.0f}ms  median={med:.0f}ms  sd={sd:.0f}ms  min={min(times):.0f}ms  max={max(times):.0f}ms')

Before

Screencast.From.2026-04-21.15-21-43.webm

After

Screencast.From.2026-04-21.15-11-26.webm

Backwards-incompatible changes

None

AI usage

  • Yes: Some or all of the content of this PR was generated by AI.
  • Yes: The human author has carefully reviewed this PR and run this code (keep this PR "draft" until the answer is YES)
  • AI tools and models used: Claude Code, Codex

@krassowski krassowski added this to the 4.6.0 milestone May 13, 2026
@jupyterlab-probot
Copy link
Copy Markdown

jupyterlab-probot Bot commented May 13, 2026

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

View the integration tests report in the browser: UI tests report

@krassowski
Copy link
Copy Markdown
Member Author

For final release we can toggle the default to off but in beta it would be good to have it on.

Copy link
Copy Markdown
Member

@Darshan808 Darshan808 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels much smoother now, Benchmarks looks compelling and code looks good too.
Thanks!

@krassowski krassowski merged commit 06f051a into jupyterlab:main May 19, 2026
107 checks passed
@krassowski krassowski deleted the responsive-resize branch May 19, 2026 08:54
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.

2 participants