Repository navigation
test(ui): decouple rendering checks from generated wording - #138283
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
|
|
Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 10:51 AM ET / 14:51 UTC. ClawSweeper reviewWhat this changesThis 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 Review scores
Verification
How this fits togetherControl 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +41. Total +41 across 5 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
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.
|
Merged via squash.
|
…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
…138283) * test(ui): decouple rendering checks from generated wording * test(ui): narrow the English catalog value before hashing
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
git diff --checkpass.mermaid,diff, andpakodeclarations 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.