From f0970bbe9c16e4677e0da6c900e5e86b1764569f Mon Sep 17 00:00:00 2001 From: Hotakus Date: Mon, 29 Jun 2026 14:32:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(subagent):=20=E6=8E=92=E5=BA=8F=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=90=8E=E5=B0=86=20persistScroll=20=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F=E5=88=B0=E4=B8=8B=E4=B8=80=E5=B8=A7=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=B9=B2=E6=89=B0=E7=82=B9=E5=87=BB=E7=BF=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 80bab3a..e689322 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1068,7 +1068,9 @@ function SubAgentPanel(props: { const m = untrack(() => max()) const target = props.sortOrder() === "desc" ? 0 : Math.max(0, total - m) setScrollOffset(target) - try { persistScroll(props.sessionId, target) } catch {} + setTimeout(() => { + try { persistScroll(props.sessionId, target) } catch {} + }, 0) }) // When new entries arrive while viewing the newest end, keep the view at newest @@ -1088,7 +1090,9 @@ function SubAgentPanel(props: { if (wasAtNewest) { const target = props.sortOrder() === "desc" ? 0 : Math.max(0, total - m) setScrollOffset(target) - try { persistScroll(props.sessionId, target) } catch {} + setTimeout(() => { + try { persistScroll(props.sessionId, target) } catch {} + }, 0) } })