Skip to content

feat: add Back to app and Esc to the Settings sidebar, like macOS - #2065

Open
bkudiess wants to merge 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-settings-back-to-app-header
Open

bkudiess wants to merge 1 commit into
openclaw:mainfrom
bkudiess:bkudiess-settings-back-to-app-header

Conversation

@bkudiess

@bkudiess bkudiess commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

On Windows, Settings has no clear way back to the app. macOS Settings starts with a "Back to app" row (with an Esc hint) and a Settings title.

User Impact

User impact: the Settings sidebar now starts with Back to app (with an Esc key hint) and a Settings title, replacing the old Chat item at the top of the list. Back to app or Escape returns to where Settings was opened from: the same chat with its unsent draft, Notifications, or a pinned page. Escape is ignored while a menu, flyout, dialog, text box or dropdown needs it. Pinned pages shown beside the main sidebar are unchanged.

Why This Change Was Made

This follows upstream exitSettings(), which returns to the last non-Settings location, and shouldIgnoreSettingsEscape, which leaves Escape to overlays and editors. The return target comes from the window's existing Back/Forward history (WorkspaceNavigationHistory.AppDestination), so it adds one ordinary history entry and reuses the retained chat. It goes through the existing dialog deferral and focus restoration. Like Back and Forward, it never returns to a pinned Gateway page that is no longer available. The header is native WinUI (NavigationView.PaneCustomContent) using theme resources. Its strings are translated in all six locales. When the sidebar is collapsed to icons, only the arrow remains, with a tooltip.

Evidence

Native UI test SettingsBackToApp_ReturnsToAppDestinationInSameWindow passed 3/3 (mouse, Enter, Escape) on the PR head source, in an isolated app profile. It checks that the same composer and draft come back after leaving Settings, that leaving from Notifications returns to Notifications with focus on that page, and that the compact sidebar keeps the arrow.

Settings sidebar, expanded:

Settings sidebar with Back to app, Esc hint and Settings title

Compact sidebar keeps only the arrow:

Compact Settings sidebar with the Back to app arrow above the section icons

After pressing Escape, the same chat returns with its draft:

Chat restored with the unsent draft after pressing Escape in Settings

The user also tried an earlier build of this change (before the review fixes) on their real profile with the Store Gateway.

Dual-model review (Claude Opus 5.5 and GPT-6 Astra, high effort) found three medium issues that both models flagged: a stale pinned Gateway page as the return target, an exit deferred behind a dialog, and focus fallback. All three are fixed and covered by tests. An earlier independent rubber-duck review found no blockers.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

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

Required proof pools

  • windows-winui-interactive: new Settings header, keyboard (Escape) and focus behavior in the WinUI app.

Validation

Run on the final source (identical to 13b2a4e):

  • ./build.ps1: passed (Shared, Cli, WinNodeCli, SetupEngine, WinUI; documentation validation passed).
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 4875 passed, 25 skipped, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 5305 passed, 0 failed.
  • Isolation note: the Shared and Tray runs above ran with OPENCLAW_TRAY_DATA_DIR, OPENCLAW_TRAY_APPDATA_DIR, OPENCLAW_TRAY_LOCALAPPDATA_DIR, OPENCLAW_TRAY_LOCAL_DATA_DIR and OPENCLAW_STATE_DIR all unset, so they were not isolated from the real user profile. The native UI run below set all four OPENCLAW_TRAY_* roots to fixture temp folders.
  • dotnet build tests/OpenClaw.Tray.UITests -c Debug -r win-x64 --no-restore then dotnet test tests/OpenClaw.Tray.UITests --no-build -c Debug -r win-x64 --filter "FullyQualifiedName~SettingsBackToApp_ReturnsToAppDestinationInSameWindow": 3 passed.
  • git diff --check: clean.

New unit tests in WorkspaceNavigationTests:

  • BackToApp_* covers the retained chat, a conversation created while Settings is open, Notifications, pinned pages and pruned pinned Gateway pages.
  • SettingsEscape_* covers when Escape leaves Settings.

Real Behavior Proof

  • Environment tested: Windows 11 x64, local WinUI app via the UI-test fixture with isolated OPENCLAW_TRAY_* data roots; no Gateway connection in the fixture.
  • PR head or commit tested: the native run used the working tree that became 13b2a4e (no source change after the run).
  • Exact steps or command run: dotnet test tests/OpenClaw.Tray.UITests --no-build -c Debug -r win-x64 --filter "FullyQualifiedName~SettingsBackToApp_ReturnsToAppDestinationInSameWindow". Each case opens Chat, types a draft, opens Settings > Connection, collapses and expands the sidebar, then leaves Settings by mouse, Enter or Escape. It repeats from Notifications.
  • Evidence after fix: the screenshots above, from that run.
  • Observed result: 3/3 passed. The same composer and draft came back, Notifications was restored with focus on the page, and the compact sidebar kept the arrow.
  • Screenshot or artifact links verified? (Yes/No/N/A) Yes
  • Not verified or blocked: High Contrast, dark theme and non-English layouts were not captured. Escape inside a text box, a deferred exit behind a dialog, and returning to a pinned page are covered by unit and source tests, not native tests. Not checked against a live Gateway.

Security Impact

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

Compatibility and Migration

  • Backward compatible? (Yes/No) Yes. The chat route and search command still work; only the Settings sidebar Chat item (SettingsNavChat) is replaced by SettingsBackToApp.
  • Config or environment changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, list the exact upgrade steps: N/A

Review Conversations

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

Match the macOS Settings sidebar: a "Back to app" row with an Esc key hint,
then a Settings title, replacing the rail's Chat item. Back to app and Escape
return to the chat, Notifications or pinned page Settings was opened from,
as one history entry that reuses the retained chat and its draft. Escape
leaves only full Settings and only when no popup, dialog or text editor owns it.

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

clawsweeper Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 7, 2026
@clawsweeper

clawsweeper Bot commented Nov 7, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR replaces Settings’ Chat row with a localized Back to app header and Escape shortcut that restore the previous app destination.

Example: Open Connection settings from Notifications, then press Escape.

  • Before: There is no Settings exit shortcut, and the Chat row returns specifically to Chat.
  • After: Escape returns to Notifications and moves focus onto that page.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused change with directly inspected native evidence and no blocking defect; some added source assertions are implementation-coupled.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected current-source native screenshots showing the Settings header, compact arrow, and restored draft, supported by the reported Windows 11 mouse, Enter, and Escape runs through the real app. Editor/overlay Escape, dialog deferral, and pinned-page returns have source or unit coverage rather than native captures.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Settings’ Chat row does not clearly communicate leaving Settings or return users to Notifications or a pinned page.
Reason: The collaborator-authored direction supplies the owner decision, and the change makes the exit explicit without adding configuration or replacing navigation ownership.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it adds a useful, owner-approved navigation improvement absent from current main, with visible native proof and no blocking introduced defect found.

Priority: P3
Reviewed head: 13b2a4e62955b0b26476a67f4e79d9627ef5f701

Before merge

None.

Findings

None.

Tests

  • Low-value test tests/OpenClaw.Tray.Tests/Presentation/WorkspaceNavigationTests.cs: Remove the newly added assertions pinning handler names and exact source fragments where they duplicate native behavior coverage; retain the concrete single-owner and no-second-chat guards.
Agent review details

How this fits together

SettingsShellView supplies the native sidebar; WorkspaceNavigationHistory selects the return destination, and WorkspaceWindow applies navigation, dialog deferral, and focus restoration.

flowchart LR
  A[Back to app button] --> C[WorkspaceWindow]
  B[Escape key] --> D[Escape policy]
  D --> C
  C --> E[Existing navigation history]
  E --> F[Retained Chat or previous app page]
Loading

Technical review

Best possible solution:

Keep the localized exit affordance in the existing Settings and Workspace owners while preserving the retained composer, ordinary history, and control-owned Escape handling.

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

This is an intentional feature addition: current-main source confirms the existing Chat row and absence of the new Settings exit handler.

Is this the best way to solve the issue?

The implementation is appropriately scoped: it replaces the old row, retains one history owner, and reuses existing dialog, page-lifetime, and chat-preservation paths.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b6f158ab257a.

Provenance checked

  • Settings Chat row and invocation handling changes intended behavior with a stated reason (f4122a8: The earlier Chat action reopened or foregrounded Workspace without discarding its composer; its deferred invocation avoided NavigationView focus handling.)
  • Single-window history and retained chat keeps the original intent (4e31031: Settings and Chat share one window and history while retaining the composer and draft; existing modal admission protects destination changes.)
  • Embedded pinned-page navigation keeps the original intent (7967d50: Pinned Gateway pages reuse the native page host and history beside the main sidebar, with unavailable destinations excluded from navigation.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Barbara Kudiess: Raw commit 7967d50 adds src/OpenClaw.Tray.WinUI/Windows/WorkspaceWindow.xaml.cs:470 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7967d509886f; files: src/OpenClaw.Tray.WinUI/Windows/WorkspaceWindow.xaml.cs)
  • Karen: Raw commit 3a58bf3 adds src/OpenClaw.Tray.WinUI/Presentation/WorkspaceNavigation.cs:87 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3a58bf34902f; files: src/OpenClaw.Tray.WinUI/Presentation/WorkspaceNavigation.cs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Scope Production +154/-22; resources +57/-0; tests +174/-28; docs +6/-4 Growth stays within existing owners and covers distinct return-destination, keyboard, rendering, and draft-retention behavior.

Labels

Label changes:

  • add P3: This is a low-risk navigation and keyboard ergonomics improvement; existing Chat and history navigation already provide an in-product return path.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a low-risk navigation and keyboard ergonomics improvement; existing Chat and history navigation already provide an in-product return path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 7, 2026, 12:45 AM ET / 05:45 UTC.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant