Skip to content

Read the render check's desktop at the user's window, else 1280×720 - #3696

Merged
max-sixty merged 1 commit into
mainfrom
agent-a7175a0bf3da2f85e
Oct 23, 2026
Merged

max-sixty merged 1 commit into
mainfrom
agent-a7175a0bf3da2f85e

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

page check --render now 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 layout viewport, such as Max's 1728×999, and not its shown_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) and package check --render have 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's isolated_session fixture sets it, which covers CI, and so does leaf_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 call render_version directly get 1280×720 by default.

Output. browser.desktop in the page check JSON 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.md and conversation-loop.md tell the agent so.

Checks.

  • A new model test covers the choice: no report gives 1280×720, the latest of two reports wins, a report more than a day old drops out, the pin gives 1280×720, and a bad pin raises.
  • A new journey test runs page check --render on a page with a 1000×640 report. Unpinned, it reads {"width": 1000, "height": 640, "from": "the user's window"} and saves 1000px-1.png. Pinned, it reads 1280×720.
  • On a copy of a real page carrying Max's 1728×999 report, the unpinned check read 1728×999 and saved 1728px-*.png. With the pin it read 1280×720. Both passed.
  • I ran the render gate over all 40 corpus pages (shipped examples, regression pages and developer pages) at 1200×900 before this change and at 1280×720 after it. Only one page gained a refusal: developer/visual-review-gallery. Its mobile-capture lf-shot already failed at 1200×900, drawn 18px outside its box at every width. That page already fails test_page_fixture_renders in 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's lf-pr-brief now 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 check refuses 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_viewports now 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_checks fails on its lf-code and lf-shot worked 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-notes still quotes an old check's "1200x900" output, because it replays a recorded session.

This was written by Claude Code on behalf of max-sixty

`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]>
@max-sixty
max-sixty merged commit 2d17806 into main Oct 23, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-a7175a0bf3da2f85e branch October 23, 2026 06:04
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants