fix(cli): wire command:result + system:reload socket events in TUI #187

Merged
jason.woltje merged 5 commits from fix/tui-command-result-socket into main 2026-03-16 13:21:12 +00:00

5 Commits

Author SHA1 Message Date
70f894f148 fix(cli): sidebar 'd' delete, /new command, Ctrl+C double-press exit
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
- InputBar is now focus-gated: when mode != 'chat', TextInput focus=false
  and useInput isActive=false — sidebar 'd' key no longer leaks into input
- /new added as a local command (execution:'local') so it creates a
  new conversation and switches to it, same as Ctrl+N; alias 'n' moved
  from ALIASES map into the CommandDef
- Ctrl+C behaviour: clear input → show hint → second empty press exits
  (resets if any other key is pressed between the two Ctrl+Cs)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 08:17:05 -05:00
931ae76df1 fix(cli): Ctrl+C clears input, second Ctrl+C exits TUI
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
InputBar is now a controlled component — input state lives in app.tsx.
Ctrl+C when input has text clears it; Ctrl+C with empty input exits,
giving the standard two-press-to-quit behaviour expected in TUIs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 08:12:51 -05:00
1214a4cce7 fix(cli): auto-create conversation on TUI start when no -c flag given
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful
Without --conversation/-c, the TUI was starting with no conversationId,
leaving the session bar showing "No session" and gateway commands
unable to dispatch. Now creates a new conversation via REST before
rendering so the socket is immediately attached to an active session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 08:09:04 -05:00
193d171acb fix(cli): slash command UX — ignore bare /, fix gateway connection check
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
- Submitting bare "/" no longer shows "Unknown command format: /" — input
  is ignored silently so autocomplete can guide discovery instead
- Gateway command handler no longer requires a conversationId before
  emitting — the socket connection check alone is sufficient; missing
  conversationId caused false "Not connected" errors on fresh sessions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 08:07:00 -05:00
31aea56345 fix(cli): wire command:result + system:reload socket events in TUI
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Gateway slash command responses were silently dropped — use-socket.ts
had no handlers for command:result or system:reload. Added both:
- command:result → renders success/error as a system message
- system:reload → updates command registry manifest + shows reload message

Also removes stray @testing-library/react devDependency that was
never used in the CLI package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 08:02:18 -05:00