From efe63bd34a4abc929112e8c001c9f480116f4001 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Sun, 27 Sep 2026 15:15:24 -0400 Subject: [PATCH] fix: clamp the artifacts pane's version when an artifact is removed (#30435) --- src/lib/components/chat/Artifacts.svelte | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/components/chat/Artifacts.svelte b/src/lib/components/chat/Artifacts.svelte index 943c6d6a7a..d0a6e195ee 100644 --- a/src/lib/components/chat/Artifacts.svelte +++ b/src/lib/components/chat/Artifacts.svelte @@ -109,6 +109,8 @@ selectedContentIdx = 0; } else if (newContents.length > contents.length) { selectedContentIdx = newContents.length - 1; + } else if (selectedContentIdx > newContents.length - 1) { + selectedContentIdx = newContents.length - 1; } contents = newContents;