From bbccff89c1cf318c21cd9eeb4228f98882a33736 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 15 Oct 2026 21:26:27 +0400 Subject: [PATCH] refac --- src/lib/components/chat/Messages/Message.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Messages/Message.svelte b/src/lib/components/chat/Messages/Message.svelte index a35b314be3..4ee20362d9 100644 --- a/src/lib/components/chat/Messages/Message.svelte +++ b/src/lib/components/chat/Messages/Message.svelte @@ -50,6 +50,10 @@ export let topPadding = false; export let onInsertToNote: ((content: string) => void) | null = null; + // Keep the latest turn's real height when assigning a chat ID remounts the message list. + $: isCurrentTurn = + messageId === history.currentId || messageId === history.messages[history.currentId]?.parentId; + // WebKit's content-visibility implementation has paint bugs that leave // on-screen messages blank (#26712), so skip virtualization there // iOS WebViews and home screen apps carry no Safari token, hence the vendor check @@ -63,7 +67,7 @@ class="flex flex-col justify-between px-3.5 mb-3 w-full {($settings?.widescreenMode ?? null) ? 'max-w-full' : 'max-w-[58rem]'} mx-auto rounded-lg group message-listitem" - class:message-virtualized={!isWebKit} + class:message-virtualized={!isWebKit && !isCurrentTurn} > {#if history.messages[messageId]} {#if history.messages[messageId].role === 'user'}