Repository navigation
improve: reduce Control UI preload and redundant styles - #196320
Conversation
|
🦞👀 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 maintainer review before merge. What this changesThis PR defers Connect Machine dialog content, removes redundant styles, and adjusts shared chunk placement and boot capture. Example: Open Connect Machine for the first time from New Session.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this is a useful, measured reduction in Control UI preload and stylesheet bytes, with no actionable introduced defect found. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI build groups route dependencies into browser assets; the dialog consumes setup results from the existing request owner and renders connection commands. flowchart LR
Source[UI modules and styles] --> Build[Chunking and boot capture]
Build --> Assets[Browser assets]
Assets --> Shell[Connect Machine shell]
Shell --> Content[Lazy dialog content]
Owner[Setup request owner] --> Content
Technical reviewBest possible solution: Keep request authority in the existing setup owner, defer only dialog presentation, and preserve shared style and chunk owners. Do we have a high-confidence way to reproduce the issue? This is performance cleanup rather than a reported functional bug; source inspection confirms the eager dependency and redundant declarations, while supplied production-build comparisons quantify the savings. Is this the best way to solve the issue? The change uses the existing chunking, lazy-loading, error presentation, and request owners; the extracted module establishes the intended import boundary without adding authoritative state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cdcef6c25f75. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -21, Tests +38, Other -3. Total +14 across 22 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. 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 9, 2026, 7:30 PM ET / November 10, 2026, 00:30 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
) * perf(ui): defer connection details and remove redundant styles * style(ui): remove obsolete memory and rail selector branches * fix(ui): anchor boot capture import maps on warm routes * perf(ui): keep shared copy controls outside the chat chunk * fix(ui): preserve config spacing and shared helper requests
Related: #196291
What Problem This Solves
Control UI still exceeds the fixed New Session and total CSS budgets after the first byte-paydown pass. This removes source-proven dead/redundant styles and defers the Connect Machine details until the dialog is opened.
User Impact
Existing pages and settled dialog content retain their behavior and styling. On the first Connect Machine open, its native shell and Close control appear immediately while the body loads. Import failure has a retryable error. The existing request owner still owns admission, cancellation, refresh, and stale replies; no feature or cap is removed or raised.
Why This Change Was Made
Evidence
Same-machine production builds at base
bd63497962a1b90f2653ce1bdc350f31caaf4608and final source at653fda7c6cc0e763a7c5a6cf8b5a780a9d991264, normalized gzip bytes. The final bundle was built from that frozen source before committing it, so its embedded label is dirtybc05058; label/hash variance is normalized by the checker:The fixed CSS caps remain exceeded by 1,450 B gzip / 6,588 B raw. This PR does not raise them. Independent P0–P2 autoreviews, including the CI repair delta, are clean;
pnpm tsgo:ui, the changed dialog test (4 tests, pinned Bun, one worker), scoped formatting/stylelint/oxlint, production Knip, and the production build passed. The new regression covers cold body import, immediate Close, reopen, and a retired request resolving after the current request.Coverage completed all 396 original catalogue cells (99 scenes × light/dark × desktop/mobile). With the six census menus, seven E2E states and focused states, the union is 492 cells: 490 complete and two partial mobile create-agent recipes. Across 99 distinct sheet texts, 4,975 of 16,906 queryable selector strings matched; the 11,931 unmatched strings were candidates only, with 87 unqueryable fragments excluded. All 29 unobserved emitted stylesheets have live conditional owners and remain. The repeated-block audit checked 522 candidate groups and retained intentional lazy and hover/focus copies. The timing check completed with a setup gap: baseline and head both time out at the identical active-transcript readiness check before the first observation. All 24 document/asset responses completed with HTTP 200 on each; bounded DOM and Gateway inspections then also timed out. This produced zero usable observations or triplets, so no latency, CPU or timing-equivalence claim is made. The underlying renderer stall is unresolved; no source workaround was added. Visual proof before the final CI repair includes 72 paired states across the candidate builds, with 18 representative rechecks: 490 settled computed-element snapshots match except the build-label geometry. Of 68 settled screenshots, 67 match exactly after masking only the build-version footer; one dark-mobile frame has unmasked bottom-edge raster noise of at most 2/255 per channel. Four intentionally held imports show the new compact status paragraph with Close enabled. Existing stale parity recipes were repaired only in local artifacts. WebKit timed out at both smoke attempts (final: 12,008 ms); Chromium and Firefox are the available engines.
The changed cursor-policy browser test ran: 2 cases passed, 5 could not create/use a browser after local full Chrome crashed in macOS CVDisplayLink (BUS/SEGV). No failed CSS assertion was observed; this is an investigated local browser gap, not a claimed pass. The final production Knip run passed. Strict performance fails only the two shrinking CSS totals shown above, both failing on the exact merge base as well.
Production/tooling LOC across touched files: 17,820 → 17,788 (−32). Tests: 349 → 387 (+38). Generated manifest plus selector allowance config: 2,125 → 2,133 (+8). The dialog split itself grows by 32 lines for its local loading/error boundary; no new owner or synchronized state is introduced. Solid counts remain action 1, optimistic flag 1, onSettled 2, effects/cleanup/manual import loaders 0; one lazy/Loading/Errored boundary is added.
CI repair
The first full CI run exposed two PR regressions, fixed in
653fda7c6cc: Communications tab spacing and Skills/Plugins first-visit request counts. The supposedly dead config-hub selector is generated byHubTabsfrom its id and positively matched in 24 coverage states; both rules are restored. The static audit failed to reconcile that positive coverage. Regenerating the boot map also moved two config/plugin helper modules out of their previous shared chunk, adding one Skills and two Plugins requests; explicit shared placement restores that contract without bringing page renderers into boot. A fresh manifest capture attempt timed out before New Session readiness; the previous successful manifest remains, because these repairs do not change its observed route inputs. The repaired grouped production build passed and yielded the table above. The repaired Communications captures pass in both themes: content pixels are identical and computed spacing is 24 px above/below the tabs. The focused local E2E retry timed out at 120 seconds without reaching an assertion, as did the base Communications retry; final CI supplies the E2E verdict.Attribution of the remaining budgets
Exact historical builds show #195865 crossed New Session: its parent was 803,156 B, merge 803,838 B (+682 B), already 474 B above the then-raised 803,364 B cap. That bought cached-page reveal and failure/deadline release paths. This PR preserves those behaviors and pays down the route elsewhere.
The original CSS crossings are independently measured gross historical deltas:
These are gross historical changes, not allocations of today's compressed remainder. Later live changes (including Usage Display #194462, shell/settings rhythm, Files, and spinner ownership) moved the all-CSS snapshot by a net +133 B gzip / −203 B raw before this pass. #194444's gallery framing itself reduced CSS by 32 B gzip / 653 B raw. No coordinator acceptance of the remaining cost is assumed here.
Chunk placement and generator repair
Model Providers no longer loads the Usage sheet. Dashboard/Usage page rules already occupy route chunks; moving the remaining shared low-specificity controls into pages would duplicate declarations. The broader audit found no duplicate whole emitted sheet.
A fresh boot capture exposed two generator/grouping defects: warm deep-link captures rooted src/href but left import-map keys/targets relative, and ConnectCommand was pinned in the eager route-controls group. The generator now roots both map sides as the Gateway does; a same-bundle warm reload fails before and passes after. ConnectCommand leaves the eager group. Shared copy controls and their stylesheet retain shared placement so the roster/dialog consumers do not import Chat. A full regeneration and grouped production build confirm New Session remains 15 JS / 3 CSS requests and startup stays 3 JS / 1 CSS request. No caps changed.
Inspected synthetic screenshots
Communications after restoring generated-class rules (base left, repair right; light above, dark below):
Final CI
Exact-head run 42726522823 completed. The repaired Communications layout and Skills/Plugins request checks pass; inline plugin history also passes. All other selected jobs pass or are intentionally skipped except three E2E jobs and the downstream ci-gate. Their four failing cases also fail on latest completed scheduled main run 42720358153:
Control UI mocked Gateway E2E > keeps a single web conversation with in-page native navigation and Dashboard handoff: header56 vs64px.Control UI session ownership > aligns Person left status at 1200 pxand... at 390 px: gap14 vs13px.Gateway connect denial > paces unavailable handshakes at a reachable Gateway: handshake pacing assertion.The header/sidebar source and failing tests are unchanged. The native inherited-failure route is used; failed CI is not described as green.