Repository navigation
Add a stills script that screenshots UI states on base and HEAD - #1341
Merged
Merged
Conversation
`scripts/stills.py [BASE_REF]` builds base and HEAD arms the way the benchmarks do, serves three examples on each, drives a catalogue of states from a fresh tab, and screenshots the viewport. A state that differs by any pixel is cropped to the changed region, with the changed pixels marked, under `.tmp/stills/`. The catalogue has 15 states, including ones reached by input: a margin card opened by pointer or by keyboard, a reply being drafted, the Threads panel, a comment composer, a board card grabbed, and a focused code block. Some are repeated at 900px wide or in dark mode. Run against 64186bc, the commit before #1329, it flags exactly the two ring defects #1329 fixed, plus the Threads panel's new "Generating title" placeholder from main. Run against the merge base, where only scripts differ, all 15 states are identical pixel for pixel, so the script counts any differing pixel with no noise threshold. A run takes about three minutes. The benchmark's server start and its merge-base default move into `eval_harness` (`serving`, `merge_base`), which the new script and `bench_page_latency.py` share. `profile_page.py`, which serves through the benchmark, still runs. `/developing-leaf`'s proof section and `skills/leaf/assets/AGENTS.md` name the script as the way to take the before/after pair, and say to add a state to `STATES` rather than driving one by hand. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 27, 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.
Agents proving a visible change wrote their own Playwright screenshot script each time: 140 throwaway scripts across 43 Leaf sessions and subagents in two weeks. The session behind #1303 took none, and a padding change there covered the focus ring of a keyboard-opened margin card until #1329 fixed it.
uv run scripts/stills.py [BASE_REF]replaces those scripts with one opt-in command, about three minutes unattended. Nothing gates on it.It screenshots a fixed catalogue of 15 states on the merge base's runtime and HEAD's, each built by that arm's launcher from this checkout's example source and served by that arm's
leaf server run --temporary. The catalogue covers states a user reaches by acting as well as pages at rest: a margin card opened by pointer and by keyboard, a reply being drafted, the Threads panel, a comment being composed, a board card grabbed, a focused code block, with some repeated at 900px and in dark mode. Each state that changed is cropped to a before/after pair plus a diff under.tmp/stills/, with anindex.htmllisting changed and failed states first.A state counts as changed when any pixel differs: with the same runtime on both arms every state captures pixel-identically, so no noise threshold is needed. Run against the commit before #1329, it flags exactly the two ring regressions that PR fixed, plus the Threads panel's "Generating title" placeholder from #1330.
scripts/stills.py: the catalogue (STATES), the input that reaches each state, and the pixel diff.scripts/eval_harness.py:serving(start an arm's temporary server and yield its address) andmerge_base, moved out ofbench_page_latency.pyso both scripts share them./developing-leaf"Prove and hand off a visible change" andskills/leaf/assets/AGENTS.md"Render gates" name the script as the way to get the before/after pair, and say to add a missing state toSTATESrather than drive it by hand.🤖 Generated with Claude Code