Repository navigation
Read a version on one light desktop page and its width sweep, without the 3 s shift watch - #6136
Merged
Merged
Conversation
The render check, in `page check --render` and in each page server's background reading of a handed-over version, no longer gives the `startup-layout-shift` advice. From 10 to 15 Nov it made 64 of the 109 findings those readings told agents on the pages in the state home, and it came and went between readings of the same page: fork-roadmap's 41 readings found it 6 times and told it 5. It reported every layout-shift entry Chrome recorded between navigation and the settled page, with no threshold. A box that changes size while the page loads moves painted content only where a frame was painted first, so whether a load reports it is a race. Ten runs of the reading's check per page copy: - An `<img>` without width and height decodes about 30 ms after navigation, around the first frame: thread-option-focus-ring reported it in 4 of 10 runs, diagram-fits-column on 6 to 8 of 10 per render page. - `lf-shot` has no box until its module draws, then 720 px at about 260 ms: thread-message-times, menu-hovers and error-dot-surface 10 of 10. The author can't reserve it. - `lf-toc`'s map rows rescale once the page settles (CLS at most 0.001): fable-problems 1 of 10. - The release-notes, pr-walkthrough and security-boundary examples: 0 of 10. About half the real findings came from Leaf's own widgets, whose one resize as they draw #4724 accepted. A widget that states a height gets `drawn-height` advice, read from its boxes rather than paint timing, which #5571 added because shift evidence couldn't carry the height. The rest were unsized images racing the first frame on a local server; no check reports those now. The passive watch after presentation, the only shift reading left, owns its PerformanceObserver in its probe, since the driver's shared observer existed for the startup window.
The render check (`page check --render`, a page server's reading of what an agent hands over, and the render suite) no longer leaves the light desktop page alone for 3 s and reports `passive-layout-shift` advice for content a page's own timer moves. The dark and phone pages it loaded during that watch now load after the light page, one at a time, as they did before #6114. The watch came from #4704, a constructed page that resized a block on a 1.5 s timer. In 86 kept readings and every `render` event in 373 page logs on the maintainer's machine (10-15 Nov) it never fired. A page whose script moves content on a timer now passes without that advice; `page-behavior.md` already tells the author that code run by a timer isn't reached and to operate those paths before handover. With startup shifts already gone, the check reads no layout shifts at all. Deleted with it: the `passiveLayoutShifts` probe and its module, `observe_probe` (its only caller), the layout-shift entry type, the finding's words and its paragraph in `page-behavior.md`. Tests: the three tests of the watch go (a timer page through `render_version`, the advice read with and without reserved space, and what one observation window attributes), with the model test of `observe_probe`'s cleanup.
The render check (`page check --render`, a page server's reading of what an agent hands over, and the render suite over the shipped examples) now loads a page once, in the light scheme at the desktop window, and resizes that page from 1920px to 360px as before. It no longer loads the page in the dark scheme at the desktop window, or in either scheme at a 540x720 phone window, and the sweep no longer steps through 540px or sweeps the narrow widths a second time at 720px tall. What a page no longer has checked: - anything that goes wrong only in the dark scheme: a widget that throws, draws into a box too small, leaves an SVG paint token unresolved or replaces its words only under `prefers-color-scheme: dark`, or a dark rule that clips a control; - anything that goes wrong only when the page first loads in a 540px window, such as a widget that lays itself out once by the window it started in, or a startup error at that width; - a box sized by the window's height that clips at 720px tall, where the user's window is taller (the fixed 1280x720 desktop sweep still reads 720px). None of these was ever seen on a real page. In the 86 kept readings and every `render` event in 373 page logs on the maintainer's machine (10-15 Nov), no finding came only from the dark or the phone pages, and no commit records a dark-only or phone-only render finding that led to a fix. Leaf's own dark theme keeps its dedicated suite checks, such as code contrast in both schemes over every shipped example. Findings lose `scheme` and `viewports`, which only said which of the four pages read them, so their words lose the `[light]`/`[dark]` and `(at 540x720)` marks, and a console finding its `console:` prefix. Each finding is now reported once rather than once per scheme. `_render_scheme` is `_render_page` and takes no scheme. The suite's syntax-contrast journey keeps the scheme beside each of its findings itself. Tests: the constructed dark-only cases go (a card a dark rule clips, and `lf-dusk`, whose words change only in dark), as does the card that clips only at 720px tall under a 900px desktop. The test that the gate renders four pages now says it renders one, and the counts that doubled per scheme are halved.
leaf-agent
previously approved these changes
Nov 16, 2026
# Conflicts: # browser/types/render-checks.d.ts # src/leaf/render-checks/shifts.js # src/leaf/render_gate/readings.py # tests/browser/test_page_layout_shifts.py
leaf-agent
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A render reading is now one fresh page load, light at the desktop viewport, plus the existing width sweep from 360 to 1920 px. It no longer loads the page again in the dark scheme and at a 540×720 phone window, and it no longer watches the presented page for 3 s of layout shifts. Neither part has caught anything on a real page. On this machine:
passive-layout-shift) fired 0 times, across 86 kept readings and 373 page logs (10–15 Nov);Measured with paired runs on 8 pages (4 real page copies, 4 examples), in shuffled order: a reading falls from about 8.3 s to about 5 s (−37% wall, −47% CPU). The finding sets (code, element, widths) are identical on all 13 pages tried.
Two commits:
shifts.jsgone. On its own it saves only 0.6 s, since Read page code on the render check's first page, and watch for layout shifts while the other pages load #6114 already ran the watch alongside the other loads. Combined with Stop reporting layout shifts before a page first settles #6127, the render check reads no layout shifts.schemeandviewports, which nothing else read; the suite's syntax-contrast helper keeps the scheme beside each finding itself. A fault is now reported once, not once per scheme.What to weigh:
[light]/[dark]and(at 540x720)marks.page check --rendersaves are unchanged.This builds on #6127, which deleted
startup-layout-shift.Max asked to review keeping these, adding "we generally want to simplify and remove where possible". Codex reviewed it and found no dangling consumers of the removed fields, with every remaining check and the saved screens still working.
Tests: 35 focused tests (render gate model, handover, and single render-gate journey and browser tests);
pnpm run check:browser. The deleted tests covered constructed cases only: the #4704 timer page, a card clipped only by a dark rule or a 720 px height, andlf-dusk, whose words change only in dark.