Skip to content

Commit 206366f

Browse files
authored
perf: skip a notebook-wide restyle when opening the command palette (#12257)
## 📝 Summary Opening the command palette on a page with no scrollbar gap made Chrome recalculate styles across the notebook. Set `--removed-body-scroll-bar-size` to `0px` in the editor HTML so the scroll lock keeps the same inherited value. The same rule in the external stylesheet still triggered the restyle in production. In eight paired headless Chromium runs on a settled 500-cell notebook with two mounted editors, this skipped a style update across 34,165 elements. Median time from Mod-K to the first visible-frame marker fell from 225 ms to 134 ms. Every pair improved by 83–98 ms. Keyboard Shortcuts kept one wide style update and showed no consistent speedup. Verified keyboard navigation, focus restoration, accessibility-tree exclusion, nested dialogs, background pointer and wheel blocking, and compensation for a 15 px scrollbar. Related to [MO-8797](https://linear.app/marimo/issue/MO-8797/fix-find-dialogs-scroll-outline-and-remaining-per-event-helpers).
1 parent e2d7d65 commit 206366f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎frontend/index.html‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
2222
<link rel="manifest" href="/manifest.json" />
2323

24+
<style>
25+
/* Keep this inline so the scroll lock's zero gap does not restyle the notebook. */
26+
body {
27+
--removed-body-scroll-bar-size: 0px;
28+
}
29+
</style>
30+
2431
<script data-marimo="true">
2532
function __resizeIframe(obj) {
2633
const scrollbarHeight = 20; // Max between windows, mac, and linux

0 commit comments

Comments
 (0)