Skip to content

perf(ui): defer optional feature English copy - #181555

Merged
steipete merged 10 commits into
mainfrom
solid2/w-perf-feature-copy
Oct 23, 2026
Merged

steipete merged 10 commits into
mainfrom
solid2/w-perf-feature-copy

Conversation

@steipete

@steipete steipete commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Startup, Chat, and New Session load English copy for feature surfaces that have not opened. Move 245 strings to their existing feature-owned catalog boundaries, registering them synchronously when the consumer loads. Shared namespace identity and reactive translation invalidation stay intact.

Native inline plugin views added an eager dependency on the disabled-plugin notice. Keep its three first-paint strings eager, along with the loading/unavailable labels; the notice must render without loading the optional plugin-management catalog. The complete canonical catalog retains 11,350 strings with exactly the same flattened order and values. No text or translation memory changes.

Affected production source: 14,988 → 15,405 lines (+417) across 54 files. Affected tests: 663 → 671 (+8) across four files. The added source is named catalog data/registrars and registration at existing consumers. Refactor counts remain unchanged: effects 4; render effects 0; untrack 0; direct listeners 0; island queries 1; flush 0; owner APIs 0; cleanup 4.

Evidence

Base b19bade1d3ad29533784228947e7a729c70a0961; final candidate cb9439542a221760c8eeb9818ef89e629353ae17. The local runtime build used reviewed source aa3b2e220ec93d5a243e9c5bc7049a9baac47ef7 plus the canonically generated boot manifest. The final commit changes only that manifest and budget metadata. Both sides use identical fixed b19b build metadata, 29 verified plugin inputs, Node 24.22.1, Vite 8.3.4, and libdeflate 0.1.0 level 11 gzip sidecars.

Surface Base gzip Candidate gzip Change JS requests
Startup 285,482 B 282,539 B −2,943 B 7 → 7
Chat 1,276,133 B 1,273,579 B −2,554 B 21 → 21
New Session 771,667 B 768,843 B −2,824 B 16 → 16

CSS bytes and requests are identical on all three surfaces. Strict performance checks pass. Startup baseline is ratcheted to 282,539 B with --update-baseline --reason. Route caps preserve exact-base relative headroom, rounded down: floor(1366403 × 1273579 / 1276133) = 1363668 for Chat and floor(807612 × 768843 / 771667) = 804656 for New Session.

Check Result
pnpm tsgo:ui Passed
pnpm --dir ui test src/i18n/labs-loading.test.ts src/i18n/lib/english-catalog.test.ts src/pages/config/settings-search.test.ts --maxWorkers=1 3 files / 17 tests passed once, Node 24.22.1 via the package-owned UI test script; no runtime override
pnpm ui:i18n:baseline / pnpm ui:i18n:verify Passed; 11,350 keys
Canonical full-catalog comparison Values and order identical; eager keys 1,280 → 1,035
Formatting / git diff --check Passed
Production Knip Exact-base failure only: unused examples/inline-incident/control-ui.ts; base/head logs byte-identical, SHA256 e19983acb4b759bccf537dcc24952157d451ea4f42a60a9164bac335bb303305
Independent source / metadata review Scoped-clean P0–P2; final two floor integers separately reviewed by coordinator
Chat, Appearance, disabled-inline captures All three before/after pairs byte-identical; inspected synthetic data only; no page errors

The disabled-inline capture verifies all three retained labels, the /settings/labs link, and zero requests for en-plugin-management before interaction. Appearance still loads its feature catalog. The coordinator independently inspected all three unique synthetic captures and verified that each before/after pair is byte-identical.

State Before After
Chat Chat before Chat after
Appearance Appearance before Appearance after
Disabled inline plugin Disabled inline plugin before Disabled inline plugin after

Cumulative real-Gateway timing: PASS. The initial ten-pair run and the one explicitly authorized extra ten-pair run retain all 40 samples in strict baseline/candidate alternation within each batch. The predeclared cumulative rule passes for both transcript visibility and enabled-composer readiness: median at most 1.05× baseline and p95 no higher than baseline. No third batch or sample exclusion was used.

Cumulative timing metric Base median Candidate median Base p95 Candidate p95 Result
First nonempty transcript 1,803.85 ms 1,736.00 ms 3,204.80 ms 2,570.10 ms Pass
First enabled composer 853.65 ms 863.95 ms 1,418.40 ms 1,231.00 ms Pass: median +1.21%

Both standalone batch outcomes remain recorded. The initial 20 samples alone failed composer median: 837.65 → 899.30 ms (+7.36%). The extra 20 samples alone failed transcript p95: 2,004.90 → 2,338.60 ms (+16.64%). The cumulative result includes both batches in full and follows the acceptance contract stated before the first run. The coordinator independently recomputed all 40 observations and verified all 2,140 raw/gzip transport receipts against the original inventories.

The observed real-Gateway graph loads 53 → 54 application assets and 1,365,634 → 1,364,115 B gzip, a 1,519 B reduction. The additional request is the 838 B en-session-progress catalog loaded for the fixture's content. chat-outputs grows 192 B, and other additional chunks grow 5 B net; these 1,035 B offset part of the static Chat saving of 2,554 B. The complete request cost is included in the timing above. Source, fixture, harness, plugin inputs, and original UI assets match across the two independently rebuilt runs; generated runtime timestamps differ, while the unchanged harness uses the same sealed UI build ID during samples.

Current-head CI

CI run 39992879274, attempt 1, completed on cb9439542a221760c8eeb9818ef89e629353ae17: 46 successful jobs, 2 failed jobs, 24 skipped jobs, and no cancellations. Security passed. The failures are E2E shard 4/9 and its downstream openclaw/ci-gate; skipped jobs are not claimed as coverage.

The sole failing test is Chat boot render storm > leaves session actions unbuilt after a busy cold load until opened without losing the draft. Its Search people… click times out at ui/src/e2e/chat-boot-render-storm.e2e.test.ts:235:28, exactly matching the test, locator, source line, and 30-second timeout in scheduled main run 39988120487. The actual CI merge and 19 relevant unchanged test/fixture/sharing/i18n/workflow files were verified. This is attributed inherited failure evidence, not a claim that CI passed.

Timing acceptance is complete. Native review validation and inherited-CI admission remain separate workflow steps; no prepare, merge, or auto-merge has been requested by this update. Remote timing cleanup is complete. The final native inspection at 18:05:48 UTC records completed settlement with no remaining host, SSH key, claim, or lease files.

Module attribution

The tables rank each current boot graph's top 30 emitted module fragments. Standalone gzip is diagnostic and non-additive: it does not reproduce the shared dictionaries or libdeflate settings of the shipped chunks. Whole-graph transfer proof is the matched table above. Mixed/conditional rows are opportunities for separate owner-level analysis, not promised removals in this change.

Chat: needed for first transcript/composer paint?

Module Standalone gzip Needed?
ui/src/i18n/locales/en.ts 17,053 B Yes: retained shared first-paint labels.
node_modules/markdown-it/dist/markdown-it.mjs 15,903 B Conditional: Markdown in the first visible message.
node_modules/entities/dist/generated/decode-data-html.js 13,140 B Conditional: entity decoding for visible Markdown.
node_modules/dompurify/dist/purify.es.mjs 11,539 B Yes when rendering message HTML; sanitization boundary.
ui/src/i18n/locales/en-chat-session.ts 8,598 B Partly: transcript/session labels plus optional session controls.
node_modules/@solidjs/web/dist/web.js 7,362 B Yes: DOM renderer.
node_modules/@tanstack/virtual-core/dist/esm/index.js 6,873 B Yes: visible transcript window.
ui/src/i18n/locales/en-chat-composer.ts 6,577 B Partly: composer labels plus interaction-only options.
node_modules/@solidjs/signals/dist/prod/store/store.js 6,570 B Yes: renderer state dependencies.
ui/src/lib/chat/composer-draft-store.runtime.ts 6,030 B Yes: restore the visible saved draft.
node_modules/remend/dist/index.js 5,611 B Conditional: incomplete Markdown during a live response.
ui/src/pages/chat/chat-pane-render.ts 5,124 B Yes: compose the visible chat pane.
ui/src/i18n/locales/en-session-organization.ts 5,117 B Partly: visible roster labels plus organization actions.
ui/src/pages/chat/components/chat-composer-view.tsx 5,075 B Yes: first composer.
ui/src/app/app-root.tsx 5,046 B Yes: application root.
ui/src/pages/chat/chat-pane-sidebar-view.tsx 4,789 B Conditional: current pane sidebars and layout.
ui/src/app/app-shell-view.tsx 4,784 B Yes: application shell.
ui/src/components/icon-data.ts 4,704 B Partly: visible shell icons; contains additional icons.
node_modules/@openclaw/uirouter/dist/index.js 4,609 B Yes: route selection.
ui/src/components/select-picker-view.tsx 4,585 B Partly: visible picker triggers plus interaction-only menus.
ui/src/pages/chat/chat-pane-header.ts 4,516 B Yes: visible transcript header.
ui/src/components/icon-data-tools.ts 4,505 B Conditional: tool icons in the visible transcript or composer.
ui/src/pages/chat/components/chat-composer-controls.tsx 4,406 B Yes: visible composer controls.
ui/src/pages/chat/chat-view.tsx 4,405 B Yes: route renderer.
ui/src/pages/chat/components/chat-transcript-projection.ts 4,345 B Yes: current transcript projection.
ui/src/pages/chat/chat-pane-lifecycle.ts 4,344 B Yes: pane loading and ownership.
ui/src/pages/chat/chat-pane-layout-render.ts 4,225 B Yes: pane layout.
src/logging/redact-patterns.ts 4,140 B Not visual; preserves diagnostic redaction.
ui/src/pages/chat/chat-state-page.ts 4,093 B Yes: chat route state.
ui/src/components/app-sidebar-render.tsx 4,008 B Yes: visible shell roster.

New Session: needed for first composer paint?

Module Standalone gzip Needed?
ui/src/i18n/locales/en.ts 17,053 B Yes: retained shared first-paint labels.
node_modules/@solidjs/web/dist/web.js 7,362 B Yes: DOM renderer.
ui/src/i18n/locales/en-chat-composer.ts 6,577 B Partly: composer labels plus interaction-only options.
node_modules/@solidjs/signals/dist/prod/store/store.js 6,570 B Yes: renderer state dependencies.
ui/src/lib/chat/composer-draft-store.runtime.ts 6,030 B Yes: restore the visible saved draft.
ui/src/app/app-root.tsx 5,046 B Yes: application root.
ui/src/app/app-shell-view.tsx 4,784 B Yes: application shell.
ui/src/components/icon-data.ts 4,704 B Partly: visible shell icons; contains additional icons.
node_modules/@openclaw/uirouter/dist/index.js 4,609 B Yes: route selection.
ui/src/components/select-picker-view.tsx 4,585 B Partly: visible picker triggers plus interaction-only menus.
ui/src/components/icon-data-tools.ts 4,505 B Conditional: tool icons in the visible transcript or composer.
ui/src/pages/chat/components/chat-composer-controls.tsx 4,406 B Yes: visible composer controls.
ui/src/pages/new-session/composer.tsx 4,268 B Yes: first New Session composer.
ui/src/i18n/locales/en-new-session-setup.ts 4,259 B Partly: first New Session labels and setup choices.
src/logging/redact-patterns.ts 4,140 B Not visual; preserves diagnostic redaction.
ui/src/pages/new-session/new-session-page.tsx 4,014 B Yes: New Session route.
ui/src/components/app-sidebar-render.tsx 4,008 B Yes: visible shell roster.
ui/src/components/app-sidebar-session-row-render.tsx 3,910 B Yes: visible roster rows.
ui/src/api/gateway.ts 3,830 B Yes: initial Gateway data.
packages/gateway-protocol/src/session-agent-status.ts 3,773 B Yes: visible session state.
ui/src/components/solid/session-presentation.tsx 3,713 B Yes: visible session presentation.
ui/src/components/app-sidebar-owner.tsx 3,688 B Yes: shell roster owner.
ui/src/lib/sessions/index.ts 3,666 B Yes: first session/roster data.
ui/src/pages/new-session/draft-submission-flow.ts 3,665 B No: submission action after first paint.
ui/src/app/bootstrap.ts 3,632 B Yes: connect and bootstrap.
ui/src/app/gateway-store.ts 3,619 B Yes: Gateway state owner.
ui/src/app/app-shell-chrome.ts 3,602 B Yes: visible shell chrome.
ui/src/components/app-sidebar-session-navigation.ts 3,595 B Partly: selection display and later navigation.
ui/src/components/solid/shadow-styles.ts 3,517 B Conditional: rendered shadow-root controls.
ui/src/components/sidebar-attention-store.ts 3,479 B Yes: visible sidebar attention state.

Load 326 optional-feature English strings with their existing consumers while preserving translation fallback, namespace identity, and canonical source ordering. Matched builds remove about 4 KB gzip from startup, Chat, and New Session without adding requests.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T17:20:04.597317Z cb94395 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: XL labels Oct 23, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 23, 2026
@clawsweeper

clawsweeper Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves optional English UI copy into feature catalogs that register when their consumers load.

Example: Open Chat before opening its Outputs panel.

  • Before: Initial JavaScript includes optional Outputs copy such as “No outputs yet.”
  • After: That copy loads with Outputs; the reported earlier-head comparison reduces Chat boot transfer from 1,322,900 to 1,319,013 gzip bytes.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is coherent and source review found no actionable defect; evidence supports transfer savings but does not yet clear the recorded performance hold.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Startup, Chat, and New Session download English strings for optional surfaces before those surfaces are used.
Reason: The maintainer-authored direction extends an established approach with measured transfer savings and explicitly acknowledges the additional source size.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: it provides a useful, focused performance improvement, and inspection found no concrete introduced defect.

Priority: P3
Reviewed head: 2ba2fadd7a7623a3c478d56739957973fd18460b

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The recorded hold still needs interleaved reload-to-transcript timing and final integrated budget evidence for the candidate being landed.
Agent review details

How this fits together

The Control UI translation manager resolves locale keys against active translations and shared English fallback; lazy feature consumers register English fragments, while host tooling composes the complete catalog for generation and verification.

flowchart LR
  A[Startup English] --> B[Shared English catalog]
  C[Lazy feature consumer] --> D[Feature registrar]
  D --> B
  B --> E[Translation manager]
  F[Active locale] --> E
  E --> G[Rendered UI text]
Loading

Technical review

Best possible solution:

Retain the existing catalog owners and lazy consumer boundaries while preserving English values, source ordering, namespace identity, and active-locale fallback.

Do we have a high-confidence way to reproduce the issue?

This is a performance refactor; source confirms the eager optional copy and its extraction, while reported build measurements establish the earlier candidate's transfer savings.

Is this the best way to solve the issue?

The change follows the established lazy-catalog design, keeps one runtime translation owner, and adds no competing cache or loading lifecycle.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 55477abbbb50.

Provenance checked

  • Lazy English catalog ownership and ordered host composition keeps the original intent (1532cce: Load optional view copy at existing lazy boundaries while keeping shared labels eager and preserving catalog values, ordering, and namespace identity.)
  • Settings and optional Chat catalog extraction keeps the original intent (721d124: Remove optional dependencies and page-only English copy from Chat boot without introducing another state or lifecycle owner.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head patch extracts catalog data, wires synchronous consumer registration, and updates host composition and focused loading tests. (scripts/lib/control-ui-i18n-catalog.ts:293, 2ba2fadd7a76)
  • Existing runtime owner retained: Current main already owns English registration and reactive invalidation through registerEnglishCatalog; this PR reuses that mechanism. (ui/src/lib/reactive/i18n.ts:16, 55477abbbb50)
  • Registration-order repair: The repaired Update Actions registrar assigns only its owned leaves and sections, preserving Settings page, channel, and install-kind namespaces instead of restoring captured empty objects. (ui/src/i18n/locales/en-update-actions.ts:176, 2ba2fadd7a76)
  • Performance evidence and explicit hold: The full live PR body reports approximately 4 KB less gzip transfer on Startup, Chat, and New Session at candidate 565f74e, with unchanged requests and CSS; it explicitly holds merging for interleaved runtime timing and final integrated budget evidence. (565f74e95381)
  • Established feature-history direction: The merged perf(ui): load About and Dashboard copy with their views #181142 establishes the same synchronous lazy-catalog pattern, preserving shared labels, namespace identity, translation fallback, and host ordering. (scripts/lib/control-ui-i18n-catalog.ts:7, 1532cce33d81)
  • Inspection limits: Some historical blobs were unavailable to local git show, pickaxe, and blame, and the installed Solid cheatsheet was absent; available history, REST commit patches, and current source were inspected without executing target code.

Likely related people:

  • Peter Steinberger: Raw commit 1532cce adds scripts/lib/control-ui-i18n-catalog.ts:7 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1532cce33d81; files: scripts/lib/control-ui-i18n-catalog.ts)

PR surface

Source +500, Tests +9, Other +76. Total +585 across 72 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 67 981 481 +500
Tests 4 17 8 +9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 81 5 +76
Total 72 1079 494 +585

Labels

Label changes:

  • add P3: This reduces optional UI transfer overhead without addressing an urgent user-facing failure.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This reduces optional UI transfer overhead without addressing an urgent user-facing failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the already-recorded integrated performance comparison and confirm its acceptance thresholds.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 23, 2026, 6:38 AM ET / 10:38 UTC.

Keep shared English namespaces stable while loading feature copy at its existing consumer boundary. Preserve eager Agents errors and the current Chat Details registration.

Matched afdaf5f libdeflate11 proof: startup 285393 -> 282364 B, Chat 1273663 -> 1270937 B, New Session 771348 -> 768452 B. Requests and CSS unchanged; ratchet caps with existing relative headroom.
@steipete
steipete merged commit a7f5566 into main Oct 23, 2026
151 of 158 checks passed
@steipete
steipete deleted the solid2/w-perf-feature-copy branch October 23, 2026 18:11
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
* perf(ui): defer optional feature English copy

Load 326 optional-feature English strings with their existing consumers while preserving translation fallback, namespace identity, and canonical source ordering. Matched builds remove about 4 KB gzip from startup, Chat, and New Session without adding requests.

* fix(ui): preserve settings copy during lazy registration

* perf(ui): keep settings metadata free of settings copy

* perf(ui): ratchet optional feature copy boot budgets

* perf(ui): refresh feature-copy boot proof

* perf(ui): ratchet deferred feature copy boot budgets
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL 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