Repository navigation
Report a drawing's height where it differs from the box shown before it drew - #5571
Merged
Merged
Conversation
…it drew `page check --render` now gives `drawn-height` advice for each drawn element whose tag declares `x-height` and whose drawing is taller or shorter than the box it first showed. The advice names both heights, says whether what follows moved as it drew or whether a stated height larger than the drawing left blank room, and gives the `data-height` that matches the drawing. A matching `data-height`, a chart that draws at its reserved height, and an inline diff whose counted rows already take its height get no advice. `page-layout.md` promised this since #3984 and the check never did it: an eval report's `lf-diagram` with no `data-height` got only startup CLS evidence whose `after` box was all zeros, and the agent found the 937px height with `leaf-dev probe`. The zeros are the Layout Instability API clipping each source's rect to the window. That report's diagram sits about 1015px down inside the workspace's `lf-tabs` scroller, below a 720px window, so its drawn box is outside the view; in a 2400px window the same shift reports `after` as the drawn box. So the reading comes from the element's own box instead. The probe driver records the first box each element painted with x-height's `data-lf-height` shows before it is marked `lf-rendered`, by a ResizeObserver started as the page parses, so nothing holds the page's startup. `drawnHeights` then reads the drawing with that paint lifted for one read, since the diagram's CSS keeps a larger stated height after drawing. Elements hidden now, or never marked drawn (a file tree held at its stated height), are left out. It is read in the light scheme at the desktop and phone windows, so a drawing whose height depends on width gets a finding for each. On the shipped examples it fires on `pr-walkthrough` only: `pr-key-hunk`'s counted reservation is 508px against a 473px drawing at both windows, and `lf-pr-brief`'s 1037px `data-height` against 1041px on desktop and 1204px on the phone. `security-boundary`, `alert-review`, `heat-loss` and `live-progress` (two diagrams, seven charts, a source diff in a closed disclosure) get none.
leaf-agent
previously approved these changes
Nov 5, 2026
lf-diff has drawn no counted reservation for an inline patch since #4724, which accepted the resize as the drawing replaces the source text. page-layout.md still said it sized textual patches from their inline content, and the drawn-height test named its authored-body case after counted rows.
leaf-agent
approved these changes
Nov 5, 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.
page-layout.mdhas said since #3984 thatpage check --rendersuggests a drawing's height wherever it differs from what was reserved, and no check did. A fresh agent writing an eval report gave itslf-diagramnodata-height. The check printed only startup layout-shift evidence, whoseafterbox was all zeros, so the agent found the 937px height withleaf-dev probe.The render check now gives
drawn-heightadvice for every drawn element whose tag declaresx-height. It fires when the drawing is taller or shorter than the box the element showed before it drew. On that report's page, copied with the diagram'sdata-heightvaried:data-height<lf-diagram id=campaign-flow> was 314px tall before drawing and its drawing is 937px tall, so what follows it moved down 623px as it drew; data-height="937" holds the drawing's height from first paint… was 600px tall before drawing and its drawing is 937px tall, so what follows it moved down 337px as it drew; …… was 1200px tall before drawing and its drawing is 937px tall, leaving 263px blank under the drawing; …The shift evidence couldn't carry the height. The Layout Instability API clips each source's box to the window, and that diagram's drawn box sits below the window inside the workspace's tab scroller, so it came back as zeros. A shift-based check also can't see a stated height that is too large, since that moves nothing. So the reading comes from the element's own box:
lf-rendered, with a ResizeObserver started as the page parses, so nothing holds startup.drawnHeightsmeasures the drawing withdata-lf-heightlifted for one synchronous read, since the diagram's CSS keeps a larger stated height after drawing.On the shipped examples it fires only on
pr-walkthrough, and both firings are real.pr-key-hunk, an inline diff, shows its patch as 508px of source text before it draws and is 473px drawn, at both windows.lf-pr-briefstates 1037px and draws 1041px on desktop and 1204px on the phone.security-boundary,alert-review,heat-lossandlive-progressget nothing.An inline diff shows its source text until it draws, and #4724 accepted the resize that follows, so
packages/diff/instructions/author.mdsays to leavedata-heightoff inline patches. The advice gives a height there too. Whether inline patches should take one is a separate decision.page-layout.mdandevals/README.mdnow say what the check reports, andpage-layout.mdno longer sayslf-diffsizes a textual patch from its inline content, which it hasn't since #4724.test_a_drawing_reports_its_height_where_its_first_box_differedcovers no height, too small, too large, a match and an authored body that already takes the drawing's height. It fails with the reservation lift removed and with the stated height read in place of the recorded box. The startup shift, diagram reservation and widget-quality render tests, the browser type check andbuild/registry.test.mjspass.