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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user