2026-07-13 22:17:38 +02:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { useEffect } from "react";
|
|
|
|
|
import { chatStreamStore } from "@/lib/chat/stream-engine/store";
|
|
|
|
|
|
|
|
|
|
/**
|
2026-07-13 22:39:28 +02:00
|
|
|
* Persistent, render-null host that scopes the in-flight chat turn's lifetime
|
|
|
|
|
* to the workspace shell, not the chat page.
|
2026-07-13 22:17:38 +02:00
|
|
|
*
|
2026-07-13 22:39:28 +02:00
|
|
|
* Mounted in ``LayoutDataProvider``, it survives in-app navigation between
|
|
|
|
|
* workspace routes and aborts the single active turn only on workspace/app
|
|
|
|
|
* teardown, so ordinary navigation disconnects the view without stopping the
|
|
|
|
|
* stream.
|
2026-07-13 22:17:38 +02:00
|
|
|
*/
|
|
|
|
|
export function ActiveChatStreamRunner() {
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
return () => {
|
|
|
|
|
chatStreamStore.abortActive();
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|