Repository navigation
feat: add Back to app and Esc to the Settings sidebar - #2065
Conversation
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 <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherSettingsShellView 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource 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
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 7, 2026, 12:45 AM ET / 05:45 UTC. |
Give empty Notifications a named focusable destination and prove populated and empty returns using a real MCP-produced notification. Retain independent native keyboard and rendered-state test contracts. Co-authored-by: bkudiess <[email protected]>
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, andshouldIgnoreSettingsEscape, 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
Commit
b1d5e0b77684ab603281882a7e0b9d10877f30cdhas treefb147c549f19e8e0d8f3c7ed31876f10191088b4. All 2,172 intended source files were checked byte-for-byte against the retained native validation manifest and the committed Git blobs. Tests ran on the source-identical uncommitted candidate based on13b2a4e62955b0b26476a67f4e79d9627ef5f701; committing did not constitute another test run. Source-manifest SHA256:ac600a89b0f359e4505e92cd85456f50e5bc0b8265cb4eb299325729dccdd686.Current source-equal proof: full build/unit suites passed; real accessibility 34/34; Settings Back mouse/Enter/Escape 3/3 in Debug and 3/3 in non-dev Release, including populated and empty Notifications; full hosted selection 664 passed / 1 compositor opt-in skip, with all four startup cases executed.
The follow-up repair gives empty Notifications a named Pane peer and an empty-only tab stop, so the existing Workspace focus handoff has a valid target. The test uses real MCP
system.notifydiscovery/invocation for deterministic populated input and exact owned-window/control identity for focus. Two shared test prerequisites preserve native Clipboard traversal/collapse behavior and observe elapsed rendering instead of sleeping.Independent source and rubber-duck implementation/proof-plan reviews by GPT-6 Astra found no P0-P3 blocking findings in the frozen candidate. The actual role was a native OpenClaw subagent; context tier and reasoning effort were not independently attested. The requested Opus 5.5 pass was unavailable in this environment, so no renewed dual-model Hanselman consensus is claimed.
Before pressing Escape (current source-equal build):
After pressing Escape, the same composer retains its draft:
Returning to empty Notifications:
Empty-page keyboard focus is established by native UI Automation assertions, not inferred from these pixels. The retained pre-fix empty-state negative control failed all three variants; the named-peer/conditional-tab-stop repair passes all three.
Earlier author evidence and reviews, kept historical
The original author reported a dual-model Opus/Astra review and an earlier rubber-duck review, plus a real-profile trial. Those reports are not a renewed review of this update. Original-head CI failed the Notifications focus assertion, which incorrectly excluded the entire NavigationView subtree. Later native testing separately established the empty-state production focus gap. The original author’s unit runs had isolation limitations; the new runs below used explicit isolated roots.
Earlier author screenshots, not the current repair proof above:
Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: new Settings header, keyboard (Escape) and focus behavior in the WinUI app.Validation
Current source-equal runs used Windows 11 Pro 25H2 x64, .NET SDK 10.0.403, source Windows App SDK pin 2.6.4 with serviced runtime 2.6.5.0, and explicit isolated app/test roots. All four
OPENCLAW_TRAY_*roots were set;OPENCLAW_STATE_DIRwas unset only for unit processes and restored to private state for UI runs../build.ps1and explicit Shared/Tray project buildsdotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restoredotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore-c Debug -r win-x64FullyQualifiedName~SettingsBackToApp_ReturnsToAppDestinationInSameWindowFullyQualifiedName~ClipboardExpander_SupportsKeyboardSelectionAndCollapseFullyQualifiedName~ActiveRun_AfterAssistantPreamble_KeepsClawAndElapsedTimeVisibleCategory=AccessibilityCategory!=Accessibility&Category!=NativeOnboardingProof&Category!=GatewayFixturegit diff --checkFocused commands used
dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -c <Debug-or-Release> -r win-x64 --no-build --no-restore --filter <selection>with fresh TRX directories and explicit matching app binaries. All actual UI diagnostic processes setOPENCLAW_RUN_GATEWAY_FIXTURE_UI=1andOPENCLAW_RUN_KEYBOARD_PROOF=1; compositor opt-in stayed off.The Release flag was process-scoped and restored. This is documented local fixture testing, not signed-distribution proof. Hosted diagnostics used
--diag,--blameand a 300-second non-memory hang watchdog. A held native handle confirmed testhost PID10600 exited 0; the retained VSTest teardown/disposed-process warning is not erased or used to infer the result.Initial Axe had two foreground-activation failures against Explorer. No shell kill, focus-policy change, source edit, assertion relaxation or timeout increase was used. Under a native-click-qualified launcher, those two cases passed, then the full 34-case invocation passed. Initial failures remain retained; duplicate archive paths for that failed TRX are one invocation, not two.
Real Behavior Proof
b1d5e0b77684ab603281882a7e0b9d10877f30cd; all 2,172 source blobs match the retained manifest.Crabbox receipts (team access may be required):
Archive SHA256:
b85733ddf2ccc61464532d283b6c25dd38c2f6cc70eb350bbc33671ffd9d52db(227 verified files). Accessibility summary:poolId=windows-winui-interactive,commandId=run-accessibility-scan, 34 discovered/executed/passed, zero failed/skipped,scope=selected-test-execution-only,poolComplete=false. Independent native source/binary bindings supplement, not replace, that limited summary.Security Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No) Yes. Thechatroute and search command still work; only the Settings sidebar Chat item (SettingsNavChat) is replaced bySettingsBackToApp.Yes/No) NoYes/No) NoContributor credit
Original PR by @bkudiess. Follow-up fixes and native validation were prepared with Barbara Kudiess; the follow-up commit retains her co-author credit.
Work sessions
Linked for team reference; these sessions aren’t public.
Review Conversations
Live inline-review-thread lookup before this update returned no threads for this PR. The original checklist remains unclaimed rather than inventing resolved conversations.