fix(FN-2904): preserve quick chat streaming state on resume
- Keep active streaming responses alive when resuming an existing quick chat session instead of resetting stream state - Update useQuickChat session-resume logic to only restart waiting indicators when appropriate - Adjust QuickChatFAB waiting indicator behavior so it reflects real in-flight assistant activity - Add focused hook and component tests covering same-session resume and waiting-indicator regressions Fusion-Task-Id: FN-2904
This commit is contained in:
@@ -277,19 +277,23 @@ export function useQuickChat(
|
||||
const targetSessionKey = buildSessionKey(target.agentId, target.modelProvider, target.modelId);
|
||||
currentSessionTargetRef.current = target;
|
||||
|
||||
// Close any existing stream
|
||||
if (streamRef.current) {
|
||||
streamRef.current.close();
|
||||
streamRef.current = null;
|
||||
const isSameSession = targetSessionKey === currentSessionKeyRef.current && activeSession;
|
||||
|
||||
if (!isSameSession) {
|
||||
// Close any existing stream
|
||||
if (streamRef.current) {
|
||||
streamRef.current.close();
|
||||
streamRef.current = null;
|
||||
}
|
||||
|
||||
// Reset streaming state
|
||||
setStreamingText("");
|
||||
setStreamingThinking("");
|
||||
setStreamingToolCalls([]);
|
||||
setIsStreaming(false);
|
||||
}
|
||||
|
||||
// Reset streaming state
|
||||
setStreamingText("");
|
||||
setStreamingThinking("");
|
||||
setStreamingToolCalls([]);
|
||||
setIsStreaming(false);
|
||||
|
||||
if (targetSessionKey === currentSessionKeyRef.current && activeSession) {
|
||||
if (isSameSession) {
|
||||
// Same chat target — just reload messages from server
|
||||
await reloadMessages();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user