From 2ccf69ceaca41333ca3d7f17f5fef690bb587b60 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 12 Nov 2026 13:43:35 +0100 Subject: [PATCH] fix: the chat beside a note raises notifications and loses input requests (#34159) With a note open and its chat beside it, every finished answer in that chat also popped up as a notification, and a tool's request for input there was cancelled at once by the main chat, which stays loaded behind the note. The chat beside a note is now listed among the chats open beside the main chat, as a side chat already is, so its answers no longer pop up and its input requests stay with it. A chat left by picking another one, beside a note or in a side chat, comes off that list again. Fixes #34153 Fixes #34154 --- src/lib/components/chat/Chat.svelte | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index feae8b6c0a..7ced4b2c4f 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1644,7 +1644,16 @@ }); }; $: syncChatRoom($socket, $chatId, $temporaryChatEnabled); - $: if (side && $chatId) openSideChatIds.update((ids) => new Set([...ids, $chatId])); + let openSideChatId: string = ''; + $: if (embedded && $chatId !== openSideChatId) { + openSideChatIds.update((ids) => { + const next = new Set(ids); + next.delete(openSideChatId); + if ($chatId) next.add($chatId); + return next; + }); + openSideChatId = $chatId; + } const chatEventHandler = async (event, cb) => { if (isTemporaryChatId(event.chat_id) && event.chat_id !== $chatId) return; @@ -2222,7 +2231,7 @@ if (joinedChatId && $socket?.connected) $socket.emit('events:chat', { chat_id: joinedChatId, data: { type: 'leave' } }); joinedChatId = ''; - if (side && $chatId) { + if (embedded && $chatId) { if ($temporaryChatEnabled) stopTasksByChatId(localStorage.token, $chatId).catch(console.error); openSideChatIds.update((ids) => {