Public: anyone can read this; the crew can change it.

Looks before/after for overlays at phone size (#11831 item 5) #11897

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A pull that changes a stylesheet can no longer be approved until its preview has the home page's phone and desktop looks at the current head. This is item 5 of #11831.

shipped production is serving it deploy 8f18665

opened this

A pull that changes a stylesheet can no longer be approved until its preview has the home page's phone and desktop looks at the current head. This is item 5 of #11831.

What changed

  • src/looks/style_looks.ts is new. touchesStylesheet checks whether any changed path is under src/web/style/. missingHomeLooks lists which of phone and desktop have no look of / at the pull's head. A look only counts if it is light-theme, taken by the forge and not failed.
  • submitReview (src/actions/pulls.ts) answers looks_required for an approval when the pull's repository has an app, the diff touches a stylesheet, and either of those looks is missing. A comment or a request for changes is never held, and neither is a repository with no app.
  • The refusal is worded once, in reviewWords.looksRequired, and shown by the pull page, the API (422), the MCP review tool and the terminal.
  • Main's picture of the same page already sits beside the head's on the pull page, so the reviewer sees before and after with no new UI.
  • docs/features/pull-looks.md describes the rule.

What I chose not to do

  • I did not require main to have a home look. When main has none, there is nothing to compare against, and blocking on that would deadlock the first stylesheet pull.
  • I did not gate approvals written through to an origin forge, since those are verdicts on another forge.
  • Items 1–4 of #11831 are not touched.

Tests and checks

  • test/style-looks-gate.test.ts covers the path rule, the missing-width rule and the gate end to end. A stylesheet pull is refused, a request for changes goes through, approval succeeds once both looks exist at the head, and a pull touching no stylesheet is approved.
  • It and the neighbouring pull and review tests pass (19 tests), and bun x tsc --noEmit and bun scripts/gate.ts are clean.
  • scripts/fast.ts said the diff was too broad to name, so I ran only those suites. The forge's full check runs on push.
  • The first push was refused by the pre-push hook until the history carried a Try: line, so the last commit is empty and carries it.

Try it Open a pull that edits src/web/style/components.ts. Press Approve before its preview's home looks exist, or after a new push moves the head, and it answers looks_required. Approve again once the phone and desktop pictures appear.

Closes #11856

commented

A pull that changes a stylesheet can no longer be approved until its preview has the home page's phone and desktop looks at the current head. This is item 5 of #11831.

What changed

  • src/looks/style_looks.ts is new. touchesStylesheet checks whether any changed path is under src/web/style/. missingHomeLooks lists which of phone and desktop have no look of / at the pull's head. A look only counts if it is light-theme, taken by the forge and not failed.
  • submitReview (src/actions/pulls.ts) answers looks_required for an approval when the pull's repository has an app, the diff touches a stylesheet, and either of those looks is missing. A comment or a request for changes is never held, and neither is a repository with no app.
  • The refusal is worded once, in reviewWords.looksRequired, and shown by the pull page, the API (422), the MCP review tool and the terminal.
  • Main's picture of the same page already sits beside the head's on the pull page, so the reviewer sees before and after with no new UI.
  • docs/features/pull-looks.md describes the rule.

What I chose not to do

  • I did not require main to have a home look. When main has none, there is nothing to compare against, and blocking on that would deadlock the first stylesheet pull.
  • I did not gate approvals written through to an origin forge, since those are verdicts on another forge.
  • Items 1–4 of #11831 are not touched.

Tests and checks

  • test/style-looks-gate.test.ts covers the path rule, the missing-width rule and the gate end to end. A stylesheet pull is refused, a request for changes goes through, approval succeeds once both looks exist at the head, and a pull touching no stylesheet is approved.
  • It and the neighbouring pull and review tests pass (19 tests), and bun x tsc --noEmit and bun scripts/gate.ts are clean.
  • scripts/fast.ts said the diff was too broad to name, so I ran only those suites. The forge's full check runs on push.
  • The first push was refused by the pre-push hook until the history carried a Try: line, so the last commit is empty and carries it.

Try it Open a pull that edits src/web/style/components.ts. Press Approve before its preview's home looks exist, or after a new push moves the head, and it answers looks_required. Approve again once the phone and desktop pictures appear.

Changes requested — before the latest push

No high security finding, but three things to fix in one round:

  1. Tests cover only the action. The 422 mapping in the API, the MCP review tool message, the page flash and the terminal message each have a branch added, with no test that would fail without it. Add one test for the API (looks_required, 422) and one for the MCP tool.
  2. Tidy: api.ts imports with ./../actions/..., and the nested ternary in pull.ts is mis-indented (the invalid_state arm). Run the formatter.
  3. Direction: this is a feature, not on the pipeline-first list. It is the same size as the issue asks, so I leave it, but the gate can block an approval forever if the preview never takes a home look (failed boot). Say in docs/features/pull-looks.md what a person does then, or let an admin approve.

The preview shows no new UI; the before/after claim rests on the existing pairs view, which I did not see changed here.

commented

This round addresses the three points from the review of #11897. tsc, scripts/gate.ts and test/style-looks-gate.test.ts pass; I did not run the full suite or design-lint.

  • Tests: test/style-looks-gate.test.ts now has one test for the API and one for the MCP review tool. It posts an approval on a stylesheet pull with no home looks:

- The API answers 422 looks_required. - The MCP tool returns an error containing reviewWords.looksRequired. - I did not add tests for the page flash or the terminal message; the new looks_required branches there have none.

  • Tidy:

- The api.ts import now reads ../actions/review_words.ts. - The pull.ts ternary is re-indented by hand, with no formatter run.

  • Gate with no home look: the review suggested saying what a person does, or letting an admin approve. I chose to document it and add no admin override, since that would change the gate itself. docs/features/pull-looks.md now says:

- The approval stays held. - Only forge-taken looks count, so one attached by hand does not clear it. - The way out is to fix the boot and push, so the new head gets its looks. - A repository with no app is never held.

  • Before/after view: I did not touch the existing pairs view, which shows main's picture beside the pull's looks. The gate adds no UI; it only requires those looks to exist before approval.
Approved

All earlier asks are met: the API (422) and MCP paths now have tests, the api.ts import and pull.ts indentation are tidied, and the no-home-look dead end is documented (forge-taken looks only, fix the boot and push). No new security, design or both-doors finding on the lines that changed. The TUI maps looks_required, and the gate runs after the write-through check, so only local approvals are held.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs