Repository navigation
Let agents show a UI change as an annotated before and after image - #346
Merged
Merged
Conversation
…th a main and this PR table, publish the images to the archive/proof branch, and label a PR that changes what a person sees without one.
quanvu309
enabled auto-merge
November 12, 2026 09:11
quanvu309
added this pull request to the merge queue
Nov 12, 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.
Why
The owner's goal is to finish AirDesign as a product real people can use end to end: make a slide deck from an idea or a PowerPoint, edit it together with AI agents, and export to PowerPoint with no loss. A person judging a UI change should see what changed, and where, without reading code or opening a file on someone's machine.
The owner's words: "I think you also add some annotation skills for the verify design. and when you do a PR related to design the UI, you add before and after screenshot. please learn from this PR, skip the council stuff on this PR, learn how they have table and annotation on screenshot: pingdotgg/t3code#24776".
Today a UI PR here lists paths such as
/home/.../01-empty.pngin its body. Nobody reading the PR on GitHub can see them.What I took from the reference PR
| main | this PR |table of full, unannotated screenshots, one row per state.What changed
verify-airdesign before-after <callouts.json>(bin/proof.mjs,look/before-after.mjs,look/annotate.mjs)[{ "state", "title", "crop", "click"?, "callouts": [{ "at", "note" }] }].statenames an entry in PR 341's state registry.cropandatare selectors or a box in CSS px. An empty note, an unknown key or a bad box is refused, with the block and callout it means. A note over 90 characters warns.origin/main(or--base), checked out in a scratchgit worktreeunder~/tmp/verify-airdesign-scratch/, installed, built, and launched with the existinglaunch(VERIFY_AIRDESIGN_REPOpoints it at that tree). AFTER is this checkout (or--head). That makes two private stacks, each on its own Postgres.look/states.mjswhen it has the state, and otherwise this registry walking that side's own journey files. A base journey that expectsairdesign_edit_deckstill passes on the base. Each run also loads its own catalog routes, and one Node resolve hook shares a single Playwright between the trees.packages/themetokens and Geist, screenshotted at 850 CSS px and scale 2, so it is 1700 px wide. Text is real text. A new image starts every 6000 px. Narrow crops sit side by side; wide ones stack BEFORE over AFTER. The same run renders byte for byte the same image.look/placement.mjs) puts each circle on the side of its target with the most free room. It stays off every target and every other circle, uses the frame's 30 px margin when the crop has no room, and sits at the same spot on both sides. The arrow stops 3 px outside its target.annotated-N.png, each full screenshot unannotated,before-after.json, andbefore-after.mdwith the## Before / afterheading, the image, and the| main | this PR |table.--keepkeeps both stacks and the worktrees, so the next try passes--before-runand--after-runand takes about 8 s. Without it, the stacks stop and the worktree is removed.verify-airdesign annotate <run> <callouts.json>draws the same callouts on one run's states, for comments andlook.verify-airdesign publish <dir> --pr <n>(bin/publish.mjs)archive/proof, underpr-<n>/<dir>/. It uses a temporary index (read-treeof the remote tip,hash-object,update-index,write-tree,commit-tree) andgit push origin <sha>:refs/heads/archive/proof, so it never touches the working tree, the index or the current branch. A non-fast-forward rejection rebuilds on the new tip and pushes again, up to 5 times.https://github.com/<repo>/blob/<sha>/<path>?raw=true, so a later publish never changes an old PR's pictures. Writesbefore-after.published.md, ready to paste.github.comimage URLs, not proxied, and checked here in the API'sbody_html. So a signed-in reader with repo access loads them, and anyone else gets a 404 (checked anonymously). Nothing lands inmain.ciruns on pull requests, the merge queue and pushes tomain.journeysruns onmainonly, andbarandclosed-branchrun on PR events. After the first publish,gh api .../actions/runslists 0 runs forarchive/proof.closed-branchskipsarchive/branches.scripts/worktrees.mjsdeletes only local branches, andpublishmakes none.pnpm checksaw its tree.scripts/checked.mjsnow lets a push through only when it goes torefs/heads/archive/proofand every file in the commit is a.png. The same commit pushed anywhere else, or a commit with code pushed to the proof branch, is still refused (scripts/checked.test.mjs).Agents use it
SKILL.mdhas a short section, "Before / after in the PR": write the callouts with a good and a bad note, runbefore-after, open every image and check each arrow and note,publish, and paste the fragment.AGENTS.mdgets one line under "How agents work here" and one row in "What enforces each rule".barworkflow (scripts/bar.mjs, with the rule inscripts/before-after.mjs) labels a PRneeds-before-afterwhen it changes what a person sees and its body has noBefore / aftersection with a pinnedpr-/branch-PNG from this repo. It removes the label once the section is there;baralready reruns onedited. It warns and blocks nothing. Locally,pnpm check'sbarstep prints the same line..tsxand.cssunderapps/web/src, everything underapps/web/src/copy/,.tsx,.astro,.css,.htmland.md(x)underapps/site/src, andpackages/render/srcandpackages/theme/src. Tests are skipped..tsfile inapps/web/srcoutsidecopy/that changes what is drawn,apps/web/publicassets, and words the server sends a person. It checks that the image is pinned and in this repo, not that it is current.This PR changes what
cichecks (scripts/,AGENTS.md), so it will carrychanges-ci. It lowers no metric.What I ran
pnpm check: all steps pass on the rebased branch. Unit tests for the placement rule, the callouts reader (12 refusals with their messages, plus the long-note warning), the fragment,publishagainst a bare remote (a second publisher keeps the first's files, and the checkout's HEAD, status and branches are unchanged), the seen-paths and body rule, and the proof-push exemption.pnpm exec playwright test tests/browser/before-after.spec.ts: on a fixture page, every arrow tip ends 1 to 5 px outside its target, and no circle sits on any target.before-afterwith no flags: it built and launched the merge base and this checkout, droveagent-emptyon both, and wrote the image in 42 s. Then it stopped both stacks and removed its worktree.before-after pr339.json --base d044245~1 --head d044245, opened and fixed twice. The editor crop cut the text box, and arrow 3 crossed the Aira mark. Thenpublish --pr 339, one push. The same section is posted on Give the Agent panel a designed empty state, composer and steps #339.Before / after
Made with Claude Opus 5.5 in Claude Code, running in T3 Code.