Files
alan 63babc597a feat(app): offer the chat slash command palette
A leading slash opens the recorded command palette above the composer,
filtered by name prefix and driven by Up/Down, Enter, tap and Escape.

Slash drafts never reach the prompt path: a recorded command reports
locally that its action is not implemented yet, and an unknown word takes
the web client's no-send report with an explicit Send as message offer.
Enter and the primary control share that route.

Adds the chat commands domain vocabulary, the palette widget, composer
wiring and regression tests; notes/C9-commands.md records behaviour and
the remaining command-action gap.
2026-10-22 15:47:46 +01:00

2.1 KiB

C9 — slash command palette and no-send routing

Status: palette and routing landed in the Flutter app; command actions (/new, /close, /rename, /stop, /help) remain unimplemented and are still listed as the remainder in web/PARITY.md.

Behaviour

  • A draft whose first word starts with / opens the recorded palette above the composer. Rows are filtered case-insensitively by name prefix and show /name plus the recorded summary (Material ListTile, Cupertino button on a popup surface; no fixed row height).
  • Up/Down wrap the highlight, and the highlight resets to the first row when the filtered list shrinks (web refreshComposerControls). Enter or a tap completes the highlighted command into the draft.
  • Escape closes the palette until the draft is edited; editing to the same text reopens it because the closure follows the edit, not the text.
  • No slash draft reaches the prompt path. Enter, Ctrl/Cmd+Enter and the primary control all take the command path:
    • an unknown word consumes the draft and shows the web report “{word}” is not a command, so nothing was sent to the agent. Send it as a message, or cancel. with native Send as message / Cancel controls. Only Send as message posts the exact trimmed draft.
    • a recorded command keeps its draft and reports “/name” is not available yet, so nothing was sent to the agent. until the command actions land.

Checks

  • flutter test test/features/chat → 311 passed.
  • flutter analyze → No issues found.
  • flutter build web --release → ✓ Built build/web.
  • dart format --output=none --set-exit-if-changed on the touched files → clean.
  • git diff --check → clean.

Not tested: rendered browser interaction/captures (belongs to the UI review stage), Android/iOS builds or devices, live production chats.

Paths

  • lib/features/chat/domain/chat_commands.dart
  • lib/features/chat/conversation/chat_command_palette.dart
  • lib/features/chat/conversation/chat_composer_bar.dart
  • test/features/chat/domain/chat_commands_test.dart
  • test/features/chat/conversation/chat_command_palette_test.dart