63babc597a
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.
2.1 KiB
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/nameplus the recorded summary (MaterialListTile, 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 nativeSend as message/Cancelcontrols. OnlySend as messageposts 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.
- an unknown word consumes the draft and shows the web report
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-changedon 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.dartlib/features/chat/conversation/chat_command_palette.dartlib/features/chat/conversation/chat_composer_bar.darttest/features/chat/domain/chat_commands_test.darttest/features/chat/conversation/chat_command_palette_test.dart