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