Skip to content

improve(ui): enforce build performance budgets - #106367

Merged
steipete merged 1 commit into
mainfrom
codex/control-ui-performance-budgets
Jul 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/control-ui-performance-budgets

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #106363

What Problem This Solves

Resolves a problem where Control UI startup request and transfer-size regressions could pass production builds unnoticed, allowing earlier loading improvements to erode without an actionable guard.

Why This Change Was Made

The canonical production UI build now reads startup assets from generated HTML, measures the gzip and Brotli sidecars that OpenClaw actually ships, reports startup, largest-asset, and total bundle metrics, and fails on explicit startup or largest-asset ceilings. The budgets keep modest headroom over the measured optimized baseline; focused tests cover extraction, aggregation, violations, and missing compressed assets.

AI-assisted: yes. The implementation and tests were reviewed with the repository autoreview helper.

User Impact

Future Control UI bundle regressions become actionable build failures before release. This changes build validation only; runtime behavior and visible layout are unchanged.

Evidence

  • Blacksmith Testbox tbx_01kxdnt53pw18kjeqgkzsc5m3d / run 29248461172: focused performance suite passed, 4 tests.
  • pnpm ui:build: 472 finalized sidecars verified; startup JavaScript 23 requests / 297.0 KiB gzip, startup CSS 1 request / 37.6 KiB gzip, largest JavaScript 188.7 KiB gzip, and largest CSS 37.6 KiB gzip; all budgets passed.
  • pnpm tsgo:test:root: passed.
  • Targeted Oxlint: 0 warnings, 0 errors.
  • Targeted Oxfmt check: passed.
  • .agents/skills/autoreview/scripts/autoreview --mode local: clean; no accepted/actionable findings.
  • Screenshots not applicable: build validation only; no visible UI change.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Jul 13, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready at exact head c3cb2fd0aed5bfd27761aab72270334d91cb3990.

Focused proof:

  • Blacksmith Testbox tbx_01kxdnt53pw18kjeqgkzsc5m3d / run 29248461172: pnpm test test/scripts/control-ui-performance.test.ts && pnpm ui:build && pnpm tsgo:test:root && pnpm exec oxlint scripts/check-control-ui-performance.mjs test/scripts/control-ui-performance.test.ts && pnpm exec oxfmt --check package.json scripts/check-control-ui-performance.mjs scripts/check-control-ui-performance.d.mts test/scripts/control-ui-performance.test.ts passed.
  • Focused tests: 4 passed.
  • Production build: 472 finalized sidecars verified; all six performance budgets passed.
  • Measured baseline: startup JavaScript 23 requests / 297.0 KiB gzip; startup CSS 1 request / 37.6 KiB gzip; largest JavaScript 188.7 KiB gzip; largest CSS 37.6 KiB gzip.
  • Root test TypeScript gate, targeted Oxlint, and targeted Oxfmt: passed.
  • Fresh autoreview: clean; no accepted/actionable findings.

Mergeability: clean. Required status checks: none; main is unprotected. Known proof gap: screenshots and runtime live proof are not applicable to this build-only validation guard. Active optional CI is not a merge gate.

@steipete
steipete merged commit 644bc79 into main Jul 13, 2026
106 of 110 checks passed
@steipete
steipete deleted the codex/control-ui-performance-budgets branch July 13, 2026 12:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3cb2fd0ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
"tui:pty:test:watch:fake": "node --import tsx scripts/dev/tui-pty-test-watch.ts --mode fake",
"tui:pty:test:watch:local": "node --import tsx scripts/dev/tui-pty-test-watch.ts --mode local",
"ui:build": "node scripts/ui.js build && node scripts/check-control-ui-precompressed-assets.mjs",
"ui:build": "node scripts/ui.js build && node scripts/check-control-ui-precompressed-assets.mjs && node scripts/check-control-ui-performance.mjs",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce budgets for direct UI build callers

When the Control UI is built through pnpm mac:package/scripts/package-mac-app.sh, the macOS packaging path still runs node scripts/ui.js build directly at scripts/package-mac-app.sh:213, so it bypasses the new precompressed-asset and performance-budget checks added only to the ui:build package script. That leaves a production packaging flow able to ship a bundle that violates these budgets; move the checks behind scripts/ui.js build or update the direct caller so all production UI builds hit the same guard.

Useful? React with 👍 / 👎.

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

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Enforce Control UI build performance budgets

1 participant