From 9879306ccc4eafb32ad8e02ac7396b912e2672c9 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Mon, 13 Jul 2026 22:39:28 +0200 Subject: [PATCH] docs(chat): tighten ActiveChatStreamRunner comment to intent --- .../chat/active-chat-stream-runner.tsx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/surfsense_web/components/chat/active-chat-stream-runner.tsx b/surfsense_web/components/chat/active-chat-stream-runner.tsx index da86c0aa8..dd27922a0 100644 --- a/surfsense_web/components/chat/active-chat-stream-runner.tsx +++ b/surfsense_web/components/chat/active-chat-stream-runner.tsx @@ -4,19 +4,13 @@ import { useEffect } from "react"; import { chatStreamStore } from "@/lib/chat/stream-engine/store"; /** - * Persistent, render-null host for app-wide chat-stream lifecycle. + * Persistent, render-null host that scopes the in-flight chat turn's lifetime + * to the workspace shell, not the chat page. * - * Mounted in the workspace shell (``LayoutDataProvider``), it persists across - * in-app navigation between workspace routes (``/new-chat`` -> ``/chats`` -> - * ``/automations`` and doc-tab switches) and only unmounts on real teardown - * (workspace change / app teardown). On that teardown it aborts the single - * in-flight turn — this replaces the old chat-page unmount abort, which was - * what killed streams on ordinary navigation. - * - * NOTE: the ``hitl-decision`` bridge and ``useChatSessionStateSync`` stay in - * the chat page: both need the currently-viewed thread id (HITL resume can - * only be triggered from the page's approval UI), which the shell-level runner - * does not cleanly have. + * 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. */ export function ActiveChatStreamRunner() { useEffect(() => {