From 00cb73775901ca48dc2122c8f07962fd2d24b69e Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:52:47 +0100 Subject: [PATCH] fix: clicking a cited file in a temporary side chat opens nothing (#34923) In a temporary side chat, clicking a source from a knowledge base did nothing, both on the citation marker in the reply and in the source list. No tab opened beside the chat and no source dialog showed either. The file now opens in a tab beside the chat with the cited passage marked, the same as in a saved side chat or a temporary main chat. Fixes #34921 --- src/lib/components/chat/Tabs.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Tabs.svelte b/src/lib/components/chat/Tabs.svelte index d0d8bf5181..f58234042c 100644 --- a/src/lib/components/chat/Tabs.svelte +++ b/src/lib/components/chat/Tabs.svelte @@ -118,7 +118,7 @@ import ConfirmDialog from '../common/ConfirmDialog.svelte'; let stopTerminalChoice: ((stop: boolean) => void) | null = null; import SplitPanel from '../icons/SplitPanel.svelte'; - import { isSavedChatId } from '$lib/utils/chatId'; + import { isSavedChatId, isTemporaryChatId } from '$lib/utils/chatId'; const i18n = getContext('i18n'); const appLayout = getContext('appLayout'); @@ -1499,9 +1499,17 @@ return source ? `${tab.label} ยท ${source.label}` : tab.label; }; $: showArtifactsTab = $mainArtifacts.length > 0 && $visibleControls['chat.artifacts']; + // A temporary side chat tab keeps no chat id; a citation clicked there comes from the active tab. $: embedSourceTab = $embed?.chatId && $embed.chatId !== chatId - ? tabs.tabs.find((tab) => tab.kind === 'chat' && tab.chatId === $embed.chatId) + ? (tabs.tabs.find((tab) => tab.kind === 'chat' && tab.chatId === $embed.chatId) ?? + ($showEmbeds && + isTemporaryChatId($embed.chatId) && + activeTab?.kind === 'chat' && + activeTab.id !== mainChatTabId && + !activeTab.chatId + ? activeTab + : undefined)) : undefined; $: showPreviewTab = !!$embed && ($embed.chatId === chatId || !!embedSourceTab); $: availableViews = [