From b9e9857b1c5a818d699c4996548b2100a84d8f4e Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 25 Nov 2026 00:28:33 +0100 Subject: [PATCH] fix: opening a message from Search drops it from the address (#35000) Opening a search result jumps to the matching message, but the address dropped the message right away. A reload or a copied address then opened the chat at its latest message instead. The address now keeps the message the chat was opened at, so a reload lands on it again. Fixes #34502 --- src/lib/components/chat/Tabs.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/components/chat/Tabs.svelte b/src/lib/components/chat/Tabs.svelte index 1d6f37cff5..1a81bebab1 100644 --- a/src/lib/components/chat/Tabs.svelte +++ b/src/lib/components/chat/Tabs.svelte @@ -1975,6 +1975,9 @@ if ($temporaryChat !== ($settings?.temporaryChatByDefault ?? false)) url.searchParams.set('temporary-chat', String($temporaryChat)); else if (url.searchParams.has('temporary-chat')) url.searchParams.delete('temporary-chat'); + } else if (active?.id === mainChatTabId && url.pathname === get(page).url.pathname) { + // Keep the query, such as ?message=, so a reload lands there again. + url.search = get(page).url.search; } if (url.origin === location.origin && url.href !== location.href) { // Reflect selection without routing through SvelteKit and remounting the workspace.