FN-5852: persist queued chat messages across navigation
Keep queued follow-up chat drafts across session switches, reloads, and view re-entry. - persist queued pending-message text per chat session in shared localStorage helpers - restore and flush queued follow-up messages in full Chat when returning to an active session - restore and flush queued follow-up messages in Quick Chat and cover the recovery path with tests - document queued-message persistence behavior in the dashboard guide Files changed: docs/dashboard-guide.md | 2 + .../dashboard/app/hooks/__tests__/useChat.test.ts | 119 +++++++++++++++++- .../app/hooks/__tests__/useQuickChat.test.ts | 135 +++++++++++++++++++++ .../app/hooks/chatPendingMessageStorage.ts | 48 ++++++++ packages/dashboard/app/hooks/useChat.ts | 38 ++++++ packages/dashboard/app/hooks/useQuickChat.ts | 35 ++++++ 6 files changed, 376 insertions(+), 1 deletion(-) Fusion-Task-Id: FN-5852 Fusion-Task-Lineage: 1cddfb19-7e02-40e5-b373-5d593dfcfe2a
This commit is contained in:
@@ -139,6 +139,7 @@ Chat view provides project-scoped conversations with agents.
|
||||
- Full Chat and Quick Chat both consume the same streamed `/api/chat/sessions/:id/messages` response contract, and both now prefer the authoritative assistant `message` snapshot on `done` while still accumulating `text` chunks when present (so providers without incremental text streaming still render output immediately)
|
||||
- In-progress assistant responses now survive refresh/navigation while generation is still active: Chat restores the last durable in-flight text/thinking/tool state immediately, then resumes streaming from the stored replay point instead of starting from an empty "Connecting…" placeholder.
|
||||
- If a regular Chat stream drops with a hidden-tab/browser-suspension error (for example `Load failed`) while the server is still generating, Chat suppresses the false error banner, re-attaches to the in-progress stream using the durable replay state, and reconciles the final assistant reply when generation completes.
|
||||
- If you queue a follow-up user message while the assistant is still streaming, Chat now persists that queued text per session so leaving and returning to the view still restores and sends it once the active response finishes.
|
||||
- Chat message lists now track near-bottom scroll state: while you are reading older messages, live streaming/new replies do not force-scroll; a **Latest** jump control appears until you return to the tail.
|
||||
- On mobile direct-chat threads, entering a thread and restoring Chat after tab/page visibility returns re-anchors to the newest message (`scrollTop = scrollHeight`) so the view always opens at the live tail.
|
||||
- On mobile direct-chat threads, tapping the active title/identity in the thread header opens a lightweight conversation dropdown so you can switch to another direct session without backing out to the sidebar list first; long conversation titles now stay readable in the dropdown via wrapped option text and taller touch-friendly rows.
|
||||
@@ -189,6 +190,7 @@ Quick Chat is an optional floating panel for fast, project-scoped assistant conv
|
||||
- The `+` action opens an inline new-session chooser (inside the panel, not a modal) with `Model` selected by default and optional switch to `Agent`
|
||||
- Submitting the inline chooser uses explicit fresh-session creation and immediately persists/selects the new thread, then refreshes the session dropdown list
|
||||
- On every open, Quick Chat restores the most recently used non-archived session by latest activity (`max(lastMessageAt, updatedAt)`); only when no prior session exists does it fall back to the first agent / configured default model.
|
||||
- Queued follow-up messages entered while a Quick Chat response is still streaming now persist per session, so closing/reopening the panel restores the queued text and flushes it once the active response completes.
|
||||
- Resume lookups still use targeted session queries instead of loading the full active-session list first
|
||||
- Tool-call summaries in the floating quick-chat panel are intentionally condensed into a single-line header row (especially on small screens) so tool name + status stay scannable without multi-line wrapping
|
||||
- On mobile viewports, opening Quick Chat auto-focuses the composer as soon as it is ready so the keyboard opens immediately
|
||||
|
||||
Reference in New Issue
Block a user