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:
Fusion
2026-04-28 19:43:26 -07:00
committed by gsxdsm
parent 946984a5d0
commit b248ffc6e6
4 changed files with 109 additions and 12 deletions

View File

@@ -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;