Repository navigation
perf(ui): defer optional feature English copy - #181555
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR moves optional English UI copy into feature catalogs that register when their consumers load. Example: Open Chat before opening its Outputs panel.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +500, Tests +9, Other +76. Total +585 across 72 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment 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.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* 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
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 candidatecb9439542a221760c8eeb9818ef89e629353ae17. The local runtime build used reviewed sourceaa3b2e220ec93d5a243e9c5bc7049a9baac47ef7plus 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.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) = 1363668for Chat andfloor(807612 × 768843 / 771667) = 804656for New Session.pnpm tsgo:uipnpm --dir ui test src/i18n/labs-loading.test.ts src/i18n/lib/english-catalog.test.ts src/pages/config/settings-search.test.ts --maxWorkers=1pnpm ui:i18n:baseline/pnpm ui:i18n:verifygit diff --checkexamples/inline-incident/control-ui.ts; base/head logs byte-identical, SHA256e19983acb4b759bccf537dcc24952157d451ea4f42a60a9164bac335bb303305The disabled-inline capture verifies all three retained labels, the
/settings/labslink, and zero requests foren-plugin-managementbefore 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.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.
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-progresscatalog loaded for the fixture's content.chat-outputsgrows 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 downstreamopenclaw/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 atui/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?
ui/src/i18n/locales/en.tsnode_modules/markdown-it/dist/markdown-it.mjsnode_modules/entities/dist/generated/decode-data-html.jsnode_modules/dompurify/dist/purify.es.mjsui/src/i18n/locales/en-chat-session.tsnode_modules/@solidjs/web/dist/web.jsnode_modules/@tanstack/virtual-core/dist/esm/index.jsui/src/i18n/locales/en-chat-composer.tsnode_modules/@solidjs/signals/dist/prod/store/store.jsui/src/lib/chat/composer-draft-store.runtime.tsnode_modules/remend/dist/index.jsui/src/pages/chat/chat-pane-render.tsui/src/i18n/locales/en-session-organization.tsui/src/pages/chat/components/chat-composer-view.tsxui/src/app/app-root.tsxui/src/pages/chat/chat-pane-sidebar-view.tsxui/src/app/app-shell-view.tsxui/src/components/icon-data.tsnode_modules/@openclaw/uirouter/dist/index.jsui/src/components/select-picker-view.tsxui/src/pages/chat/chat-pane-header.tsui/src/components/icon-data-tools.tsui/src/pages/chat/components/chat-composer-controls.tsxui/src/pages/chat/chat-view.tsxui/src/pages/chat/components/chat-transcript-projection.tsui/src/pages/chat/chat-pane-lifecycle.tsui/src/pages/chat/chat-pane-layout-render.tssrc/logging/redact-patterns.tsui/src/pages/chat/chat-state-page.tsui/src/components/app-sidebar-render.tsxNew Session: needed for first composer paint?
ui/src/i18n/locales/en.tsnode_modules/@solidjs/web/dist/web.jsui/src/i18n/locales/en-chat-composer.tsnode_modules/@solidjs/signals/dist/prod/store/store.jsui/src/lib/chat/composer-draft-store.runtime.tsui/src/app/app-root.tsxui/src/app/app-shell-view.tsxui/src/components/icon-data.tsnode_modules/@openclaw/uirouter/dist/index.jsui/src/components/select-picker-view.tsxui/src/components/icon-data-tools.tsui/src/pages/chat/components/chat-composer-controls.tsxui/src/pages/new-session/composer.tsxui/src/i18n/locales/en-new-session-setup.tssrc/logging/redact-patterns.tsui/src/pages/new-session/new-session-page.tsxui/src/components/app-sidebar-render.tsxui/src/components/app-sidebar-session-row-render.tsxui/src/api/gateway.tspackages/gateway-protocol/src/session-agent-status.tsui/src/components/solid/session-presentation.tsxui/src/components/app-sidebar-owner.tsxui/src/lib/sessions/index.tsui/src/pages/new-session/draft-submission-flow.tsui/src/app/bootstrap.tsui/src/app/gateway-store.tsui/src/app/app-shell-chrome.tsui/src/components/app-sidebar-session-navigation.tsui/src/components/solid/shadow-styles.tsui/src/components/sidebar-attention-store.ts