Skip to content

test(ui): decouple rendering checks from generated wording - #138283

Merged
steipete merged 2 commits into
mainfrom
codex/ui-locale-rendering-tests
Sep 4, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/ui-locale-rendering-tests

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A complete locale refresh changes valid wording without changing UI behavior. Five existing tests then fail because they pin the previous German, Chinese, or French text; the same failures repeat in the UI and core test shards.

Why This Change Was Made

Read expected rendering text from the locale catalogs through the existing pure catalog flattener. Retain the locale-switch check, action/tab order, shadow-menu accessibility label, warning styling, literal security-audit command, and model/attempt substitutions in the composer details. The Vite test checks the current-source translation-memory record and watched path directly, avoiding a circular expectation from the same Vite plugin. It reads the English key through the catalog flattener and requires a string before hashing it.

User Impact

No runtime, translation data, prompt, workflow, or dependency changes. Valid generated wording can refresh without breaking tests that protect rendering behavior. The Chinese glossary explicitly preserves “Skills” and translates “Channels” as “渠道”; the tests no longer require conflicting older wording.

Evidence

  • Reproduced all five failures against the refreshed catalogs from chore(ui): refresh control ui locales #138219: 66 passed, five failed.
  • All 71 tests in the five affected files pass with the refreshed catalogs.
  • All 71 tests also pass with the existing main catalogs. Temporary proof copies were restored by exact hashes; the data PR and original artifacts remain unchanged.
  • Focused formatting and git diff --check pass.
  • The first hosted run caught direct nested access against the recursive catalog type; the correction explicitly narrows the flattened source value. All 25 Vite tests then passed against both catalog versions, with no changed-test error in the focused local typecheck.
  • Final staged independent Codex review through P2: clean, no findings.
  • Local changed checks passed all 14 guards through UI i18n verification. Core test typechecking reports only missing existing mermaid, diff, and pako declarations in the borrowed local dependency tree; no dependencies were installed or reconciled in the worktree. Exact-head hosted CI, including types, passed. One unchanged model-menu E2E visibility check failed initially and passed on a single failed-job retry; no assertion or timeout changed.

Production LOC: unchanged. Test LOC: +59/-18. No new test helper or production seam.

@steipete steipete self-assigned this Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 4, 2026
@kaxo-io

kaxo-io commented Sep 4, 2026

Copy link
Copy Markdown

check-test-types is failing on a TypeScript narrowing issue in ui/src/app/vite-config.node.test.ts:

ui/src/app/vite-config.node.test.ts(532,58): error TS18048: en.common is possibly undefined.
ui/src/app/vite-config.node.test.ts(532,68): error TS2339: Property health does not exist on type string

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 10:51 AM ET / 14:51 UTC.

ClawSweeper review

What this changes

This PR updates five Control UI tests to derive localized expectations from current catalogs and translation memory rather than hard-coding generated German, Chinese, and French text.

Merge readiness

✅ Ready for maintainer review

No blocking findings. The test-only patch derives wording from the same canonical catalogs the Control UI loads while retaining the rendering, ordering, placeholder, and accessibility assertions; this maintainer-labeled PR should remain open for normal maintainer handling.

Priority: P3
Reviewed head: 8f7c39d40ff5599eccab5703b1b2f473e0db9fc0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test-maintenance patch with clean exact-head validation and no blocking defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored, test-only PR does not change a user-visible runtime path; focused source review and exact-head CI are the relevant evidence rather than external contributor behavior proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored, test-only PR does not change a user-visible runtime path; focused source review and exact-head CI are the relevant evidence rather than external contributor behavior proof.
Evidence reviewed 7 items Canonical locale owner: The locale-module plugin watches the locale memory, loads it, and materializes the catalog from the flattened English source; the Vite assertion now checks that same documented owner boundary rather than a stale phrase.
Runtime rendering boundary: Components resolve localized keys through the i18n manager, which falls back to English only for absent locale keys; the changed assertions continue to validate keys, interpolation, and rendered structure.
Introduced test assertions: The pinned merge-base-to-head diff changes only five test files. The Vite test narrows the English source value before hashing and compares the generated French output with the matching translation-memory record.
Findings None None.
Security None None.

How this fits together

Control UI loads lazy locale catalogs from translation memory through a Vite plugin, then the i18n manager resolves component labels at render time. The changed tests validate that localized UI rendering follows that catalog without treating a particular generated phrase as a product contract.

flowchart LR
  A[English source catalog] --> B[Translation memory]
  B --> C[Locale module plugin]
  C --> D[Lazy locale catalog]
  D --> E[Control UI rendering]
  D --> F[Rendering tests]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +41. Total +41 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 59 18 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 59 18 +41

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +59/-18 All introduced lines are test assertions and imports; no runtime, catalog, configuration, or dependency surface changes.

Technical review

Best possible solution:

Keep assertions catalog-derived for generated copy, while preserving independent checks of the rendered key selection, ordering, interpolation, styling, command literal, and locale-switch behavior.

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

Not applicable: this PR maintains test expectations rather than reporting a standalone user-facing bug. The supplied exact-head checks and source inspection cover the changed test behavior.

Is this the best way to solve the issue?

Yes. Reading expected generated wording from the canonical locale materialization path removes brittle text pins while retaining the component-level rendering assertions that distinguish key, order, interpolation, and locale-switch regressions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8f986e0ea839.

Labels

Label changes:

  • add P3: This is low-risk Control UI test maintenance with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored, test-only PR does not change a user-visible runtime path; focused source review and exact-head CI are the relevant evidence rather than external contributor behavior proof.

Label justifications:

  • P3: This is low-risk Control UI test maintenance with no production behavior change.
  • 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: This maintainer-authored, test-only PR does not change a user-visible runtime path; focused source review and exact-head CI are the relevant evidence rather than external contributor behavior proof.

Evidence

What I checked:

  • Canonical locale owner: The locale-module plugin watches the locale memory, loads it, and materializes the catalog from the flattened English source; the Vite assertion now checks that same documented owner boundary rather than a stale phrase. (ui/config/control-ui-locales.ts:41, 8f7c39d40ff5)
  • Runtime rendering boundary: Components resolve localized keys through the i18n manager, which falls back to English only for absent locale keys; the changed assertions continue to validate keys, interpolation, and rendered structure. (ui/src/i18n/lib/translate.ts:236, 8f7c39d40ff5)
  • Introduced test assertions: The pinned merge-base-to-head diff changes only five test files. The Vite test narrows the English source value before hashing and compares the generated French output with the matching translation-memory record. (ui/src/app/vite-config.node.test.ts:525, 8f7c39d40ff5)
  • Test runtime uses the production locale plugin: The Control UI Vitest projects register the locale-module plugin, so direct locale imports and lazy i18n loads use the same catalog materialization path. (ui/vitest.config.ts:163, 8f7c39d40ff5)
  • Current-main comparison: The current fetched main SHA has unchanged locale owner modules; the branch differs only in the five reviewed test files, so this does not alter runtime locale behavior or generated data. (ui/config/control-ui-locales.ts:23, 8f986e0ea839)
  • Exact-head validation: The supplied exact-head check data reports successful test types, changed checks, all three UI shards, and UI E2E checks after the narrowing follow-up. (8f7c39d40ff5)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: 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 (1 earlier review cycle)
  • reviewed 2026-09-04T13:33:43.794Z sha 188b3fa :: needs maintainer review before merge. :: none

@sylvesterkaczmarek sylvesterkaczmarek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This decouples behavioural tests from generated wording without making them tautological. Rendering assertions use the current locale catalog, while the Vite case independently reads translation memory keyed by the English source hash, so it is not simply asserting the plugin against its own output. Keeping order, styling, literal commands and substitutions pinned preserves the useful UI contract.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 4, 2026
@steipete
steipete merged commit 8472fb3 into main Sep 4, 2026
145 of 149 checks passed
@steipete
steipete deleted the codex/ui-locale-rendering-tests branch September 4, 2026 15:15
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 4, 2026
…9-prep

* commit '407a8f453c0f0306af1ddc0aafa8697c1d49a9e7': (312 commits)
  perf(ui): coalesce automation event refreshes (#138065)
  fix: reject incomplete Skill Workshop directory reads (#138082)
  test(ui): decouple rendering checks from generated wording (#138283)
  perf: avoid temporary entries in bounded JSON traversal (#138017)
  fix(irc): render complete messages before splitting (#138328)
  perf: prepare worker trajectory payloads only for recorded events (#138086)
  fix(mcp): paginated listings no longer time out after a forward clock step (#137206)
  fix(codex): page native transcripts and bound UI previews (#136282)
  feat(gateway): apply more settings without restarting (#138112)
  fix(docs): preserve mirrored ClawHub maturity links (#138241)
  fix(test): own UI animation and legacy database setup (#138296)
  fix(tts): preserve literal directives in Markdown code (#138319)
  fix: load chat widgets behind authenticated gateways (#138074)
  chore(ui): cover native approval finalization (#137259)
  fix(cron): cancel conditions before main-session handoff (#138313)
  fix(backup): preserve text after embedded NUL characters (#138327)
  fix(android): align composer control sheets (#137442)
  fix(ci): wait for replacement PR runs instead of stale failures (#138307)
  fix(sessions): keep Gateway responsive with long transcripts (#138094)
  fix(computer): map window inputs to delivered image coordinates (#138271)
  ...

# Conflicts:
#	scripts/release-check.ts
#	test/release-check.test.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…138283)

* test(ui): decouple rendering checks from generated wording

* test(ui): narrow the English catalog value before hashing
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

3 participants