Skip to content

fix(ui): restore attachment stylesheet build budget - #133796

Merged
steipete merged 1 commit into
mainfrom
codex/perf-attachment-icon-assets
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/perf-attachment-icon-assets

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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-mode remains 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.
  • Existing attachment-file-styles.e2e.test.ts passes 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.
  • Task-only screenshot capture was removed exactly; no test assertion, timeout or production seam was changed. Browser contexts/server returned through existing cleanup and the fixture ports are closed.
  • Independent managed review found no actionable issues (scoped clean, confidence 0.95). Full changed-file checks passed, including core-test/UI type checking, formatting, lint/stylelint, dead exports and i18n verification (170.64 s).

The exact commit that first crossed the combined CSS budget is not established. Recent static stylesheet ownership is intentionally preserved.

Before:

Attachment cards before

After:

Attachment cards after

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 12:44 AM ET / 04:44 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 2 items remain

Keep 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
Reviewed head: 4172780c3f041aac53254b76a0df80b9d068c9bc

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, coherent, net-negative refactor preserves the existing visual contract with relevant browser coverage and no identified correctness defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body supplies built-browser validation claims, but no runtime evidence was executed in this read-only review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body supplies built-browser validation claims, but no runtime evidence was executed in this read-only review.
Evidence reviewed 6 items Introduced scope and merge result: The verified merge-base-to-head delta and verified test merge change only the renderer and attachment stylesheet, with a net reduction of eight production lines.
Mode and CSS equivalence: The renderer selects the same large shell assets or compact known/unknown assets as before, now also supplying the matching dimensions; CSS retains the shared background sizing and only switches the themed image.
Caller and layout boundary: Default card rendering remains large, the only mode-sensitive layout selector still keys off the retained data-mode value, and preview mode is restricted to the media-player callers.
Findings None None.
Security None None.

How this fits together

Control 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]
Loading

Before merge

  • Resolve merge risk (P1) - The captured check rollup was incomplete, so this review cannot make a merge-ready claim until the exact-head UI build and browser checks finish.
  • Complete next step (P2) - No repair-lane work is needed: no introduced defect was found, and the remaining action is normal exact-head validation and maintainer review.
Agent review details

Security

None.

PR surface

Source -8. Total -8 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 19 27 -8
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 19 27 -8

Review metrics

Metric Value Why it matters
Production versus test delta production +19/−27 (net −8); tests unchanged The repair reduces production surface while leaving the existing browser-level visual contract intact.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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. pnpm ui:build reaches the canonical largest-CSS budget check, whose source fixes the limit at 53.5 KiB; the supplied body records before/after results, though this read-only review did not rerun the build.

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.

Labels

Label changes:

  • add P2: This repairs a bounded Control UI build-budget failure without evidence of a current end-user outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body supplies built-browser validation claims, but no runtime evidence was executed in this read-only review.

Label justifications:

  • P2: This repairs a bounded Control UI build-budget failure without evidence of a current end-user outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; its body supplies built-browser validation claims, but no runtime evidence was executed in this read-only review.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit c2d1c25 into main Aug 31, 2026
160 checks passed
@steipete
steipete deleted the codex/perf-attachment-icon-assets branch August 31, 2026 05:04
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant