From 80a59a0b22f0a21109f1b229c21f390478db1456 Mon Sep 17 00:00:00 2001 From: Hikari Date: Fri, 6 Mar 2026 22:25:31 -0800 Subject: [PATCH] fix: correct autoscroll race conditions and lazy load trigger - Move isRestoringScroll = true before await tick() so scroll events fired during the DOM transition cannot incorrectly set shouldAutoScroll to false, breaking autoscroll for all tabs except the first - Guard the windowStart reactive block with isSwitchingConversation so stale lines from the previous conversation cannot override the correct windowStart after a tab switch - Fix lazy load threshold to trigger relative to the visible window top (windowStart * AVG_LINE_HEIGHT + 300) rather than the absolute scroll container top, so older messages load without scrolling through the spacer --- src/lib/components/Terminal.svelte | 41 ++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/src/lib/components/Terminal.svelte b/src/lib/components/Terminal.svelte index d559ce4..dd47f81 100644 --- a/src/lib/components/Terminal.svelte +++ b/src/lib/components/Terminal.svelte @@ -1,6 +1,7 @@