fix(FN-2011): keep chat input responsive during streaming

- Make useChat and useQuickChat sendMessage synchronous and update consumers to call it without awaiting
- Allow ChatView and QuickChatFAB inputs to remain editable while responses stream
- Keep quick chat send disabled during active streaming to prevent concurrent sends
- Add hook and component tests for synchronous sendMessage and non-blocking input behavior
This commit is contained in:
Fusion
2026-04-17 15:38:32 -07:00
committed by gsxdsm
parent d8f3cb065a
commit da2d9fbcf1
8 changed files with 134 additions and 28 deletions

View File

@@ -42,7 +42,7 @@ export interface UseQuickChatReturn {
streamingThinking: string;
// Operations
sendMessage: (content: string) => Promise<void>;
sendMessage: (content: string) => void;
switchSession: (agentId: string, modelProvider?: string, modelId?: string) => Promise<void>;
startModelChat: (modelProvider: string, modelId: string) => Promise<void>;
loadMessages: () => Promise<void>;
@@ -248,7 +248,7 @@ export function useQuickChat(
// Send a message using SSE streaming
const sendMessage = useCallback(
async (content: string) => {
(content: string) => {
if (!activeSession || !content.trim()) return;
// Close any existing stream