Repository navigation
🤖 perf: add the first-run view parity tool (T3 C step 2 PR 3b) - #6456
Conversation
…T3 C step 2 PR 3b) The parity tool (plan section 5.6, PR 3, gate 8) compares the static first-run view with the live wizard. Until PR 4b serves the view, it builds its test page by inserting #6444's constant into the served "/" by hand. These tests require that insertion to land once, outside #root, and pin the rule: 2 px of drift in x, y, width and height, and exactly one <main> in the static phase. They fail on main because scripts/perf/firstRunViewParity.ts does not exist yet. anthropic:claude-opus-5-5 high 337.13
…step 2 PR 3b) scripts/perf/firstRunViewParity.ts serves a built tree on a fresh empty root and opens "/" in a real Chrome at 390, 744, 1200 and 1900 px, in the light and the dark system theme. It holds the app's main chunk, measures the static view's "OSS contributors" paragraph and counts <main>, then releases the chunk and measures the live wizard's first frame after the handoff. It fails a run when the paragraph drifts more than 2 px in x, y, width or height, or the static phase does not have exactly one <main>. It saves full-page screenshots of both phases for PR 4b's shell check (owner decision 10-14). Until PR 4b serves the view, the served "/" has no #xum-pre, and the tool inserts #6444's FIRST_RUN_VIEW_HTML before </body> through a Playwright route. Make target: first-run-view-parity (FIRST_RUN_VIEW_PARITY_ARGS), as cleared by the perf owner. The test's #root assertion now fails with a compact message instead of an element dump. anthropic:claude-opus-5-5 high 337.13
…the painted view (PR 3b) Found on the first run against a built server (main 6090f76): - Chrome's Local Network Access blocked the app's WebSocket to 127.0.0.1 from the route-fulfilled test page, so the app showed its connection error and never handed over. The tool now launches Chrome with LocalNetworkAccessChecks disabled. - 1900 px dark measured the static paragraph before the stylesheet applied (x 0, width 500). The tool now waits for every stylesheet, then for the fonts layout asks for, then two frames. Three runs of the full matrix then passed 8 of 8 each. anthropic:claude-opus-5-5 high 337.13
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Screenshots from the final run of 390 px, light
390 px, dark
744 px, light
744 px, dark
1200 px, light
1200 px, dark
1900 px, light
1900 px, dark
Generated with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6a1511f6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…it (PR 3b review) Codex round 1 on #6456 (three P2): - A Chrome that does not launch (bad --chrome) left the detached server and the temporary root behind: the launch ran before the try/finally. The server start and the browser launch now run inside it, and a server that never answers /health is stopped before the error. - The main-module guard compared a URL path with a file path, so a checkout path with an escaped character (a space) made make first-run-view-parity exit 0 without running. It now uses fileURLToPath. - A stylesheet that never loads made the static-phase wait loop forever. It is now a 60 s waitForFunction, and a timeout is an invalid run (exit 3) with cleanup. Checked: the full matrix still passes 8 of 8, and --chrome /nonexistent exits 3 and leaves no server and no root. anthropic:claude-opus-5-5 high 337.13
|
Readiness (perf owner, workspace 8e18f4aada): I am queuing this PR at I checked these facts myself:
Generated with |
















Summary
Adds
scripts/perf/firstRunViewParity.tsandmake first-run-view-parity: gate 8's tool for PR 4b. In a real Chrome against a built server, at 390, 744, 1200 and 1900 px and in the light and dark system theme, it checks that the static first-run view's "OSS contributors..." paragraph is within 2 px of the live wizard's in x, y, width and height, and that the static phase has exactly one<main>. It saves full-page screenshots of the static phase and of the live first frame for every run, for PR 4b's shell precondition (owner decision 10-14).Background
Option C step 2 of #5971, plan section 5.6, PR 3 (split into 3a, 3b and 3c by the perf owner). #6444 added the static markup (
FIRST_RUN_VIEW_HTML). PR 4b will serve it on/, and its gate 8 needs this tool.Implementation
--tree <built tree> [--out <dir>] [--chrome <path>]. Onexum server --no-authon a fresh empty root (the first-run state), one browser context per width and theme. Widths 390 and 744 use phone emulation (touch, DPR 2); 1200 and 1900 use plain desktop. The theme is the system color scheme with empty localStorage, which is what a new user gets.main-*.jsso#xum-prestays alone on screen. The tool waits for every stylesheet and then for the fonts layout needs, measures the static paragraph and counts<main>, and takes the static screenshot. Then it releases the chunk, waits (per animation frame) until#xum-preis gone and the live paragraph exists, measures it, and takes the live screenshot./has no#xum-preyet. A Playwright route on the/document then inserts 🤖 perf: add the static first-run view's markup as a server constant (T3 C step 2 PR 2) #6444'sFIRST_RUN_VIEW_HTMLonce before</body>, which is outside#root(React clears#root).parity.jsonrecords"injected": true. When the served/already hasid="xum-pre"(PR 4b), the tool leaves the response alone.127.0.0.1, and the app showed its connection error instead of the wizard. The tool launches Chrome with--disable-features=LocalNetworkAccessChecks..PHONYentry, exactly the hunk the perf owner cleared.Validation
Tests (first commit,
scripts/perf/firstRunViewParity.test.ts), each with the mutation it catches. I applied each mutation in a scratch edit, saw the named test fail, and restored the file:#root<main>The tests fail on main because the tool does not exist yet.
One run against main
6090f7691d(hand-injected test page): 8 of 8 pass. Static and live boxes are identical at every width and theme:<main>in static phaseThe first runs found two tool bugs (the blocked WebSocket, and a measurement before the stylesheet applied at 1900 px dark), fixed in the third commit. After the fix, three full runs passed 8 of 8 each. Screenshots of the final run are in a comment below. At 1200 and 1900 px they show the shell difference behind the dialog that PR 4b must resolve.
Gates:
make static-checkexit 0,make crap-checkPASS (0 violations, 0 warnings).Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$337.13