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.
This commit is contained in:
Classic298 2026-09-30 19:02:16 +02:00 • committed by GitHub
parent 7e317fbada
commit f453324997
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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