fix: a document opens on the page it settles on

A pagination pass measures the DOM the last one changed, so a fresh
document searched for its layout in public — 12 of them over 550ms on a
two-column file, a phantom third page among them. Two real causes: the
flow's overflow test had no headroom, so it read its own last answer
(880px fits undecorated, 913px overflows once the decoration pins the
column height), and a split dropped the height decorations without
clearing their cache key. The rest is inherent to measuring rendered
DOM, so the page stays hidden until its layout repeats: one visible
layout instead of 12, and 21-139ms where there are no columns.
This commit is contained in:
Steffen Becker committed 2026-08-12 21:50:15 +00:00
1 parent efd4e9c8a7
commit b35551acd0
5 files changed
+88 -3

No files matched your search

+7
View File
@@ -51,6 +51,13 @@
background-repeat: repeat-y;
}
/* While a freshly opened document is still finding its pagination (Editor.svelte).
Hidden, not removed: every pass measures the same boxes either way, and the sheet
.paper paints stays up, so the page appears once instead of shuffling into place. */
.paper.settling > * {
visibility: hidden;
}
.paper .tiptap {
/* Driven by --user-margin-* set on :root from the Layout panel (pageMargins.ts).
Fallbacks preserve the original hardcoded layout when unset. */