Skip to content

feat: search commands and settings from the main Companion screen - #1916

Merged
karkarl merged 8 commits into
mainfrom
bkudiess-split-main-command-search
Oct 29, 2026
Merged

karkarl merged 8 commits into
mainfrom
bkudiess-split-main-command-search

Conversation

@bkudiess

@bkudiess bkudiess commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: the main Companion screen has no search for commands and settings, so users must open Settings first to reach them.

User Impact

User impact: users can open a search flyout from the main sidebar (button, Ctrl+E or Ctrl+K) and run the same commands Settings search offers, without leaving the current page, conversation or draft. Ctrl+E and Ctrl+K now work on every page; Ctrl+F stays a Settings-only alias and is not taken from Chat content.

Why This Change Was Made

Main and Settings search now share one HubCommandExecutor over the existing HubCommandCatalog. Toggle commands raise SettingsSaved only after the setting persists, so a failed write no longer looks like a save. The flyout opens in place and does not navigate. Ownership is recorded in docs/ARCHITECTURE.md.

Layer 4 of the split Native application shell work; rebased onto main after #1911 (feat: keep Settings and Chat in one Companion window) merged.

Evidence

  • Build, Shared and Tray suites pass on this head (below).
  • New behavioral tests cover persist plus callback once, no-settings, apply failure surfaced, and navigate/dashboard commands never saving; source guards cover the single owner and shortcut routing.
  • Two existing guards (WorkspaceNavigationTests, one in PermissionSettingsWriterRoutingTests) were updated to the merged contract: Ctrl+E is global, Ctrl+F remains Settings-only.
  • Bounded independent rubber-duck review of origin/main..HEAD: no findings. Refreshed dual-model review (Claude Opus 5.5 and GPT-6 Astra, high effort) of the L4 delta at 8820608e: both reported no findings. Codex login was not used.
  • Hanselman dual review of head 6c2124e6 (Claude Opus 5.5 and GPT-6 Astra long context, high effort): no critical or high findings. Both flagged the native test's unguarded SendKeys and missing focus assertions; Opus alone flagged fixed-delay negative checks, OpenCommandCenter no longer waiting for load/modal, and an uncaught SettingsSaved callback exception. All were fixed in d8faefbe: foreground-process and modifier guard before every key send, composer-focus assertion after Escape, ordered probe keys instead of delays, load/modal guard in OpenCommandCenter, and callback exception containment with a unit test. Rounds 2 and 3 (same models, same effort; deltas 6c2124e6..d8faefbe and d8faefbe..ab24fceb) found no critical or high issues. They led to ab24fceb (one pending-request flag for search raised before load or while a dialog is open, full exception logged for SettingsSaved, Windows-key guard, Back-focus assertion in the native routing test) and c3bf1087 (both models flagged that a search deferred behind a dialog could run before the deferred navigation and be lost; the retry now waits two dispatcher hops and Settings search waits for Settings to load). Round 4 on ab24fceb..c3bf1087: Astra found nothing; Opus found only low items, not fixed: reading the _settings field instead of a captured view in the Loaded handler, a narrow gap before the navigation drain, and unverified flyout placement after a layout change. Not fixed and not proven: whether Back restores composer focus (disputed between models). The Back-focus assertion later ran natively on c3bf1087 and passed, which resolves that dispute for the tested path. Search deferral and ordering are covered by source guards and static review only.

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: search button, shortcuts, Escape/focus return and collapsed-sidebar behavior need current-head visual proof in the isolated WinUI app. Native fixture-backed proof below was run locally; the pool's No inventory-bound evidence summary exists or is applicable: the inventory's only proof-test recipe for this pool is run-accessibility-scan (Category=Accessibility, winui-accessibility), which this change did not run, and exercise-changed-ui is a manual command. The MainSearch_ filter is an unbound ad hoc run, which docs/PROOF_POOLS.md states receives test-result validation but no evidence summary, so validate-proof-evidence.ps1 has nothing to validate and none was fabricated. validate-proof-pools.ps1 passed via ./build.ps1.

Validation

Run on head 8820608e (isolated tray profile dirs, E2E opt-ins unset):

  • ./build.ps1: all 5 projects built; docs validation passed (68 files).
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 4803 passed, 25 skipped, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 4763 passed, 0 failed (includes PermissionSettingsWriterRoutingTests and WorkspaceNavigationTests).
  • dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj --filter MainSearch_ (isolated fixture app, own temp profile, synthetic data): 4 passed, 0 failed (see Real Behavior Proof).
  • Head c3bf1087 (tree fcd2a056fca89aa18b82e311bb8ef609c662a3f7): ./build.ps1 passed, Shared 4803 passed (25 skipped), Tray 4763 passed and the UI test project builds, all run on the working tree committed as that head. The 4 native MainSearch_ tests were then run on that same head (see PR head or commit tested).
  • Source association: the results above were run on the working tree whose content is exactly the committed head c3bf1087; they were not re-invoked from a separate clean checkout. Earlier 8820608e and d8faefbe runs are superseded.

Real Behavior Proof

  • PR head or commit tested: the 4 MainSearch_ native tests ran on head c3bf1087 (tree fcd2a056fca89aa18b82e311bb8ef609c662a3f7, clean worktree) and passed (4 passed, 38 s), including the Back-focus assertion (composer focus restored by Back with no SetFocus). An earlier attempt on the same head failed once on MainSearch_UnmatchedQuery... because stray keystrokes reached the composer and search box while Windows declined foreground activation (see its failure.png); the immediate rerun passed 4 of 4. App under test: Debug OpenClaw.Tray.WinUI.exe built from these sources, SHA256 671265758D041F4748A213637070E39DF14D5F699454892DB272C9F8B8F00464, own isolated fixture profile and synthetic Gateway only. The screenshots below were regenerated by this run and inspected.
  • Evidence after fix: 4 passed, 0 failed, 0 skipped.
    • Button, Ctrl+K and Ctrl+E open the flyout with focus; Escape closes it and the composer keeps identity and draft; Ctrl+F in Chat does not open search (Ctrl+K sent afterward proves the key path was live).
    • Collapsed sidebar: Ctrl+K opens the flyout; "Settings" + Enter routes to Settings; Alt+Left returns to Chat with the same composer and draft.
    • Inside Settings, Ctrl+F and Ctrl+K open the Settings search flyout only (no main search flyout), and Escape closes it.
    • Unmatched query: typed text is verified, Enter is a silent no-op (flyout stays open, no navigation), and a following valid query in the same flyout still routes and Back keeps the draft.
  • Observed result (all inspected, synthetic fixture data only):

Main search open
Collapsed sidebar
Routed to Settings
Ctrl+F inside Settings opens the Settings search
Unmatched query stays open

  • Screenshot or artifact links verified? Yes (uploaded to this PR; rendered links checked after upload).
  • Review: rubber-duck, Claude Opus 5.5 high and GPT-6 Astra high found no source issues. Test delta reviewed twice by an independent code-review agent; the vacuous Ctrl+F check and the unmatched-query race were fixed.
  • Not verified or blocked: there is no visible error feedback for an unmatched query (the product silently ignores it, so no error UI exists to prove); missing-setting and write-failure feedback is covered by unit tests only; real Gateway pairing; the tests use synthetic input and brief foreground focus on a shared desktop. CI is pending.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? No
  • New or changed network calls? No
  • Command or tool execution surface changed? No
  • Data access scope changed? No
  • If any answer is Yes, explain the risk and mitigation: N/A. Setting toggles reuse the existing permission writers.

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? No
  • Migration needed? 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.

bkudiess and others added 3 commits October 29, 2026 12:57
…dExecutor

Adds the sidebar search button and native flyout in WorkspaceWindow, backed by the same HubCommandCatalog as Settings. A shared HubCommandExecutor runs Navigate, OpenDashboard and ToggleSetting for both surfaces and reports SettingsSaved only after a successful toggle persist. Ctrl+E/Ctrl+K open the visible surface's search without changing page or draft.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 29, 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. 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: 👀 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 Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

Adds main-screen command search and shares command execution with Settings search.

Example: Press Ctrl+K in Chat with the draft “Keep this draft through main search”.

  • Before: Search navigates to Settings before opening.
  • After: Search opens over Chat; selecting Settings and returning preserves the conversation and draft.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused, and demonstrated through the native app, with no actionable correctness finding and limited runtime coverage of deferred opening.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Current-head screenshots and the recorded four native cases exercise the actual WinUI executable with an isolated synthetic Gateway, demonstrating main search, collapsed-sidebar placement, Settings routing, shortcut separation, unmatched input, and retained draft/focus; modal/load ordering and failure paths retain only static or unit coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Users must leave Chat for Settings before searching commands and settings.
Reason: The maintainer-authored direction improves command access while preserving the current conversation and reusing established command owners.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR adds useful main-screen search that current main does not provide, and no concrete introduced defect was found.

Priority: P2
Reviewed head: c3bf108727cb1bc6097a73e94308c21cdb1590e0

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Search requested before load or behind a modal with deferred navigation remains covered by source guards and static review rather than a native scenario.
Agent review details

How this fits together

The native Companion shell turns sidebar and keyboard input into catalog searches, then routes selected commands through existing navigation, dashboard, and settings owners.

flowchart TD
  A[Sidebar or keyboard] --> B[Visible search flyout]
  B --> C[HubCommandCatalog]
  C --> D[HubCommandExecutor]
  D --> E[Workspace navigation]
  D --> F[Dashboard command]
  D --> G[Existing settings store]
Loading

Technical review

Best possible solution:

Land the shared-catalog main search while preserving existing navigation, permission writers, and retained Chat state.

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

This is a feature request; current-main source confirms that opening search from Chat first navigates to Settings.

Is this the best way to solve the issue?

The change uses the existing catalog, removes duplicate execution logic, and keeps flyout mechanics in the native views, making it a focused implementation of the authorized feature.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared command execution and permission persistence keeps the original intent (refactor(tray): extract Hub and tray presentation models #1082: Centralize command metadata and search semantics while preserving navigation, actions, and existing permission ownership.)
  • Search routing from the shared Companion window changes intended behavior with a stated reason (4e31031: Retain Chat and Settings in one window with one history; main-screen search was explicitly outside that earlier change.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Barbara Kudiess: Raw commit 4e31031 adds src/OpenClaw.Tray.WinUI/Windows/WorkspaceWindow.xaml.cs:340 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4e31031108c8; files: src/OpenClaw.Tray.WinUI/Windows/WorkspaceWindow.xaml.cs)
  • Karen: Raw commit 3a58bf3 adds src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs:1014 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/Windows/HubWindow.xaml.cs)
  • Pedro Larroy: Raw commit 791574d adds src/OpenClaw.Tray.WinUI/Windows/WorkspaceWindow.xaml.cs:70 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 791574ddf557; files: src/OpenClaw.Tray.WinUI/Windows/WorkspaceWindow.xaml.cs)

Review metrics

Metric Value Why it matters
Introduced code Production +296/-112; tests and test project +340/-9; documentation +1 Growth adds the main flyout and distinct native input coverage while removing duplicated command execution.

Labels

Label changes:

  • 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.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: Useful navigation improvement with limited scope and an existing Settings-search 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.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Optionally add a native case that requests search and navigation behind a ContentDialog, then verifies search opens on the resulting visible surface.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-29T17:43:19.804Z sha 8820608 :: needs maintainer review before merge. :: none

Reviewed October 29, 2026, 4:42 PM ET / 20:42 UTC (Revision 2).

bkudiess and others added 4 commits October 29, 2026 14:06
Defer OpenCommandCenter until loaded and skip while a modal is open, contain SettingsSaved callback failures in HubCommandExecutor, and make native search proof guard foreground ownership and use ordered probe keys instead of fixed delays.

Co-authored-by: Copilot App <[email protected]>
Coalesce pending OpenCommandCenter requests, retain a request made while a dialog is open until it closes, log the full SettingsSaved failure, add Windows keys to the native input guard, and assert composer focus after Back.

Co-authored-by: Copilot App <[email protected]>
@bkudiess

Copy link
Copy Markdown
Collaborator Author

Hanselman dual-model review (Claude Opus 5.5 + GPT-6 Astra, long context, high effort)

Round Delta reviewed Result Outcome
1 8820608e..6c2124e6 No critical or high Fixed in d8faefbe: load/modal guard in OpenCommandCenter, SettingsSaved exception containment, native-test input guards, ordered probe keys, composer-focus assertion
2 6c2124e6..d8faefbe No critical or high; 1 medium (both), 5 low Fixed in ab24fceb: single pending-request flag, full exception logged, Windows-key guard, Back-focus assertion
3 d8faefbe..ab24fceb No critical or high; 1 medium (both): deferred search could run before deferred navigation and be lost Fixed in c3bf1087: retry waits two dispatcher hops; Settings search waits for load
4 ab24fceb..c3bf1087 Astra: none. Opus: 3 low Not fixed (see below)

Open, not fixed: Opus low items (Settings Loaded handler reads _settings instead of a captured view; narrow gap before the navigation drain; unverified flyout placement after a layout change).

Not proven: whether Back restores composer focus is disputed between the models. The new Back-focus assertion has not been run natively. Native MainSearch_ tests and screenshots were last run on d8faefbe. Search deferral and ordering are covered by source guards and static review only.

Validation on head c3bf1087 (tree fcd2a056): ./build.ps1 passed, Shared 4803 passed (25 skipped), Tray 4763 passed, UI test project builds. CI is pending.

@bkudiess
bkudiess marked this pull request as ready for review October 29, 2026 20:32
@bkudiess

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Current head c3bf1087 now has native fixture proof (4/4 MainSearch_ tests plus 5 inspected screenshots, see the PR body under Real behavior proof) and the Hanselman rounds 1-4 results above.

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 29, 2026
@karkarl
karkarl merged commit c9d11df into main Oct 29, 2026
55 of 57 checks passed
@karkarl
karkarl deleted the bkudiess-split-main-command-search branch October 29, 2026 21:41
larroy pushed a commit to larroy/openclaw-windows-node that referenced this pull request Oct 30, 2026
…enclaw#1916)

* feat(workspace): add main-screen command search with shared HubCommandExecutor

Adds the sidebar search button and native flyout in WorkspaceWindow, backed by the same HubCommandCatalog as Settings. A shared HubCommandExecutor runs Navigate, OpenDashboard and ToggleSetting for both surfaces and reports SettingsSaved only after a successful toggle persist. Ctrl+E/Ctrl+K open the visible surface's search without changing page or draft.

Co-authored-by: Copilot App <[email protected]>

* fix(tests): restore line layout of HubCommandExecutor compile include

Co-authored-by: Copilot App <[email protected]>

* fix(workspace): keep main search aliases aligned with merged Settings shortcuts

Co-authored-by: Copilot App <[email protected]>

* test(ui): prove main search shortcuts, focus, collapsed sidebar and Settings routing

Co-authored-by: Copilot App <[email protected]>

* test(ui): prove Settings Ctrl+F/K and unmatched main search natively

Co-authored-by: Copilot App <[email protected]>

* fix(search): harden main search review findings

Defer OpenCommandCenter until loaded and skip while a modal is open, contain SettingsSaved callback failures in HubCommandExecutor, and make native search proof guard foreground ownership and use ordered probe keys instead of fixed delays.

Co-authored-by: Copilot App <[email protected]>

* fix(search): resolve second review findings

Coalesce pending OpenCommandCenter requests, retain a request made while a dialog is open until it closes, log the full SettingsSaved failure, add Windows keys to the native input guard, and assert composer focus after Back.

Co-authored-by: Copilot App <[email protected]>

* fix(search): order deferred search after navigation drain

Co-authored-by: Copilot App <[email protected]>

---------

Co-authored-by: Copilot App <[email protected]>
@bkudiess bkudiess mentioned this pull request Oct 30, 2026
5 of 16 tasks
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: 📸 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.

2 participants