Skip to content

improve(ui): reduce startup stylesheet size - #125539

Merged
steipete merged 2 commits into
mainfrom
perf/control-ui-route-css
Aug 18, 2026
Merged

steipete merged 2 commits into
mainfrom
perf/control-ui-route-css

Conversation

@steipete

@steipete steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Startup CSS gzip: 44,735 → 42,792 bytes (−1,943 bytes / −4.34%)
  • Startup CSS Brotli: 38,089 → 36,411 bytes (−1,678 bytes / −4.41%)
  • Startup CSS requests on Chat: 1 → 1
  • Startup JS gzip: 340,992 → 341,053 bytes; both remain below the committed budget
  • Direct Workboard CSS gzip: 44,735 → 43,594 bytes including the 802-byte lazy picker stylesheet (−1,141 bytes)
  • Runtime timing medians were neutral/noisy; this PR claims the deterministic byte/request reduction, not a statistically proven latency reduction

Regression proof:

  • The new direct-Workboard computed-style assertion fails without the picker-owned import (display: inline, weight 400) and passes with it (display: grid, weight 650).
  • Fresh direct Workboard visual proof shows themed, aligned toolbar pickers with no clipping or unstyled controls.

Validation:

  • pnpm check:changed
  • pnpm ui:build && node --import tsx scripts/check-control-ui-performance.mts
  • Direct-route mocked-Gateway Chromium E2E: 4/4 across Workboard and route CSS
  • Focused picker unit checks: 3/3
  • Earlier branch-wide focused mocked-Gateway Chromium coverage: 33/33 across route CSS, login, settings controls, appearance defaults, and session groups
  • Broad Control UI run before the current-main rebase: 9,822 passing; two unrelated existing failures were isolated
  • Autoreview: clean, no accepted/actionable findings

@clawsweeper

clawsweeper Bot commented Aug 18, 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: M maintainer Maintainer-authored PR labels Aug 18, 2026
@steipete steipete self-assigned this Aug 18, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The 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
Reviewed head: a00901c877e1d2ac72b46ac4ac0ca45f5225401a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The current head cleanly resolves the earlier regressions and has focused coverage for the style-loading boundary.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR is maintainer-authored, so the external-contributor real-behavior-proof gate does not apply; its body nevertheless records direct Workboard visual and browser-test evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR is maintainer-authored, so the external-contributor real-behavior-proof gate does not apply; its body nevertheless records direct Workboard visual and browser-test evidence.
Evidence reviewed 6 items Eager versus lazy ownership: The startup stylesheet imports only shared controls, while the settings workspace imports its structural stylesheet.
Direct picker consumers retain presentation: The reusable picker and the standalone language picker each import the picker stylesheet, covering both shared and direct Web Awesome select paths.
Lazy route boundary: Workboard is dynamically imported by its route, so the picker import remains outside the startup route graph.
Findings None None.
Security None None.

How this fits together

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

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +19, Docs 0. Total +20 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 8 346 345 +1
Tests 6 21 2 +19
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 368 348 +20

Review metrics

Metric Value Why it matters
Production versus test delta production +1 net; tests +19 net; docs 0 net The stylesheet move is effectively production-neutral while focused route and style coverage expands.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a bounded startup-payload optimization with no demonstrated correctness regression on the current head.
  • 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: The PR is maintainer-authored, so the external-contributor real-behavior-proof gate does not apply; its body nevertheless records direct Workboard visual and browser-test evidence.
  • remove P1: Current review triage priority is P3, so this older priority label is no longer current.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove merge-risk: 🚨 other: Current PR review selected no merge-risk labels.

Label justifications:

  • P3: This is a bounded startup-payload optimization with no demonstrated correctness regression on the current head.
  • 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: The PR is maintainer-authored, so the external-contributor real-behavior-proof gate does not apply; its body nevertheless records direct Workboard visual and browser-test evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame assigns the settings workspace and control rules to the settings-system commit; history also shows sustained work on these files. (role: introduced the current settings-system styling; confidence: high; commits: 49cdd5425929; files: ui/src/styles/settings.css, ui/src/components/settings-workspace.ts, ui/src/components/settings-ui.ts)

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-18T03:06:07.502Z sha 358ca34b5436c19824c2d94151d4c4ca9f751b37 :: needs changes before merge. :: [P2] Keep generic picker styles available outside settings routes
  • reviewed 2026-08-18T04:05:00.859Z sha f5c51f08c1ec87107049b7be8bd1e2629b98c37b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-18T04:14:13.321Z sha 16cff3f444ed7cc7aacd5cac741f77f52ce158a0 :: found issues before merge. :: [P1] Keep sidebar session hovercards enabled

@steipete
steipete force-pushed the perf/control-ui-route-css branch from 358ca34 to f5c51f0 Compare August 18, 2026 03:55

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 18, 2026
@steipete
steipete force-pushed the perf/control-ui-route-css branch from f5c51f0 to 16cff3f Compare August 18, 2026 04:07
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 18, 2026
@steipete
steipete force-pushed the perf/control-ui-route-css branch from 16cff3f to a00901c Compare August 18, 2026 04:22

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (9de3ca5fc93) so the newly landed sidebar-hovercard restoration is preserved. ui/src/components/session-link-hovercard-target.ts is now byte-for-byte identical to main; the PR diff is again limited to the stylesheet ownership change and its focused coverage.

Post-rebase validation: 14/14 route/style browser tests and 3/3 Workboard E2E tests passed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Copy link
Copy Markdown
Contributor Author

Additional exact-head proof for the resolved finding: session-link-hovercard.test.ts passed 10/10 on a00901c877e, alongside 14/14 route/style browser tests and 3/3 Workboard E2E tests.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 18, 2026
@steipete
steipete enabled auto-merge (squash) August 18, 2026 04:32
@steipete
steipete merged commit ca8bd59 into main Aug 18, 2026
157 checks passed
@steipete
steipete deleted the perf/control-ui-route-css branch August 18, 2026 04:32
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

2 participants