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

@@ -58,7 +58,7 @@ export interface UseChatReturn {
deleteSession: (id: string) => Promise<void>;
// Message operations
sendMessage: (content: string) => Promise<void>;
sendMessage: (content: string) => void;
loadMoreMessages: () => Promise<void>;
hasMoreMessages: boolean;
@@ -291,7 +291,7 @@ export function useChat(projectId?: string): UseChatReturn {
// Send a message
const sendMessage = useCallback(
async (content: string) => {
(content: string) => {
if (!activeSession) return;
// Close any existing stream