Repository navigation
Read the render check's desktop at the user's window, else 1280×720 - #3696
Merged
Merged
Conversation
`page check --render` read every page's desktop at 1200x900, taller than many laptop windows, so it never saw a page that only breaks in a shorter window. It now reads the desktop at the window of the browser that last reported viewing the page (the latest report in `user-views.json`, which the page keeps for a day), and at a fixed 1280x720 laptop window before any report. The width sweep, margin renders and saved screens use the chosen window's height; the phone render stays 540x720. The gate matches the report's layout viewport rather than its `shown_window`, because it draws Leaf's panel into that viewport just as the user's browser did; matching the shown window would subtract the panel twice. Callers whose verdicts must not depend on who last viewed a page pin the fixed window with LEAF_RENDER_VIEWPORT=fixed: the suite's isolation fixture and `leaf_dev.arms.environment`, which every eval, journey and arm child gets its environment from. `page check` output names the window it read and why, in `browser.desktop`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 23, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 23, 2026
On `developer/visual-review-gallery`, the phone-screenshot `lf-shot` now keeps a usable height in a laptop-height window. Before, at 800×720 it got about 5px and its toolbar was clipped out of reach. This is a follow-up to #3696, whose laptop-height reading exposed the problem. **Cause.** The cause is the visual-review widget's own layout, not the gallery page. `lf-visual-review` fills the workspace and gives the capture row `minmax(0, 1fr)`, so the shot gets whatever the other regions leave. At 800×720 those are the case strip, caption, decision row, evidence header, claim, discussion and the pane's end room for Leaf's panel, and they leave about 5px. The capture row now has a 12rem floor (`minmax(12rem, 1fr)`). The shot keeps its toolbar and a readable frame, and the evidence pane scrolls when the window is shorter. The shot measures 192px in Chromium and in Firefox at 800×720, and 192px (from 169px) at 1280×720. **The crop.** The render check also refused this shot at every height, 18px at 1200×900 and 4px at 1280×720. `lf-shot` crops to the case's focus rectangle, so its image plane runs past `.lf-shotimage`, which hides the rest on purpose. `.lf-shotimage` now declares `--lf-drawing: 1`, the declaration the column reading accepts for an HTML drawing that zooms image pixels through its viewport. **The held window.** In compare mode, each capture's window (`.lf-shotviewport`) keeps the height the fit gave it and scrolls the capture at actual size, but it declared no held height. That was the shared cause the brief asked about. The corpus's held-scroller reading named it on the gallery, and the widget quality check `grows-with-content` named it on `lf-shot`'s own worked example in `test_bundled_widgets_meet_the_widget_quality_checks`. It now declares `--lf-holds-height: 1`. **Checks.** - The render check on the gallery went from 18 refusals to none. - `test_bundled_widgets_meet_the_widget_quality_checks` lost its `lf-shot` findings. Its `lf-code` finding remains: `keeps-first-box` first paints 8px shorter than it presents. That is a different cause, the initial renderer's height, so this PR leaves it. - `test_page_fixture_renders[visual-review-gallery]` lost its render-check and held-scroller failures. It still fails its two resize journeys: after a resize round trip, the case strip's buttons come back 86px tall where a fresh load at the same width draws them 78px. That failure was in the 2026-10-22 nightly run before this change, and it has a separate cause. - The visual-review journey and projection tests and `test_render_commands.py -k shot` pass: 36 passed. The one error is a teardown watcher on the floating panel (`unchanged write: children of div.lf-fp-answers`), which errors the same way without this change. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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 check --rendernow reads a page's desktop at the window of the browser that last reported viewing it, and at a fixed 1280×720 laptop window when no browser has reported in the last day. Before, it read every page at 1200×900, taller than many laptop windows, so it never saw a page that only breaks in a shorter one. This implements Max's decisions #44 ("Read desktop at 1280×720") and #45 ("for the normal runtime we should do the current viewport; for evals etc we should obv override it") on the overnight report.Which window. The gate takes the latest report in the page's
user-views.json(render_gate.command.desktop_viewport). It uses the report's layoutviewport, such as Max's 1728×999, and not itsshown_window(1728×941), because the gate draws Leaf's panel into the viewport just as the user's browser did. Matching the shown window would subtract the panel twice. A report counts while the page keeps it, which is one day (user_views.RETAIN_FOR); window sizes rarely change, so any kept report is a better guess than the fixed window.What follows the window. The width sweep (360–1920px), the margin-width renders and the saved desktop and widest-window screens use the chosen window's height. The phone render stays at 540×720 with its own sweep, and the phone screens stay at 390×844. The page's own code run (
run_page_code) andpackage check --renderhave no viewer to follow, so they read at the fixed window, which is now 1280×720.The pin. Callers whose verdicts must not depend on who last viewed a page set
LEAF_RENDER_VIEWPORT=fixed, which reads 1280×720 whatever the page has seen. The suite'sisolated_sessionfixture sets it, which covers CI, and so doesleaf_dev.arms.environment, which every eval agent, journey and arm command takes its environment from. Any other value is an error. Tests and the corpus that callrender_versiondirectly get 1280×720 by default.Output.
browser.desktopin thepage checkJSON names the window and where it came from:{"width": 1728, "height": 999, "from": "the user's window"}, or"fixed, since no browser has shown the page in a day", or"fixed, pinned by LEAF_RENDER_VIEWPORT".page-checkpoints.mdandconversation-loop.mdtell the agent so.Checks.
page check --renderon a page with a 1000×640 report. Unpinned, it reads{"width": 1000, "height": 640, "from": "the user's window"}and saves1000px-1.png. Pinned, it reads 1280×720.1728px-*.png. With the pin it read 1280×720. Both passed.developer/visual-review-gallery. Its mobile-capturelf-shotalready failed at 1200×900, drawn 18px outside its box at every width. That page already failstest_page_fixture_rendersin the nightly run. At 720px tall, its bounded region leaves the shot about 5px, so its toolbar controls are clipped at 720–920px wide. The shorter window shows a real defect on a page that was already red, so this PR leaves it as is. The only other change was in advice: pr-walkthrough'slf-pr-briefnow draws 1034px tall where it drew 1062px. The overflowing panes the earlier survey named, rust-sort's stage and source and wt-merge's step list, scroll and refuse nothing. Per A widget item can't leave the page:version checkrefuses the drop and a suggestion can't wrap it #43, they stay unchecked.test_the_render_gate_fails_a_page_that_scrolls_sideways_only_between_viewportsnow reads a 1280×900 desktop. At 720px tall, the desktop sweep would also catch its short-window case, which is meant to show that the phone sweep catches a clip a taller user window would miss.test_bundled_widgets_meet_the_widget_quality_checksfails on itslf-codeandlf-shotworked examples at 1280×720, and fails with the same findings at 1200×900 on this tree, so that failure was there before this change.evals/record-read-without-the-notesstill quotes an old check's "1200x900" output, because it replays a recorded session.