Skip to content

Chat: surface the full / command catalog, grouped by Mac buckets with styled rows - #893

Merged
shanselman merged 3 commits into
openclaw:mainfrom
bkudiess:bkudiess-chat-run-controls
Jun 30, 2026
Merged

Chat: surface the full / command catalog, grouped by Mac buckets with styled rows#893
shanselman merged 3 commits into
openclaw:mainfrom
bkudiess:bkudiess-chat-run-controls

Conversation

@bkudiess

@bkudiess bkudiess commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Problem: The Windows chat / slash palette (added in Chat: inline /-triggered gateway command catalog menu (Mac parity) #890) showed a flat, alphabetically-ordered list capped at 8 items, so most of the gateway command catalog was hidden — late-alphabet run options (/verbose, /reasoning, /trace, /usage) and many other commands were simply truncated off — and there were no category subheadings, diverging from Mac's grouped menu.
  • Why it matters: Mac parity for discovering session/run controls via /. With only 8 of N commands ever visible, most commands (incl. the run options) were effectively unreachable from the palette unless you already knew their exact name.
  • What changed:
    • Surface the full command catalog — removed the 8-item cap, so every command the gateway advertises is now reachable in the palette (it scrolls), instead of just the top 8 matches.
    • Group by Mac buckets — commands render under Mac's Session / Model / Tools / Agents subheadings (uppercase) with Mac-style rows (icon · /name · [args] · right-aligned description · accent-tinted N options badge). Run options appear under MODEL.
    • Live filter + highlight — the list filters/ranks as you type and the matched substring is highlighted (soft accent tint + white text) in the name and description.
    • Selection & navigation — the default Enter/Tab target is the global best match across buckets, and the keyboard-selected row auto-scrolls into view.
    • Polish — the flyout background matches the composer textbox (opaque), and the flyout hides entirely when nothing matches.
    • No-match keyboard fallback — when the catalog is loaded and no query matches, the hidden flyout no longer traps Tab/Escape/arrows/Enter; it behaves like ordinary composer text.
  • User impact: Typing / now reveals the whole command catalog in a grouped, scrollable, Mac-faithful menu (previously you saw at most 8 rows). Run options live under MODEL; the list narrows/ranks/highlights as you type with the strongest match kept as the default Enter target.
  • What did NOT change (scope boundary): This does not author any new command definitions — all commands come from the gateway commands.list catalog; the PR only changes how they are surfaced/grouped/selected. No custom "Run options" (•••) menu (Mac has none) and no sessions.patch UI plumbing. The arg-choice picker and loading-state Enter/Tab/Escape behavior from Chat: inline /-triggered gateway command catalog menu (Mac parity) #890 are unchanged; loaded no-match text now falls through as ordinary composer input.

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

Validation

After code changes, on Windows ARM64 (OPENCLAW_REPO_ROOT set to the worktree):

  • ./build.ps1 — ✅ all 5 projects built (Shared, Cli, WinNodeCli, SetupEngine, WinUI)
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore — ✅ Passed: 2683, Failed: 0, Skipped: 31
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore — ✅ Passed: 1444, Failed: 0

New focused tests in CommandCatalogPresentationTests.cs cover the Mac 4-bucket mapping (Bucket), bucket ordering (GroupBy with DisplayOrder), labels, within-group relevance preservation, and the global-best default selection across buckets (GroupForPalette / GroupedPalette.DefaultSelectionIndex, incl. a cross-bucket regression test). AppRefactorContractTests.ChatSlashPalette_HiddenNoMatchStateDoesNotTrapKeys covers the follow-up no-match key-trapping regression.

Real behavior proof

  • Environment tested: Windows ARM64, non-isolated local run (./run-app-local.ps1 -NoBuild -AllowNonMain), connected to a gateway exposing the commands.list catalog.
  • PR head / commit tested: 824774ca
  • Exact steps or command run:
    1. Open Chat, type / — observe the grouped palette.
    2. Arrow-navigate (↑/↓) through the groups past the visible fold (selected row scrolls into view).
    3. Type /reas — observe live filtering down to /reasoning under MODEL, with the matched reas highlighted.
    4. Type a non-matching token (e.g. /zzz) — the flyout hides.
  • Observed result: Palette renders uppercase SESSION / MODEL / TOOLS / AGENTS subheadings; run options (/verbose, /reasoning, /exec, /think, …) appear under MODEL; each row shows icon · /name · [args] · right-aligned description · "N options" badge; the matched substring is highlighted (soft tint + white text); the list filters and re-ranks as you type; the default Enter target is the global best match across buckets; the flyout background matches the textbox and hides on no match. The follow-up fix limits zero-selectable key trapping to the visible loading state so loaded hidden no-match input falls through as ordinary composer text.
  • Screenshot/artifact links verified? Yes
image
  • Not verified / blocked: N/A

Rubber-duck review: dual review (GPT-5.5 + Claude Opus 4.8) — no blocking issues; consensus should-fixes addressed (removed the item cap so no bucket is silently dropped, preserved within-group relevance, NormalizeKey prefers the text-surface Name, defensive accent-brush cast).
ClawSweeper/Codex review: P2 selection-order finding addressed — keyboard selection now pins the global best Search match across grouped buckets (via GroupForPalette / GroupedPalette.DefaultSelectionIndex) with a cross-bucket regression test. Follow-up no-match key-trapping finding addressed in 824774ca. Re-validated green.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No (this is presentation/ordering only over the existing commands.list catalog; no new command is invoked)
  • Data access scope changed? No

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

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.

Enhance the inline "/" slash command palette (added in openclaw#890) so it matches
Mac's grouped, styled command menu:

- Group commands under Mac's Session / Model / Tools / Agents display
  buckets with uppercase category subheadings; the run options
  (verbose/reasoning/fast/trace/usage/elevated/exec/think/model) surface
  under "Model" instead of being truncated off a flat alphabetical list.
- Mac-style rows: icon, /name (bold, default font), [args] hint (mono,
  muted), right-aligned description, and an accent-tinted "N options" badge.
- The palette filters and ranks live as you type; relevance order is
  preserved within each group so the top match stays the default Enter
  target.
- Auto-scroll the keyboard-selected row into view during arrow navigation.

Bucket mapping mirrors Mac's mapCategory + CATEGORY_OVERRIDES; ordering
mirrors CATEGORY_ORDER. No item cap (the popup ScrollViewer bounds height,
so no bucket is silently dropped). No custom "Run options" menu (Mac has
none) and no sessions.patch UI plumbing.

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

clawsweeper Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 1:49 PM ET / 17:49 UTC.

Summary
The PR changes the Windows chat slash-command palette to render the full gateway command catalog in grouped, styled rows with global-best keyboard selection, no-match fallthrough, highlighting, and focused tests.

Reproducibility: not applicable. as a PR rather than a standalone bug report. Source inspection confirms current main still has the eight-item command cap, and the latest PR head source-verifiably addresses the earlier no-match key-trapping issue.

Review metrics: 3 noteworthy metrics.

  • Diff scope: 4 files changed, +568/-57. The patch is focused on shared command presentation, the WinUI composer, and two test files.
  • Focused tests added: 171 test lines added. The new tests target bucket mapping, default selection, flattened render order, and no-match key handling.
  • Reported validation: 1 build + 2 test commands reported. The PR body reports the AGENTS-required build, shared tests, and tray tests after the latest head update.

Root-cause cluster
Relationship: canonical
Canonical: #893
Summary: This PR is the active branch for the grouped full-catalog slash palette follow-up; the related merged PR introduced the base slash-command palette and is not a duplicate of the remaining work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • A short desktop recording of no-match fallthrough, default Enter/Tab selection, and auto-scroll would further reduce UI interaction risk.

Mantis proof suggestion
A short desktop proof would materially verify the visible WinUI slash palette and keyboard interactions that screenshots only partially cover. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify the Windows chat slash palette groups the full command catalog, keeps Enter/Tab on the global best match, auto-scrolls selection, and lets no-match input fall through.

Risk before merge

  • [P1] The diff changes chat composer key interception and command insertion selection, so a missed edge case could suppress composer keys or insert the wrong slash command text even though the latest source and tests address the known no-match issue.
  • [P1] The screenshot directly proves the grouped visual state, while keyboard auto-scroll and no-match fallthrough are supported by source inspection, tests, and contributor-reported runtime steps rather than a recording.

Maintainer options:

  1. Land after maintainer UI review (recommended)
    Maintainers can accept the bounded composer-interaction risk because the latest head fixes the known no-match blocker and keeps the change limited to presentation, insertion, and tests over the existing command catalog.
  2. Request a short desktop recording
    Ask for a recording of arrow navigation, auto-scroll, Enter/Tab default selection, and no-match fallthrough if stronger visual interaction proof is required before merge.

Next step before merge

  • [P2] No repair lane is needed because no concrete automation-fixable blocker remains; the next step is ordinary maintainer UI review.

Security
Cleared: The diff is limited to C# UI presentation and tests over the existing commands.list catalog, with no new dependencies, workflows, secrets, permissions, network calls, or automatic command execution.

Review details

Best possible solution:

Land the grouped full-catalog palette after ordinary maintainer UI review if the bounded composer-interaction risk is acceptable.

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

Not applicable as a PR rather than a standalone bug report. Source inspection confirms current main still has the eight-item command cap, and the latest PR head source-verifiably addresses the earlier no-match key-trapping issue.

Is this the best way to solve the issue?

Yes. Extending the shared presentation helper and WinUI composer, with focused tests and no protocol or command execution changes, is a narrow maintainable way to surface the full grouped catalog.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P3: This is a bounded chat UX parity and discoverability improvement with low blast radius.
  • merge-risk: 🚨 message-delivery: The diff changes chat composer slash-key handling and command insertion selection, so regressions could suppress keys or insert the wrong command text.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body reports a Windows ARM64 run at head 824774c and the inspected screenshot directly shows the grouped styled slash palette with highlighted matches; keyboard behavior is additionally covered by source and tests.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports a Windows ARM64 run at head 824774c and the inspected screenshot directly shows the grouped styled slash palette with highlighted matches; keyboard behavior is additionally covered by source and tests.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body reports a Windows ARM64 run at head 824774c and the inspected screenshot directly shows the grouped styled slash palette with highlighted matches; keyboard behavior is additionally covered by source and tests.
Evidence reviewed

What I checked:

  • AGENTS policy applied: AGENTS.md was read fully; its tray/chat UX validation and proof guidance applies to this PR, while this cleanup review remained read-only and did not run build or tests. (AGENTS.md:49, a13d683de90f)
  • Maintainer notes absent: No .agents/maintainer-notes directory exists in this checkout, so there were no matching maintainer notes to apply. (a13d683de90f)
  • Current main still has the reported cap: Current main builds slashResults with Search(...).Take(SlashMenuMaxItems), and SlashMenuMaxItems remains 8, so the central full-catalog grouped behavior is not already implemented on main. (src/OpenClaw.Tray.WinUI/Chat/OpenClawComposer.cs:463, a13d683de90f)
  • PR head groups and flattens the full catalog: The proposed composer code calls GroupForPalette, uses the returned Groups and Flattened commands, and stores DefaultSelectionIndex instead of taking only the first eight Search results. (src/OpenClaw.Tray.WinUI/Chat/OpenClawComposer.cs:469, 824774caea97)
  • Global-best selection is preserved: GroupForPalette computes grouped display rows, the flattened navigation list, and the index of Search(query).FirstOrDefault() within that flattened order so grouping does not change the default Enter/Tab target. (src/OpenClaw.Shared/CommandCatalogPresentation.cs:238, 824774caea97)
  • No-match key trap is addressed: The latest PR head only traps zero-selectable slash keys while AvailableCommands is null; loaded no-match input hides the popup and falls through as ordinary composer text. (src/OpenClaw.Tray.WinUI/Chat/OpenClawComposer.cs:656, 824774caea97)

Likely related people:

  • bkudiess: The current main slash-command palette and shared command presentation helper appear to have been introduced by the merged related slash palette work, and this contributor authored that feature PR. (role: recent feature contributor; confidence: high; commits: a3c5e0bf6fce; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawComposer.cs, src/OpenClaw.Shared/CommandCatalogPresentation.cs, tests/OpenClaw.Shared.Tests/CommandCatalogPresentationTests.cs)
  • shanselman: GitHub PR metadata shows this person merged the related slash palette PR, and the latest PR-head commit under review fixes the no-match key handling path. (role: merger and recent branch repair author; confidence: medium; commits: a3c5e0bf6fce, 824774caea97; files: src/OpenClaw.Tray.WinUI/Chat/OpenClawComposer.cs, tests/OpenClaw.Tray.Tests/AppRefactorContractTests.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 proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Jun 30, 2026
@bkudiess bkudiess changed the title Chat: group the / command palette by Mac buckets with styled rows Chat: group the / command palette by buckets with styled rows Jun 30, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 message-delivery 🚨 Merging this PR could drop, duplicate, misroute, suppress, or wrongly target messages. label Jun 30, 2026
UI polish for the grouped "/" command palette plus the Codex/ClawSweeper
review fix:

- Highlight the matched query substring in the command name + description
  with a soft accent tint and white (primary) text. Uses TextHighlighter
  (rectangular, layout-safe); the alpha is baked into the Color because
  TextHighlighter ignores SolidColorBrush.Opacity.
- Make the slash flyout background opaque, matching the composer textbox
  (TextControlBackground composited over the base surface) instead of a
  lighter floating surface that showed chat content through it.
- Hide the flyout entirely when nothing matches (drop the "No matching
  commands" hint).
- Preserve the GLOBAL best Search match as the default Enter/Tab target
  across grouped buckets. Grouping renders by Mac bucket order, but the weak
  first-bucket row is no longer the default selection; keyboard selection now
  defaults to the top-ranked match via ChatCommandCatalogView.GroupForPalette
  / GroupedPalette.DefaultSelectionIndex (addresses ClawSweeper review at
  OpenClawComposer.cs:474). Adds cross-bucket regression tests.

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

Copy link
Copy Markdown
Collaborator Author

Addressed the P2 selection-order finding in d6a2e1d.

Fix: Keyboard selection no longer derives from display-bucket order. The grouped rendering is unchanged, but the default Enter/Tab target now pins the global best Search match rather than the first visible row. New ChatCommandCatalogView.GroupForPalette returns the groups, the flattened nav list, and GroupedPalette.DefaultSelectionIndex (the index of Search(query).First() in the flattened order). The composer resets the selection to a "not navigated" sentinel on query change and resolves it to that default index, so a strong later-bucket match (e.g. an exact /exec in Model) wins over a weak earlier-bucket contains-match (e.g. Session), matching pre-PR main behavior. Up/Down then make it concrete as before.

Tests (cross-bucket regression): Added to CommandCatalogPresentationTests:

  • GroupForPalette_DefaultSelection_PinsGlobalBestAcrossBuckets — a later-bucket exact match beats an earlier-bucket weak match for the default selection.
  • GroupForPalette_DefaultSelection_IsZeroWhenNoMatches
  • GroupForPalette_FlattenedMatchesGroupedOrder — keeps render index aligned with the nav list.

Validation: ./build.ps1 ✅, Shared.Tests 2683 ✅, Tray.Tests 1443 ✅.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 30, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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. labels Jun 30, 2026
@bkudiess bkudiess changed the title Chat: group the / command palette by buckets with styled rows Chat: surface the full / command catalog, grouped by Mac buckets with styled rows Jun 30, 2026
Only trap composer keys while the slash command catalog is still loading and the loading popup is visible. Once the catalog is loaded with no matching command, let no-match slash input behave like ordinary text.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@clawsweeper clawsweeper Bot added 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 30, 2026
@shanselman
shanselman merged commit 0b8ba41 into openclaw:main Jun 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 message-delivery 🚨 Merging this PR could drop, duplicate, misroute, suppress, or wrongly target messages. 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.

2 participants