Repository navigation
perf(ui): compact the self-contained startup document - #194604
Conversation
Preserve the startup fallback shell, inline artwork, draft recovery and CSP admission while minifying inline scripts at build time. Keep inherited document and CSS budget debt visible in build summaries, and remove six retired CSS rules.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review Summary: ✅ CompletedThis 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. |
|
Codex review: needs changes before merge. What this changesThis PR minifies inline startup scripts, removes unused CSS rules, and exposes inherited performance-budget overages. Example: Opening Chat with gzip compression
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains This PR provides a useful startup-document reduction and should stay open; one mechanical test-budget blocker needs repair. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Vite build transforms the Control UI document and styles into shipped assets; the Gateway serves the resulting document with hashes for its inline scripts. flowchart LR
A[UI source document] --> B[Vite build owner]
B --> C[Inline script compaction]
C --> D[Built document]
D --> E[Gateway response and CSP]
E --> F[Browser startup and recovery]
D --> G[Performance budget checker]
Technical reviewBest possible solution: Keep compaction in the existing build owner and add a justified allocation for the 59 new regression-test lines without raising the shared baseline. Do we have a high-confidence way to reproduce the issue? The base build leaves inline scripts unminified, and the supplied paired Gateway measurements establish the transfer reduction; read-only counting independently establishes the test-budget failure. Is this the best way to solve the issue? The implementation uses the existing HTML producer and pinned esbuild dependency, preserving fallback assets and recovery instead of introducing another loading path. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4f6148298050. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -13, Tests +59, Other +19. Total +65 across 8 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 7, 2026, 7:23 AM ET / 12:23 UTC. |
Keep preview and dev config loading out of esbuild's VM realm check. Settle resized toast animation before recording its expected position. Allocate exactly 60 regression-test lines for build fallback behavior, visible budget warnings and the animation wait; retain the shared test-line scalar.
|
Merged via squash.
|
* perf(ui): compact the self-contained startup document Preserve the startup fallback shell, inline artwork, draft recovery and CSP admission while minifying inline scripts at build time. Keep inherited document and CSS budget debt visible in build summaries, and remove six retired CSS rules. * test(ui): verify compaction through the production build * fix(ui): load the document minifier only for builds Keep preview and dev config loading out of esbuild's VM realm check. Settle resized toast animation before recording its expected position. Allocate exactly 60 regression-test lines for build fallback behavior, visible budget warnings and the animation wait; retain the shared test-line scalar.
What Problem This Solves
Every Control UI navigation downloads a larger self-contained startup document after the fallback shell landed.
User Impact
The served document is 1,921 B smaller with the same fallback appearance and recovery behavior. Existing document and CSS budget debt remains visible in build summaries.
Why This Change Was Made
Compact inline scripts at build time, preserving the fallback shell, inline artwork, early composer, bounded recovery, legacy browser explanation, and existing Gateway CSP hashing. No fallback asset moves behind a request. Remove six retired CSS rules and keep fixed-cap overages visible as nonblocking Actions warnings and build-summary entries, including report-only builds and inherited-overage comparisons.
This preserves Vyctor Brzezowski's fallback presentation from #193898 and Vincent Koc's draft-preserving downtime/recovery behavior from #191935. The separate Gateway/public-reader wordmarks in #193874/#193876 do not contribute to this document.
Byte evidence and remaining debt
Complete builds on the same Mac; pinned Node 26.12.1 checker. Base
020ec24568b12416bf4315732532bae8762101aa; measured candidate3cb8e2b8785(later commits strengthen the build-boundary test, load the same minifier only during builds, and fix a test animation race; the production transformation is unchanged). The target is at least 5% smaller document transfer, with cold-boot timing inside the existing band and unchanged fallback behavior.No cap is raised. The document still exceeds its cap by 2,107 B, and total CSS by 475 B gzip / 876 B raw. The verified dead rules are exhausted; other apparent dead selectors are emitted through dynamic class prefixes. This is a focused reduction, not a claim that all budget debt is retired. Startup JS raw bytes are identical; generated asset-name compression changes served startup gzip by +42 B and Brotli by +109 B, while the document saving is larger.
The actual gzip HTTP/1.1 Chat response is 15,888 B body + 2,697 B headers = 18,585 B, down from 20,506 B. It still does not fit IW10 at MSS 1,460 (14,600 B), before TLS overhead. The delayed-response benchmark does not emulate congestion or a throughput cap.
What grew
The retained complete #194070 artifact was verified against its exact source: all four inline source scripts, the generated locale script, and the CSS transformed through the historical build pipeline match. Its differing release metadata is isolated below. Whole-document gzip contributions use pinned mise Node and sequential replacements, not sums of independently compressed fragments. They total +4,099 B; raw growth totals +23,263 B.
That exact historical artifact is 13,820 B gzip with Homebrew Node's zlib, versus 17,879 B for the current base. The pinned mise Node build reproduces #194070's 13,829 B and measures the current base at 17,928 B. Do not mix these compression toolchains.
The cap did catch #193898: its performance job failed on 13,779 → 17,894 B gzip (+4,115 B). It merged with that failed check; its body mentions CSS/JS budget exceptions, which alone does not establish a document-budget waiver.
ui/index.htmlalready selects the check. The visibility gap fixed here is inherited excess disappearing from annotations, and report-only builds suppressing those warnings; strict growth enforcement remains unchanged.Evidence
pnpm ui:buildpnpm tsgo:uivite-build.node.test.tscontrol-ui-performance.test.ts020ec24568bNo Solid state/lifecycle changes: refactor-checklist owner/effect/listener/flush counts unchanged. Source reduction removes six CSS rules. Total change: +110/-38 lines across 10 files. Touched production files: 8,524 → 8,531 LOC; tests (including the repaired toast test): 2,460 → 2,520 LOC. The exact +60 test-line allocation preserves the shared scalar: 24 lines protect real-build fallback execution/legacy syntax, 35 protect CLI warning visibility, and one waits for resized toast geometry to settle. The small production increase is the existing build owner’s compaction and warning reporting, offset by six deleted CSS rules. No remote lease was needed.
Cold boot at 100 ms
Each cell has 20 observations; all 180 passed. Chromium thread CPU median/p95 was 482.88/507.95 → 481.29/509.65 ms, with A/A 481.93/511.74 ms. The 0.33% CPU-tail movement is below the unchanged A/A tail and the campaign’s 1% noise threshold. No cold-boot speedup is claimed: readiness stays within 0.4% of base while document transfer shrinks 10.79%. Host one-minute load median was 9.45 (p95 12.26). WebKit/Firefox do not expose comparable thread CPU in this harness.
The picker’s retired title and Talk’s retired status-text classes are absent from current emitters. Their dedicated live fixture attempts were inconclusive; the live reinjection comparison covers Lobsterdex rather than claiming those states were captured. A source-equivalent SVG
<use>experiment saved only 35 B gzip, and broad whitespace removal saved 305 B; neither closes the 2,107 B debt, so this PR retains the exact DOM/artwork and does not add that coupling.Final exact-head CI 42372593143, build artifacts 42372593105, and Workflow Sanity 42372593066 passed. Native recovery merged
009a2dfa6df95a7f161569d6176d52897b111d6basaa75d20870ac22affa7c94975210c8ad8b5e4efa.The initial PR-context check required exact template headings; the body is corrected. CI run 42371012297 then exposed two preview/accessibility tests failing on esbuild's mixed-realm invariant and a WebKit toast assertion comparing 72 px with a moving 58.44 px snapshot. The build config now loads esbuild through its existing native require only when transforming a production document, so dev/preview no longer initialize that build-only dependency. Both affected tests and all 20 build tests pass on the pinned Bun fork. The toast test now waits for its resize animation before capturing expected bounds; the full base toast file passed (14 tests, 13.20 s), so this is not classified as inherited. The repaired WebKit case passes (4.24 s runner wall). No assertions were removed. The test-line ratchet's +59 failure is addressed by the exact +60 allocation above, including the one-line animation repair. No broad local test reruns or remote leases were used.
Screenshots
Synthetic asset-free fallback, every external request blocked. Before and after PNGs are byte-identical for each viewport. Attached below.