Taylor Ho 354ac358cc feat: add single-message queue during agent streaming (#112)
* feat: add single-message queue during agent streaming

Enable typing while the agent is responding. When the user sends a
message during streaming, it is held in a one-slot queue and auto-sent
once the current response completes. The send button contextually
replaces the stop button when text is entered; stop only appears on a
truly empty input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: persist queued messages across tab switches

Move message queue state from React local state into the Zustand store
keyed by session ID so queued follow-ups survive navigation between
sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: persist draft input text across tab switches

Store the ChatInput text field value in the Zustand store keyed by
session so typed-but-unsent text survives navigating between sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: persist draft input text to localStorage

Drafts now survive app restarts. Uses the same load-on-init /
persist-on-write pattern as session and project caches. Empty drafts
are pruned from storage automatically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: add useMessageQueue and draft localStorage tests

- useMessageQueue: auto-send on idle, enqueue/dismiss, session scoping,
  image forwarding
- chatStore drafts: localStorage persist/clear/cleanup, cross-session
  isolation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: lazy session creation with empty draft cleanup

Sessions start as local-only drafts and are promoted to backend
sessions on first message send. Empty drafts (no typed text, no
messages) are cleaned up when navigating away. Drafts with typed text
persist across tab switches and app restarts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address PR review comments

- Pass personaId through when auto-sending queued messages so the
  original persona is preserved instead of using the current one
- Persist draft sessions with typed text to localStorage so drafts
  survive app restart (previously filtered out, orphaning draft text)
- Skip empty draft cleanup when reusing the active session to avoid
  deleting the session we're about to activate

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 13:18:23 -10:00
S
Description
No description provided
Apache-2.0 1.5 GiB
Languages
Rust 63.6%
TypeScript 29.6%
JavaScript 1.7%
Shell 1.6%
Python 1.5%
Other 1.8%