Skip to content

Fix runtime localization of XAML property keys#941

Merged
shanselman merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-fix-ui-strings
Jul 7, 2026
Merged

Fix runtime localization of XAML property keys#941
shanselman merged 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-fix-ui-strings

Conversation

@bkudiess

@bkudiess bkudiess commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix LocalizationHelper.GetString so runtime callers passing XAML property resource keys like ConnectionPage_Connect2.Content resolve through MRT path segments like ConnectionPage_Connect2/Content instead of displaying raw keys.
  • Add regression coverage for the property-key fallback path.
  • Stabilize the assistant bridge timeout test on ARM64 by widening the test-only command timeout from 2s to 5s.

Validation

  • ./build.ps1 — passed
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore — passed, 2691 passed / 31 skipped
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore — passed, 1506 passed

Real behavior proof

  • Current-head automated proof: LocalizationHelperSourceTests.GetString_ResolvesXamlPropertyResourceKeys verifies runtime localization now includes the dotted XAML property key fallback path.
  • Root cause confirmed from the reported Connection page state: NodeReconnectButton.Content dynamically calls LocalizationHelper.GetString("ConnectionPage_Connect2.Content"); without the MRT path fallback that key renders literally.
  • Visible UI proof not captured because reproducing the awaiting-pairing approval state requires a live gateway approval request.

Rubber-duck review

  • Dual reviewer run completed.
  • High consensus: no blocking issues.
  • Low consensus follow-ups: source-text regression test is weaker than a behavior seam; empty-resource logging edge case is very unlikely and already guarded by localization validation.

Resolve XAML property resource keys passed through LocalizationHelper by falling back from dotted keys to MRT path segments. This prevents runtime-updated controls from displaying raw keys such as ConnectionPage_Connect2.Content.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 4:20 PM ET / 20:20 UTC.

Summary
The PR changes LocalizationHelper.GetString to retry dotted XAML property keys as MRT slash paths, adds source-level regression coverage, and widens one tray test timeout.

Reproducibility: yes. from source inspection, though not from a live app run: current main passes ConnectionPage_Connect2.Content into LocalizationHelper.GetString, and the helper only performs the direct Resources/{resourceKey} lookup before falling back to the raw key.

Review metrics: none identified.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

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

Rank-up moves:

  • [P1] Add redacted current-head runtime proof that the dotted XAML property key resolves, such as a Connection page recording/screenshot or copied live output from a real resource lookup.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Needs contributor action: the PR body provides automated/source proof only; add redacted runtime output, logs, screenshot, or recording to the PR body so ClawSweeper can re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] Real behavior proof is missing: the PR body explicitly says visible UI proof was not captured, so the runtime MRT resolution path has not been shown from the current head.
  • [P1] The regression test is source-text coverage rather than a behavior seam; that matches existing tray source-test patterns, but it would not catch a future MRT runtime contract change by itself.

Maintainer options:

  1. Decide the mitigation before merge
    Land the focused fallback after CI completes and the contributor adds redacted runtime proof, such as a Connection page screenshot/recording or copied live output showing the dotted key resolves at runtime.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Manual follow-up is needed for contributor-supplied real behavior proof; no narrow code repair is indicated by this diff review.

Security
Cleared: The diff only changes a localization helper and tests, with no dependency, secrets, install, workflow, or code-execution surface change.

Review details

Best possible solution:

Land the focused fallback after CI completes and the contributor adds redacted runtime proof, such as a Connection page screenshot/recording or copied live output showing the dotted key resolves at runtime.

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

Yes from source inspection, though not from a live app run: current main passes ConnectionPage_Connect2.Content into LocalizationHelper.GetString, and the helper only performs the direct Resources/{resourceKey} lookup before falling back to the raw key.

Is this the best way to solve the issue?

Yes, the implementation path is narrow because it preserves direct lookup and only falls back by converting the last dot in a XAML property key to an MRT path separator; the missing piece is real behavior proof, not a different code direction.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2c6873e8f20f.

Label changes

Label changes:

  • add P2: This is a normal-priority Tray localization bug fix with a limited UI surface and no evidence of a release-blocking setup failure.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Needs contributor action: the PR body provides automated/source proof only; add redacted runtime output, logs, screenshot, or recording to the PR body so ClawSweeper can re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a normal-priority Tray localization bug fix with a limited UI surface and no evidence of a release-blocking setup failure.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Needs contributor action: the PR body provides automated/source proof only; add redacted runtime output, logs, screenshot, or recording to the PR body so ClawSweeper can re-review. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

What I checked:

Likely related people:

  • bkudiess: Prior merged work authored by this person localized hard-coded XAML strings across WinUI and recent connection-state work touched the same Connection page area; this is ownership history beyond being the current PR proposer. (role: feature owner and recent area contributor; confidence: high; commits: d4b35d4941c0, 74604aebafef; files: src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml, src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw, src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs)
  • shanselman: History shows this person merged the broad XAML localization pass and the current helper is blamed to the repository import/release commit associated with this area. (role: merger and adjacent owner; confidence: medium; commits: 4166e0fd63f8, d4b35d4941c0; files: src/OpenClaw.Tray.WinUI/Helpers/LocalizationHelper.cs, src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw)
  • karkarl: Recent accessibility/localization work touched ConnectionPage.xaml.cs, resource files, and localization validation, making this person a plausible reviewer for adjacent WinUI localization behavior. (role: recent adjacent contributor; confidence: medium; commits: 6045c2d00e1f; files: src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs, src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw, tests/OpenClaw.Tray.Tests/LocalizationValidationTests.cs)
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. P2 Normal priority bug or improvement with limited blast radius. labels Jul 7, 2026

@shanselman shanselman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed with >90% confidence. Small, well-scoped localization fallback; CI is green.

@shanselman shanselman merged commit 74fd2c1 into openclaw:main Jul 7, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants