From f45332499743207ad2996f2927f1c2ab77cb37cf Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 30 Sep 2026 19:02:16 +0200 Subject: [PATCH] fix: artifact preview sometimes closes the moment it auto-opens (#31653) When a reply contained an artifact and the preview opened automatically, it could check for artifacts before they had been picked up from that reply, find none and close again. This happens occasionally in normal chats, with or without filters, and is older than 0.11.1. The preview now looks for artifacts again at the moment it opens, so it stays open. It is a separate cause from #31643, found while looking into that issue. --- src/lib/components/chat/Chat.svelte | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index cb9a882d2f..3a36e9ca5c 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -1633,6 +1633,11 @@ } }); + // the artifacts pane reads this list when it opens, which can be before the debounced rebuild + const showArtifactsSubscribe = showArtifacts.subscribe((value) => { + if (value) getContents(); + }); + const selectedFolderSubscribe = selectedFolder.subscribe(async (folder) => { await tick(); // Folder default models apply to new chats only. @@ -1685,6 +1690,7 @@ } pageSubscribe(); showControlsSubscribe(); + showArtifactsSubscribe(); selectedFolderSubscribe(); // Clear the selected chat when leaving the chat surface (e.g. navigating