Repository navigation
fix(ui): restore attachment stylesheet build budget - #133796
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:44 AM ET / 04:44 UTC. ClawSweeper reviewWhat this changesThe branch moves attachment-icon dimensions and theme asset selection into the Control UI renderer, removing duplicate stylesheet rules to bring the largest CSS bundle back under its existing budget. Merge readinessKeep open. The focused renderer/CSS refactor preserves the two attachment-icon modes and current main does not yet contain it; no blocking correctness finding was identified, while the captured exact-head checks were still running and the PR carries the protected maintainer label. Priority: P2 Review scores
Verification
How this fits togetherControl UI attachment cards resolve a file type from attachment metadata, render a large placeholder or compact preview icon, and use CSS to select the active theme asset. Those icons feed chat attachment cards and media-player previews. flowchart LR
A[Attachment metadata] --> B[File icon resolver]
B --> C[Attachment icon renderer]
C --> D[Theme-aware stylesheet]
D --> E[Large attachment card]
D --> F[Compact media preview]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -8. Total -8 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the renderer-owned mode selection and land it once the exact-head Control UI build and existing attachment-style browser coverage confirm the recorded budget recovery and visual invariants. Do we have a high-confidence way to reproduce the issue? Yes. Is this the best way to solve the issue? Yes. Selecting the known mode once at the renderer is the smallest canonical owner-boundary fix; raising the budget would preserve the duplicated stylesheet policy, while the prior static stylesheet import remains intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ee036be77963. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Resolves a problem where Control UI builds fail the existing stylesheet budget, blocking unrelated PRs. Current main reproducibly emits a 54,809-byte gzip CSS chunk against the 54,784-byte limit; four jobs in Doctor CI fail on the same asset.
Why This Change Was Made
The attachment icon renderer already knows whether it is a large placeholder or a compact preview. Prepare that mode's dimensions and light/dark asset pair once, then let the stylesheet handle theme selection. This removes unused asset preparation and duplicated mode rules while retaining the static CSS import that prevents unstyled offline renders.
data-moderemains because the card layout uses it for padding.No budget, baseline, chunking, dependency, public setting or fallback changes. Production LOC: +19/−27 (net −8); tests unchanged. Raising the limit or reverting static CSS loading would leave the underlying duplication in place.
User Impact
Attachment cards retain the same appearance and behavior, and the canonical UI build passes again. This is a small build and renderer cleanup; no end-to-end latency or memory improvement is claimed.
Evidence
pnpm ui:build: before fails at 54,809 B, after passes at 54,753 B largest CSS gzip. Startup remains 8 JS requests and 1 CSS request; startup JS gzip 345,585→345,576 B and startup CSS unchanged at 45,347 B. All budgets pass. The first partial cleanup saved only 22 B and still failed; the final change also removes duplicated sizing policy.attachment-file-styles.e2e.test.tspasses against fresh browser bundles before and after: large/compact geometry, both themes, PDF masks, unavailable colors/opacity/strikethrough and card layout. Computed styles are identical after excluding ephemeral fixture ports; full viewport PNGs are byte-identical in both themes. The Gateway is mocked in this suite; it is real Chromium rendering the built UI, not live provider or channel proof.The exact commit that first crossed the combined CSS budget is not established. Recent static stylesheet ownership is intentionally preserved.
Before:
After: