Skip to content

fix(ui): keep translated config hints out of startup preloads - #143376

Merged
vincentkoc merged 4 commits into
mainfrom
fix/frv-control-ui-locale-chunks-20260909
Sep 10, 2026
Merged

vincentkoc merged 4 commits into
mainfrom
fix/frv-control-ui-locale-chunks-20260909

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where the Control UI startup bundle exceeded the hosted validation budget because every translated config-hint fragment was named in the boot-time module-preload dependency table.

Why This Change Was Made

Split translated config hints from each lazy locale catalog, then filter only hint-bearing JavaScript preload lists so the hint fragment and locale wrapper remain deferred until that locale is selected. Other preload lists, HTML preloads, runtime dependencies, and locale behavior remain unchanged.

User Impact

The Control UI stays within its startup JavaScript budget while preserving all translated config hints and lazy locale loading.

Evidence

  • Focused UI tests: 101 passed across Vite config, chunking, locale registry, and translation behavior.
  • Production Control UI build: 351,896 B startup JavaScript gzip versus the 352,235 B enforcement limit.
  • Built __vite__mapDeps table contains only the shared runtime, with zero locale or locale-config-hints-* entries.
  • oxfmt, oxlint, git diff --check, Control UI i18n verification, and independent P0-P2 autoreview are clean.
  • pnpm check:changed completed all preceding checks but the local typecheck lane rejected the required Codex-worktree node_modules symlink before compilation. Exact-head CI remains the authoritative typecheck proof.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added 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 Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 10:18 PM ET / September 10, 2026, 02:18 UTC (Revision 5).

ClawSweeper review

What this changes

Splits translated configuration hints into separate deferred language chunks and adjusts preload filtering and performance checks while preserving complete locale translations.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main lacks the proposed optimization, and related merged work does not supersede it. No blocking correctness or security findings were identified.

Priority: P2
Reviewed head: 658d20d3a97fdd07be19e042efb8fefa011f68b4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with meaningful boundary coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its reported production build exercises the changed locale builder and preload resolver, but does not independently demonstrate browser language switching; no material authority change requires additional proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its reported production build exercises the changed locale builder and preload resolver, but does not independently demonstrate browser language switching; no material authority change requires additional proof.
Evidence reviewed 8 items Introduced scope and preload behavior: Read the pinned merge-base-to-head production diff. The resolver filters only JavaScript requests targeting a supported locale with its matching hint dependency; unrelated dependencies and HTML preload lists remain intact.
Catalog consistency: The locale builder shares materialization between the base and hint modules, discards invalidated asynchronous results, and statically recombines both partitions before exporting the locale. Missing-memory fallback and malformed-memory rejection remain present.
Budget and regression coverage: The combined locale budget remains 300 KiB, with at most one base and one hint asset per locale and neither allowed in startup HTML. Reviewed tests cover combined overflow, duplicate chunks, startup inclusion, executable catalog recombination, stale loads, and build invalidation; tests were not executed during this read-only review.
Findings None None.
Security None None.

How this fits together

The Control UI build turns English source and translation memory into language modules loaded by the browser. Chunking and preload rules determine how much JavaScript startup downloads and when translated settings help becomes available.

flowchart TD
  A[English source and translation memory] --> B[Locale catalog builder]
  B --> C[Base language chunk]
  B --> D[Configuration hint chunk]
  C --> E[Preload filtering]
  D --> E
  E --> F[Smaller startup dependency table]
  C --> G[Complete translations on language selection]
  D --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +141, Tests +301, Other +54. Total +496 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 3 166 25 +141
Tests 3 380 79 +301
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 78 24 +54
Total 7 624 128 +496

Review metrics

Metric Value Why it matters
Locale budget 1 base + 1 hint chunk; 300 KiB combined The split increases permitted chunk count without increasing the compressed allowance per language.
Production versus test growth Production/tooling +195 net lines; tests +301 net lines Growth implements partitioning, generation invalidation, selective preloads, and corresponding behavioral coverage.

Technical review

Best possible solution:

Keep complete locale activation and existing translation fallback while excluding deferred language assets from startup dependency bookkeeping and retaining the combined size cap.

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

No independently reproduced current-main budget failure was established in this read-only review; source inspection supports the reported mechanism, and the author supplies after-fix production-build measurements.

Is this the best way to solve the issue?

Yes. The patch changes build-time partitioning and preload bookkeeping while retaining native module imports, locale exports, translation fallback, and the existing combined budget.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2273ffd0bf22.

Labels

Label justifications:

  • P2: This is a bounded Control UI startup-size improvement with no demonstrated urgent user-facing outage.
  • 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 MEMBER-authored PR is exempt from the external-contributor proof gate. Its reported production build exercises the changed locale builder and preload resolver, but does not independently demonstrate browser language switching; no material authority change requires additional proof.

Evidence

What I checked:

  • Introduced scope and preload behavior: Read the pinned merge-base-to-head production diff. The resolver filters only JavaScript requests targeting a supported locale with its matching hint dependency; unrelated dependencies and HTML preload lists remain intact. (ui/vite.config.ts:114, 658d20d3a97f)
  • Catalog consistency: The locale builder shares materialization between the base and hint modules, discards invalidated asynchronous results, and statically recombines both partitions before exporting the locale. Missing-memory fallback and malformed-memory rejection remain present. (ui/config/control-ui-locales.ts:94, 658d20d3a97f)
  • Budget and regression coverage: The combined locale budget remains 300 KiB, with at most one base and one hint asset per locale and neither allowed in startup HTML. Reviewed tests cover combined overflow, duplicate chunks, startup inclusion, executable catalog recombination, stale loads, and build invalidation; tests were not executed during this read-only review. (scripts/check-control-ui-performance.mts:256, 658d20d3a97f)
  • Current-main necessity and existing contract: Fetched main still exports each complete locale directly and has no matching preload resolver. The documented contract is lazy non-English loading, persisted language selection, and English fallback; this patch preserves that runtime interface. (ui/config/control-ui-locales.ts:54, 2273ffd0bf22)
  • Latest-release comparison: Inspected the supplied latest-release revision through GitHub after its local object was unavailable. Its locale builder also exports a single complete catalog; the Vite configuration lacks this preload filter. No shipped implementation of this change was established. (ui/config/control-ui-locales.ts:23, 1391f7cd2d40)
  • Verified bundler contract: The patch explicitly uses Vite's resolveDependencies hook, and ui/package.json pins Vite 8.2.2. Inspected that tag's implementation: the hook receives the normalized imported filename and preload dependencies, CSS dependencies are preserved separately, and the helper still invokes the underlying dynamic import. Repository identity and tag commit were verified through GitHub. (packages/vite/src/node/plugins/importAnalysisBuild.ts:505, de1111ab0be0)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • husodrn46: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (4 earlier review cycles)
  • reviewed 2026-09-09T20:36:09.846Z sha 44c49b3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T20:45:35.108Z sha 44c49b3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T22:18:34.818Z sha 081658d :: needs maintainer review before merge. :: none
  • reviewed 2026-09-09T23:25:51.010Z sha 20aad34 :: needs maintainer review before merge. :: none

@vincentkoc vincentkoc self-assigned this Sep 9, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 9, 2026 20:41
@clawsweeper

clawsweeper Bot commented Sep 9, 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.

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 9, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 10, 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.

@clawsweeper

clawsweeper Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc merged commit 3ffdc1b into main Sep 10, 2026
135 checks passed
@vincentkoc
vincentkoc deleted the fix/frv-control-ui-locale-chunks-20260909 branch September 10, 2026 04:34
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 10, 2026
Clear a rejected source-catalog promise at its producer and preserve the original failure. Later locale requests can load corrected source while successful sharing and generation fencing stay intact. Related: #143376.
steipete added a commit that referenced this pull request Sep 10, 2026
Clear a rejected source-catalog promise at its producer and preserve the original failure. Later locale requests can load corrected source while successful sharing and generation fencing stay intact. Related: #143376.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
…aw#143376)

* fix(ui): split config hint locale chunks

* fix(ui): discard invalidated locale catalog loads

* fix(ci): accept split locale adapters in migration guard

* fix(ui): split locale hints without ownership drift
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 11, 2026
Clear a rejected source-catalog promise at its producer and preserve the original failure. Later locale requests can load corrected source while successful sharing and generation fencing stay intact. Related: openclaw#143376.
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts 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.

1 participant