Skip to content

Fix reset session dialog localization - #919

Merged
shanselman merged 1 commit into
openclaw:mainfrom
calebeden:calebeden-fix-reset-session-localization
Jul 2, 2026
Merged

Fix reset session dialog localization#919
shanselman merged 1 commit into
openclaw:mainfrom
calebeden:calebeden-fix-reset-session-localization

Conversation

@calebeden

@calebeden calebeden commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Problem: The Sessions reset confirmation rendered the cancel action as the raw resource key CancelButton.Content, and the dialog promoted Cancel with primary/default styling.
  • Why it matters: Reset is destructive, so the confirmation needs clear localized choices and a visual hierarchy that emphasizes the destructive verb instead of Cancel.
  • What changed: Session confirmations now use a runtime-scoped SessionActionPrompt_CancelLabel resource in every locale and use ContentDialogButton.None so Cancel is neutral.
  • User impact: The reset dialog now shows Reset and localized Cancel, with Reset as the emphasized action.
  • What did NOT change (scope boundary): No gateway, session mutation, or MCP behavior changed.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs / instructions
  • Tests / validation
  • Security hardening
  • Chore / infra

Scope (select all touched areas)

  • Tray / WinUI UX
  • Windows node capability
  • Local MCP / winnode
  • Gateway / connection / pairing
  • Setup / onboarding
  • Permissions / privacy / security
  • Tests / CI / docs

Linked Issue/PR

  • Closes N/A
  • Related N/A
  • Related to a bug or regression

Validation

  • ./build.ps1 - passed; Shared, Cli, WinNodeCli, SetupEngine, and WinUI all built successfully.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore - passed: 2689 passed, 31 skipped, 2720 total.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore - passed: 1452 passed, 0 skipped, 1452 total.

Real behavior proof

  • Environment tested: Windows ARM64 packaged WinUI app launched with winapp run ".\src\OpenClaw.Tray.WinUI\bin\Debug\net10.0-windows10.0.22621.0\win-arm64" --manifest ".\src\OpenClaw.Tray.WinUI\Package.appxmanifest" --executable "OpenClaw.Tray.WinUI.exe" --debug-output.
  • PR head / commit tested: 92f750a1.
  • Exact steps or command run: Opened openclaw://activity?filter=session, invoked Sessions > More actions > Reset, then inspected the live ContentDialog with winapp ui.
  • Evidence after fix:
winapp ui search Cancel -w 2561132 --max 20
  CloseButton Button "Cancel" (1926,1146 349x48)
Found 1 matches

winapp ui search CancelButton.Content -w 2561132 --max 20
Found 0 matches

winapp ui inspect -w 2561132 --interactive
Window > Pane > Pane > Window
        PrimaryButton Button "Reset" (1564,1146 350x48)
        CloseButton Button "Cancel" (1926,1146 349x48)
  • Observed result: The reset confirmation shows localized Cancel instead of CancelButton.Content; Reset remains the primary action while Cancel is not the default button.
  • Screenshot/artifact links verified? N/A - GitHub user-attachment upload returned Not Found, so copied UIA proof is included instead.
  • Not verified / blocked: Screenshot upload was blocked by the GitHub uploads API response above; live UIA proof was collected from the packaged app.

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation: N/A

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps: N/A

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only conversations that still need reviewer or maintainer judgment.

N/A - no bot review conversations were addressed by this PR.

Screenshots

Before:
Screenshot 2026-07-01 163457
After:
image

Use a runtime session-action cancel label for reset confirmations and avoid promoting Cancel as the default dialog button.

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

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 8:04 PM ET / 00:04 UTC.

Summary
The PR updates two session confirmation dialogs to use a session-scoped cancel resource, adds that resource to all tray locales, neutralizes the dialog default button, and extends source-contract tests.

Reproducibility: yes. Current-main source shows both session confirmation paths still use LocalizationHelper.GetString("CancelButton.Content") with Close as the default, and the PR proof shows the visible before/after dialog behavior.

Review metrics: 2 noteworthy metrics.

  • Changed surface: 8 files, +28/-4. The diff is small and focused across two dialog call sites, five locale resources, and one test file.
  • Locale resources: 5 Resources.resw files updated. Every supported tray locale receives the new session cancel label, which is the key coverage point for this localization fix.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

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

Next step before merge

  • No ClawSweeper repair is needed; this clean implementation PR should proceed through normal maintainer review and status checks.

Security
Cleared: No dependency, workflow, secret, permission, network, command execution, or stored-data security concern is introduced by this localization/UI diff.

Review details

Best possible solution:

Land the narrow localization/default-button fix after ordinary maintainer review and status checks, keeping cancel text as a runtime session-action resource.

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

Yes. Current-main source shows both session confirmation paths still use LocalizationHelper.GetString("CancelButton.Content") with Close as the default, and the PR proof shows the visible before/after dialog behavior.

Is this the best way to solve the issue?

Yes. Replacing both runtime dialog lookups with a session-scoped resource and neutralizing the default button is the narrow maintainable fix, and the source-contract tests cover the regression.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded user-facing bug fix for destructive session confirmation copy and button hierarchy, with limited blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes current-head packaged WinUI UIA output and screenshots showing localized Cancel, absence of CancelButton.Content, and Reset as the primary button.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes current-head packaged WinUI UIA output and screenshots showing localized Cancel, absence of CancelButton.Content, and Reset as the primary button.
Evidence reviewed

What I checked:

Likely related people:

  • bkudiess: Authored the merged session-actions work that added the localizer, changed the Sessions page confirmation flow, and added the source-contract test file now being extended. (role: feature owner; confidence: high; commits: 989f9ffde2dd; files: src/OpenClaw.Tray.WinUI/Pages/SessionsPage.xaml.cs, src/OpenClaw.Tray.WinUI/Helpers/SessionActionPromptLocalizer.cs, tests/OpenClaw.Tray.Tests/SessionActionsWiringTests.cs)
  • RBrid: Authored the recent tray localization pass touching resource files and localization validation tests, which are adjacent to the PR's locale-resource fix. (role: recent localization area contributor; confidence: medium; commits: 25c11dd07f09; files: src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw, tests/OpenClaw.Tray.Tests/LocalizationValidationTests.cs)
  • shanselman: Authored recent App.xaml.cs guardrail work and repository policy changes relevant to reviewing this App.xaml.cs touch. (role: adjacent App guardrail contributor; confidence: medium; commits: 06b63ac6ce7d; files: src/OpenClaw.Tray.WinUI/App.xaml.cs, AGENTS.md)
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 proof: sufficient Contributor real behavior proof is sufficient. 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. P2 Normal priority bug or improvement with limited blast radius. 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 Jul 1, 2026
@shanselman

Copy link
Copy Markdown
Collaborator

Nice focused fix, Caleb. This is exactly the right shape for this bug: both reset confirmation call sites now use a runtime dialog resource instead of a XAML property resource key, every supported locale gets the new label, and the source-contract tests protect both the raw-key regression and the neutral default button choice. I also appreciate the clear UIA proof in the PR body for the destructive reset dialog.

I validated locally with the required repo build, Shared tests, and Tray tests, and I’m comfortable taking this.

@shanselman
shanselman merged commit bbd18d4 into openclaw:main Jul 2, 2026
2 checks passed
@calebeden
calebeden deleted the calebeden-fix-reset-session-localization branch July 9, 2026 22:56
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. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

2 participants