Repository navigation
perf(ui): prepare saved locale and preload compact Chat catalogs - #194070
Conversation
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR waits for the selected language before completing route preparation and includes Chat boot translations in the initial foreign-language catalog. Example: Reload Chat with the saved language set to de while its translation download is pending.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a source-confirmed locale-readiness bug and retains useful, focused work; no concrete correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI locale manager turns saved or selected language preferences into published translations; the host-side catalog composer determines which translations load initially and which remain lazy. flowchart LR
A[Saved or selected language] --> B[Locale manager]
C[English catalog fragments] --> D[Vite locale partition]
D --> E[Foreign locale catalog]
E --> B
B --> F[Route preparation]
F --> G[Chat composer]
Technical reviewBest possible solution: Keep readiness in the locale manager and startup partitioning in the existing catalog composer, preserving fallback, retry, and optional-page loading. Do we have a high-confidence way to reproduce the issue? The pinned main source shows the failure: saved-locale loading remains pending while prepareLocale can complete against English; no target code or tests were executed during this read-only review. Is this the best way to solve the issue? The patch repairs the existing readiness owner and reuses canonical fragment composition; the documented wait for a superseded import avoids adding cancellation machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 43654d5fceae. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4, Tests +78, Other +33. Total +115 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 6, 2026, 5:23 AM ET / 10:23 UTC. |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7763fc8ac4
ℹ️ 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".
| change = this.localeChange; | ||
| await Promise.all([preparation, change]); | ||
| } while (change !== this.localeChange); |
There was a problem hiding this comment.
Stop waiting on superseded locale selections
If a route calls prepareLocale() while a locale download is pending, then a user selection or server preference switches to English, this await still blocks on the discarded download. The generation check runs only after that old promise settles, even though English is already active and needs no download. Since app-routes.ts awaits this method before exposing the route component, navigation remains blocked until the obsolete request completes or reaches the browser's network timeout. A base/head reproduction confirms that the base releases readiness after selecting English, whereas this change does not. Allow a newer selection to supersede the pending readiness wait.
AGENTS.md reference: ui/AGENTS.md:L20-L20
Useful? React with 👍 / 👎.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…nclaw#194070) * fix: localize chat before enabling the composer * perf: batch chat locale namespaces without first-use flashes * test(ui): preserve held-locale onboarding coverage * perf(ui): preserve lazy locale catalogs while awaiting selection * test(ui): account for formatted locale regression coverage * perf(ui): preload compact saved-locale chat catalogs * style(ui): brace locale preload test setup * perf(ui): preload compact full locale catalogs * fix(ci): match locale boot test line allocation
Fix Chat boot in saved non-English locales: route preparation now waits for the locale owner to publish the requested catalog before enabling the composer. The existing pre-body locale/direction policy starts Chat catalog downloads early, overlapping the work with the rest of boot. A compact table stores only shared namespace names and eight-character content hashes for 22 foreign locales.
Verdict
Performance acceptance passes: compact full hints preserve the non-English benefit, the complete cold change beats main, and the English confirmation shows no repeatable regression. Merged through native pre-existing-failure admission as
caaff17579aa55617ab207fb74ed1653dbe9c856. The proved 34-line test-budget debt was the only exception; all other gates passed. The shared scalar is unchanged.The campaign coordinator explicitly accepts the full table's approximately +2,523 B gzip per document, including English, to preserve the non-English timing win and eliminate the enabled-English composer flash. The current build adds 2,519 B gzip versus the unhinted fix. No claim is made that warm gains are universally above 5%: WebKit warm gains are about 4%, while Chromium warm gains are about 10%.
Current-head acceptance
Head
caa36901e8c8edebda10f429e8c21aea12538d63; baseline642fd21190f2480fc9545d6b11d0eaca300919f1, refreshed from main before this round. The unhinted arm has exactly the same JS/CSS as head, with only the inline preload fragment removed. The separate main arm has none of this PR's readiness, grouping, or hint changes. Measurements do not pool historical heads.Headless Chromium/WebKit, synthetic 400-message Chat, desktop 1440×1000, 100 ms RTT. Each of 12 cells has 20 rotated base/head/A/A triplets; the six cold cells add main and main-A/A arms. 960/960 observations, 0 failures. Host 1-minute load 4.71–26.42. Readiness is the maximum of raw readiness, locale publication, and first enabled visible localized composer, in application-local performance time. HTTP cache and service workers are disabled; warm means persisted-transcript reload, not an HTTP cache hit. The harness models latency, not bandwidth or TCP congestion windows.
Compact full hints versus unhinted flash fix
Net cold result versus main without this PR
Maximum observed fixed-arm foreign CLS is 0.000396 versus 0.001638 in the original-main cold arms. All settled computed-style comparisons match.
Fixed-arm non-English flashes: 0/480; candidate alone 0/160, original-main cold arms 160/160. Historical reproduction of the owner fix was 185/480 → 0/480; the current result above independently covers all fixed arms in this round.
Bounded English WebKit confirmation
Ten additional rotated pairs, keeping original20 and pooled30 explicit. Pooled cold versus original main is −0.10% median / +0.18% p95. The additional ten warm pairs improve median/p95; pooled warm p95 +2.33% follows A/A +2.03%, so no repeatable English regression is established.
Requests, lazy boundaries, and bytes
The three co-registered error dictionaries share one import but still publish under their own namespaces. Full hints do not remove additional dictionaries: they start the existing downloads earlier. Nine first-screen-unused namespaces cannot simply be skipped: narrower fragment loading previously caused English text on first-open menus, and bundling all Chat dictionaries broadened direct Appearance loading. Those rejected changes are absent.
The
connectioncatalog remains: Chromium needs it. Omitting it only for WebKit warm boot would add browser-specific policy; head's WebKit warm catalog count honestly includes that one extra prefetched resource.Completion clusters split response completion times at gaps over 50 ms. They describe observed scheduling, not literal network round trips. English emits zero locale hints and loads zero foreign catalogs. Non-Chat paths including New Session and Settings retain their lazy boundaries. Runtime locale switching, replacement, retry and fallback stay in the existing translation owner.
Only the document gets a new cap: 13,893 B gzip = measured 13,829 + existing 64 B headroom. No existing startup, route, locale or CSS cap grows. The +31 B normalized JS difference versus main is within the 64 B build variance; hints add no JS/CSS versus the unhinted fix.
The gzip body fits a typical IW10 at MSS 1460, but the complete 16,387 B response does not (12 segments at MSS 1460), before TLS overhead. The benchmark cannot establish a first-congestion-window claim. Measurements used pinned Node 26.12.1 / zlib 1.3.2.1-motley-456ae73; generated hashes can slightly change gzip size.
All three actual Gateway responses returned HTTP 200. All six inline scripts' hashes are admitted by the response CSP, without script
unsafe-inline. The generated hint URLs exist for all 22 locales (14 each), with zero for English.Correctness and validation
The test-line failure is not claimed as a matching inherited failure. Main carries 34 lines over its effective ceiling but passes because its delta is zero. This PR adds 200 justified test lines and 200 allocation credits, retaining that same debt and triggering the guard. The latest scheduled main job passes. The coordinator explicitly authorized the native pre-existing-failure route after the base/head proof; no scalar reconciliation will be made. The previous CI allocation mismatch (201 credits for 200 added lines) was fixed.
Historical service-worker/HTTP-cache probes established reuse in the same catalog-loader design, but are not relabeled as exact-head cache proof; this timing run deliberately excludes them. The committed build/owner tests protect generated hint selection, mounted paths, lazy grouping, fallback and superseding locale publication. Earlier broad tests and accepted Arabic/localhost tradeoffs are historical evidence, not new measurements in this 12-cell round.
Synthetic visual proof
Both images were inspected in full: synthetic content only, same settled layout and localization.
Production LOC in changed files: 2,116 → 2,211 (+95). Test LOC: 3,054 → 3,254 (+200). Allocation record: 0 → 2 lines. The growth buys one readiness boundary, generated compact hints, and focused regression proof; no new dependency.
Readiness ranges and exact observation method
The committed workload is
scripts/bench-control-ui-engines.ts. The proof-only observer below records first enabled, visible, localized composer time and the settled resource graph; it adds no production hook. The separate screenshot wrapper reads computed styles only after timing evidence is recorded.Warm uses
--steps warm-bootand only the unhinted/head/unhinted arms. Confirmation uses--engines webkit --configurations locale:en --pairs 10with the corresponding cold/warm arms.Native pre-existing-failure qualification
The campaign coordinator explicitly instructed native pre-existing-failure landing, with no scalar reconciliation. The exact merge base
642fd21190f2480fc9545d6b11d0eaca300919f1reports 6,549,224 test lines against 6,549,190: 34 over, delta 0. The PR head reports 6,549,424 against 6,549,390: 34 over, delta +200, fully covered by its own 200-line allocation. The actual CI base779c2e426079536ab2114393f894ddefeef3cd21independently reports 6,549,489 against 6,549,455: 34 over, delta 0. The tested merge reports 6,549,689 against 6,549,655: 34 over, delta +200.The debt was triggered by #191508 (
d46a50ff8bc764deb5aaf78a1267a29a4f6b65cc): 47 unallocated test lines consumed the remaining 13 lines of headroom. These inputs are unchanged between the CI base and tested PR merge:extensions/openai/token-sharing-oauth.runtime.test.tsextensions/openrouter/oauth.test.tssrc/infra/oauth-loopback-callback.test.tssrc/llm/utils/oauth/anthropic.test.tsFreshly fetched main
349fc9649dd681dda406de0ceef0f54cd8eff3c1reports 32 lines over after later deletions; that does not change the exact 34-line base/head proof above. The base checker exits successfully through its zero-growth exception. This is not presented as a matching failed scheduled-main test; the native exception uses the coordinator's concrete attribution and the unchanged source objects. The global scalar and all existing size ceilings remain unchanged. Only the explicitly accepted document cap is new.The sole substantive CI failure is
checks-fast-baseline-ratchets(job 128021056435, run 42255149883 attempt 1); its downstream aggregate isopenclaw/ci-gate(job 128026656979). All other selected jobs, including independent security, passed. Actual checkout560f91fed0d45f5b2ec723528b09d3489c597dd4has ordered parents CI base and PR head; the checkout log records it.