Repository navigation
improve(ui): reduce startup stylesheet size - #125539
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 12:27 AM ET / 04:27 UTC. ClawSweeper reviewWhat this changesThe PR moves shared settings controls into the startup stylesheet and loads workspace and picker CSS from the modules that render settings screens and Web Awesome select pickers. Merge readiness✅ Ready for maintainer review No blocking current-head defect found. The rebase removes the previously flagged hovercard regression, and the CSS ownership split preserves eager controls while assigning workspace and picker presentation to lazy consumers. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI loads its entry stylesheet before Chat and login render, then dynamically imports route modules such as Workboard and settings pages. This change keeps shared controls eager while route-specific workspace and picker styles arrive with their owners. flowchart LR
A[Control UI startup] --> B[Shared controls CSS]
B --> C[Chat and login]
D[Settings route] --> E[Workspace CSS]
F[Picker consumer] --> G[Picker CSS]
E --> H[Settings screens]
G --> I[Workboard and language picker]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Tests +19, Docs 0. Total +20 across 15 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain the module-owned CSS split and merge the exact reviewed head after the remaining required checks complete. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR optimizes stylesheet ownership rather than reporting broken existing behavior. Is this the best way to solve the issue? Yes. The split follows the actual lazy route and picker ownership boundaries, while the direct Workboard check protects the non-settings consumer that previously exposed the gap. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9de3ca5fc93d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
358ca34 to
f5c51f0
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f5c51f0 to
16cff3f
Compare
16cff3f to
a00901c
Compare
|
Rebased onto current Post-rebase validation: 14/14 route/style browser tests and 3/3 Workboard E2E tests passed. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Additional exact-head proof for the resolved finding: |
* perf(ui): lazy-load settings workspace styles Amp-Thread-ID: https://ampcode.com/threads/T-01a01277-59ee-703a-b04d-927a3ba733a1 * fix(ui): keep picker styles route scoped Amp-Thread-ID: https://ampcode.com/threads/T-01a01277-59ee-703a-b04d-927a3ba733a1 --------- Co-authored-by: Amp <[email protected]>
What Problem This Solves
The Control UI loaded the entire settings-workspace stylesheet before showing startup surfaces such as Chat or the login gate, even though those surfaces use only a small set of shared controls. On current
main, that makes the single startup stylesheet 44,735 bytes gzip.Why This Change Was Made
Keep the controls required by startup, Chat, and login in the eager stylesheet, and load settings workspace structure and picker presentation from their owning lazy modules. The picker stylesheet is shared by the reusable picker component and the direct config language picker, so non-settings consumers such as Workboard retain their existing presentation without making picker CSS part of Chat startup.
The split moves ownership rather than deleting styles. Settings routes load workspace and component styles only when they need them.
User Impact
Connected Chat keeps one startup CSS request while downloading 1,943 fewer CSS bytes gzip (4.34%) and 1,678 fewer Brotli bytes (4.41%). Workboard retains its styled pickers and still transfers 1,141 fewer gzip CSS bytes overall, at the cost of one route-owned picker CSS request.
Evidence
Matched production builds from current
origin/main(9de3ca5fc93) and this head:Regression proof:
display: inline, weight 400) and passes with it (display: grid, weight 650).Validation:
pnpm check:changedpnpm ui:build && node --import tsx scripts/check-control-ui-performance.mts