Skip to content

fix(ui): localize skill workshop switcher#91210

Closed
SYU8384 wants to merge 10 commits into
openclaw:mainfrom
SYU8384:fix/ui-skill-workshop-mode-switcher-i18n
Closed

fix(ui): localize skill workshop switcher#91210
SYU8384 wants to merge 10 commits into
openclaw:mainfrom
SYU8384:fix/ui-skill-workshop-mode-switcher-i18n

Conversation

@SYU8384

@SYU8384 SYU8384 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Splits out the i18n portion of #79745.

This PR localizes the Skill Workshop mode switcher (Board / Today) into all supported Control UI locales. It does not touch the qmd/mcporter memory path.

Verification

Rebased onto current upstream/main (ded3a93058) and regenerated Control UI i18n output from ui/src/i18n/locales/en.ts with fallback-only sync. The generated non-English locale bundles now keep the five new skillWorkshop.modeSwitcher.* keys as English fallbacks until translators run.

Real behavior proof

  • Behavior addressed: Skill Workshop Board/Today switcher in Control UI now renders through i18n instead of hard-coded English strings, matching the existing localized skillWorkshop.header.* pattern.
  • Real environment tested: Local OpenClaw checkout on Linux, Node 24.15.0, branch fix/ui-skill-workshop-mode-switcher-i18n at dc147ebfb5. Translation provider keys were unset for i18n generation/check, so new non-English keys intentionally fall back to English.
  • Exact steps or command run after this patch:
    env -u OPENAI_API_KEY -u ANTHROPIC_API_KEY node --import tsx scripts/control-ui-i18n.ts sync --write
    env -u OPENAI_API_KEY -u ANTHROPIC_API_KEY node --import tsx scripts/control-ui-i18n.ts check
    node scripts/run-vitest.mjs ui/src/i18n/test/skill-workshop-mode-switcher.test.ts ui/src/ui/app-render.skill-workshop.test.ts ui/src/ui/app-render.assistant-avatar.test.ts -- --reporter=verbose
    node_modules/.bin/oxfmt --check ui/src/i18n/test/skill-workshop-mode-switcher.test.ts ui/src/ui/app-render.skill-workshop.test.ts ui/src/ui/app-render.assistant-avatar.test.ts
    node scripts/run-oxlint-shards.mjs --threads=8
  • Evidence after fix:
    • node scripts/run-vitest.mjs ... passed: Test Files 3 passed (3), Tests 22 passed (22).
    • Rendered proof test emits the actual .sw-mode-switch from renderApp in de locale with aria-label="Workshop view", title="Board view", title="Today view", visible Board, visible Today, and active Board aria-selected="true".
    • node --import tsx scripts/control-ui-i18n.ts check passed: all 18 non-English locales clean with fallbacks=33.
    • node_modules/.bin/oxfmt --check ... passed: all matched files use the correct format.
    • node scripts/run-oxlint-shards.mjs --threads=8 passed: core, extensions, and scripts lint shards finished without findings.
  • Observed result after fix: renderSkillWorkshopHeaderControls resolves all five switcher strings through t("skillWorkshop.modeSwitcher.*"). The en.ts source defines those keys; generated non-English locale bundles include the same fallback values and metadata. The rendered Skill Workshop switcher still exposes the same tab roles, button titles, visible labels, and active-state ARIA attributes.
  • What was not tested: Live browser screenshot in a non-English Control UI session; screen-reader announcement of the new aria-label; translator-supplied localized strings after a future translation pass.

Related

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 7, 2026
@clawsweeper

clawsweeper Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 11:14 AM ET / 15:14 UTC.

Summary
The PR routes the Skill Workshop mode switcher and chat reply dismiss copy through Control UI i18n, updates English and generated locale fallback metadata, and adds focused i18n/render tests.

PR surface: Source +273, Tests +541. Total +814 across 48 files.

Reproducibility: yes. Current main source shows the Skill Workshop switcher and chat reply dismiss strings are hard-coded in the render paths, and the PR proof exercises the changed renderApp output in a non-English locale.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: persistent cache schema: ui/src/i18n/.i18n/hi.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/ru.tm.jsonl. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • No ClawSweeper repair lane is needed because no actionable patch defect was found; the remaining action is normal maintainer review and merge decision.

Security
Cleared: Cleared: the diff is limited to UI/i18n source, generated locale metadata, and tests, with no workflow, dependency, lockfile, secret, package, or code-execution surface change.

Review details

Best possible solution:

Land this focused i18n wiring after maintainer review, keeping English source keys and generated locale fallback metadata synchronized through the Control UI i18n pipeline.

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

Yes. Current main source shows the Skill Workshop switcher and chat reply dismiss strings are hard-coded in the render paths, and the PR proof exercises the changed renderApp output in a non-English locale.

Is this the best way to solve the issue?

Yes. Routing the strings through existing t() calls and updating en.ts plus generated fallback bundles follows the scoped UI i18n policy; manually translating generated locale files would be the wrong maintenance path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 825d9a66623a.

Label changes

Label justifications:

  • P3: This is a low-risk Control UI localization cleanup with clean checks and no evidence of runtime, compatibility, security, or delivery impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and comments provide after-fix rendered output from the actual renderApp Skill Workshop path plus i18n/check/test command results, which is sufficient for this text-rendering i18n change.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and comments provide after-fix rendered output from the actual renderApp Skill Workshop path plus i18n/check/test command results, which is sufficient for this text-rendering i18n change.
Evidence reviewed

PR surface:

Source +273, Tests +541. Total +814 across 48 files.

View PR surface stats
Area Files Added Removed Net
Source 46 397 124 +273
Tests 2 541 0 +541
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 48 938 124 +814

What I checked:

  • Current main hard-codes the switcher copy: Current main renders the Skill Workshop tablist label, button titles, and visible Board/Today text as literal English strings in renderSkillWorkshopHeaderControls. (ui/src/ui/app-render.ts:300, 825d9a66623a)
  • PR head routes switcher copy through i18n: The PR head replaces those switcher literals with t("skillWorkshop.modeSwitcher.*") calls while preserving the same tab roles and mode wiring. (ui/src/ui/app-render.ts:300, 074466fe7f2f)
  • PR head defines the English i18n keys: The PR adds skillWorkshop.modeSwitcher keys and chat.composer.cancelReply to the English source locale, which is the Control UI i18n source of truth. (ui/src/i18n/locales/en.ts:458, 074466fe7f2f)
  • Scoped UI policy supports generated locale updates: The UI guide says non-English locale bundles and .i18n metadata are generated output, with en.ts plus the i18n generator/runtime as source of truth, and generated bundles should be committed after sync. (ui/AGENTS.md:7, 825d9a66623a)
  • Rendered proof covers the changed runtime path: The new render test calls renderApp for the Skill Workshop tab, checks the resolved tablist label, button titles, visible text, and emits the rendered .sw-mode-switch HTML for a de locale proof path. (ui/src/ui/app-render.skill-workshop.test.ts:372, 074466fe7f2f)
  • Live checks are clean at the current head: A live check query returned no non-success and non-skipped checks for PR head 074466fe7f2fafa913ffcad8828547e56b0660ab. (074466fe7f2f)

Likely related people:

  • joshavant: Current-main blame for the Skill Workshop header controls, English i18n source area, and UI i18n guide points to the same recent Control UI/i18n surface commit from fix: make inbound document attachments readable by runners #97647. (role: recent area contributor; confidence: medium; commits: 7c47904bb42d; files: ui/src/ui/app-render.ts, ui/src/i18n/locales/en.ts, ui/AGENTS.md)
  • programmingWTF: The chat reply dismiss button being localized by the PR appears to come from the right-click Reply webchat feature in feat(control-ui): add right-click Reply in Dashboard webchat #92654. (role: introduced adjacent behavior; confidence: high; commits: 05cf49776766; files: ui/src/ui/views/chat.ts)
  • vincentkoc: GitHub metadata for the right-click Reply feature shows this person merged the PR and authored a lint follow-up commit on the same chat reply surface. (role: merger and adjacent contributor; confidence: medium; commits: 70a96db4d709; files: ui/src/ui/views/chat.ts, ui/src/ui/views/chat.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jun 7, 2026
@mantis

mantis commented Jun 7, 2026

Copy link
Copy Markdown

@SYU8384 - Hi, I'm not a member of this project so I believe you meant to @ someone else

@SYU8384

SYU8384 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@SYU8384 - Hi, I'm not a member of this project so I believe you meant to @ someone else

Apologies!🙏🏼

@SYU8384

SYU8384 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added Real behavior proof per the contributor template. Highlights:

  • New test ui/src/i18n/test/skill-workshop-mode-switcher.test.ts (4 tests) — resolves the 5 new keys against en.ts, asserts the en.ts shape, asserts app-render.ts no longer has the legacy literals, and asserts raw-copy-baseline.json no longer lists those 5 strings.
  • pnpm --dir ui test skill-workshop-mode-switcher → 4 passed.
  • pnpm --dir ui test translate (regression) → 11 passed.
  • pnpm ui:i18n:check → clean across all 18 locales (fallbacks=36 consistent with the existing 31 untranslated keys plus the 5 new ones; no new drift).
  • No live Control UI screenshot — a Control UI build is not available in this environment. The unit test plus pnpm ui:i18n:check cover the wiring; happy to add a Mantis visual capture if you want one before merge.
  • The ClawSweeper "Mantis proof suggestion" comment in the thread is acknowledged; not invoking Mantis because the wiring is fully covered by the new test and the i18n drift gate.

Branch fix/ui-skill-workshop-mode-switcher-i18n is up to date with the test commit.

@clawsweeper

clawsweeper Bot commented Jun 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 10, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 10, 2026
@SYU8384

SYU8384 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Re-arming with rendered real-path proof this time.

What changed since the last re-review:

  • New test ui/src/ui/app-render.skill-workshop.test.ts (+120 lines) — exercises the actual renderApp(state) render path with i18n.setLocale("de") and dumps the resulting .sw-mode-switch element via outerHTML. 3 tests, all passing, plus the 15 inherited from app-render.assistant-avatar.test.ts (which I export-ed createState from so the new test can reuse the same fixture). Total: 18 passed in this file.
  • The same test also runs against six non-English locales (de, es, ja-JP, zh-CN, ar, fr) and asserts the same English strings resolve, since the new keys are in fallbackKeys for every non-English bundle until translators ship.
  • The rendered switcher HTML is now pasted inline in the PR body under "Rendered switcher HTML (copied live output, de locale)" — aria-label="Workshop view", title="Board view", title="Today view", <span>Board</span>, <span>Today</span>, aria-selected="true" on the active Board tab. All five new i18n keys resolve through t() to the expected values, with no hard-coded literal leakage.

Local CI:

  • pnpm --dir ui test skill-workshop-mode-switcher → 4 passed
  • pnpm --dir ui test app-render.skill-workshop → 18 passed (15 inherited + 3 new)
  • pnpm --dir ui test translate → 11 passed (regression)
  • pnpm --dir ui test app-render.assistant-avatar → 15 passed (regression; createState export is non-breaking)
  • pnpm ui:i18n:check → clean across all 18 locales (fallbacks=36)

This is "copied live output" per the proof rubric — the same renderApp code path the Control UI uses, with a non-English locale set, with the actual t() calls resolving the actual new keys. The lit-html rehydration markers (<!--?lit$...$-->) in the pasted HTML are normal and do not affect the rendered strings.

Still no live Control UI screenshot (no build environment available here). If a maintainer wants visual proof on top, the Mantis visual task prompt from the original review is a one-liner away.

Branch fix/ui-skill-workshop-mode-switcher-i18n is up to date with the rendered-proof commit.

@clawsweeper

clawsweeper Bot commented Jun 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 10, 2026
@SYU8384
SYU8384 force-pushed the fix/ui-skill-workshop-mode-switcher-i18n branch from d296f83 to dc147eb Compare June 13, 2026 03:00
@SYU8384

SYU8384 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased onto current upstream/main, resolved the generated i18n metadata conflicts through control-ui-i18n fallback-only sync, fixed the CI lint issue in skill-workshop-mode-switcher.test.ts, and refreshed the PR body with current proof.

Fresh local proof:

  • node scripts/run-vitest.mjs ui/src/i18n/test/skill-workshop-mode-switcher.test.ts ui/src/ui/app-render.skill-workshop.test.ts ui/src/ui/app-render.assistant-avatar.test.ts -- --reporter=verbose → 3 files / 22 tests passed
  • env -u OPENAI_API_KEY -u ANTHROPIC_API_KEY node --import tsx scripts/control-ui-i18n.ts check → all 18 locales clean, fallbacks=33
  • node_modules/.bin/oxfmt --check ui/src/i18n/test/skill-workshop-mode-switcher.test.ts ui/src/ui/app-render.skill-workshop.test.ts ui/src/ui/app-render.assistant-avatar.test.ts → passed
  • node scripts/run-oxlint-shards.mjs --threads=8 → passed

Head: dc147ebfb5.

@clawsweeper

clawsweeper Bot commented Jun 13, 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 repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@SYU8384

SYU8384 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Previous re-review on dc147ebfb5 failed inside ClawSweeper/Codex with retryable codex transport failure (network). The PR is mergeable, has no failing or pending checks, and current head is dc147ebfb589576b6c1f1c36f3ca6401732a3606. Please rerun against the current head.

@SYU8384

SYU8384 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer note: I retried ClawSweeper once after the earlier failed re-review, and the new run completed its GitHub workflow successfully, but the durable review still failed internally with the same ClawSweeper/Codex transport issue.

Evidence:

I’m not going to keep re-triggering ClawSweeper from the PR thread. Please treat the current off-meta rating as an infra failure, or have a ClawSweeper owner clear/rerun it from the backend.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 14, 2026
@SYU8384
SYU8384 force-pushed the fix/ui-skill-workshop-mode-switcher-i18n branch from 2e118cd to 4b79eb4 Compare June 17, 2026 15:38
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 17, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. 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. and removed 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 🔁 re-review loop A fresh ClawSweeper review was explicitly requested after the latest review. labels Jun 19, 2026
@SYU8384
SYU8384 force-pushed the fix/ui-skill-workshop-mode-switcher-i18n branch from 4b79eb4 to 41e2100 Compare June 23, 2026 12:41
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 23, 2026
SYU8384 added 3 commits June 29, 2026 14:29
…210-conflicts

# Conflicts:
#	ui/src/i18n/.i18n/ar.meta.json
#	ui/src/i18n/.i18n/de.meta.json
#	ui/src/i18n/.i18n/es.meta.json
#	ui/src/i18n/.i18n/fa.meta.json
#	ui/src/i18n/.i18n/fr.meta.json
#	ui/src/i18n/.i18n/id.meta.json
#	ui/src/i18n/.i18n/it.meta.json
#	ui/src/i18n/.i18n/ja-JP.meta.json
#	ui/src/i18n/.i18n/ko.meta.json
#	ui/src/i18n/.i18n/nl.meta.json
#	ui/src/i18n/.i18n/pl.meta.json
#	ui/src/i18n/.i18n/pt-BR.meta.json
#	ui/src/i18n/.i18n/th.meta.json
#	ui/src/i18n/.i18n/tr.meta.json
#	ui/src/i18n/.i18n/uk.meta.json
#	ui/src/i18n/.i18n/vi.meta.json
#	ui/src/i18n/.i18n/zh-CN.meta.json
#	ui/src/i18n/.i18n/zh-TW.meta.json
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Jun 29, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Closing as superseded by #105008 and the generated locale refresh in #105100. Skill Workshop mode, controls, labels, and accessibility copy are now localized through the consolidated source and generated bundles. Thanks @SYU8384 for splitting and proving this slice.

@vincentkoc vincentkoc closed this Jul 12, 2026
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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