From 81618eca547286609fe616f94717557ddf6f858d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Thu, 23 Jul 2026 11:22:39 -0600 Subject: [PATCH] fix[frontend](socai): add assistant chat follow scroll --- .../src/features/home/components/HomeChatTranscript.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/features/home/components/HomeChatTranscript.tsx b/frontend/src/features/home/components/HomeChatTranscript.tsx index 282e1417d..0ea561b3f 100644 --- a/frontend/src/features/home/components/HomeChatTranscript.tsx +++ b/frontend/src/features/home/components/HomeChatTranscript.tsx @@ -1,3 +1,4 @@ +import { useEffect, useRef } from 'react' import { useTranslation } from 'react-i18next' import { Trash2 } from 'lucide-react' import { useSocAi } from '@/features/soc-ai/SocAiProvider' @@ -6,6 +7,13 @@ import { MessageRow } from '@/features/soc-ai/components/MessageRow' export function HomeChatTranscript() { const { t } = useTranslation() const { homeMessages, clear } = useSocAi() + const bottomRef = useRef(null) + + // Stick to bottom: on mount (navigating back with existing messages) and as + // new messages stream in. Works regardless of which ancestor scrolls. + useEffect(() => { + bottomRef.current?.scrollIntoView({ block: 'end' }) + }, [homeMessages]) return (
@@ -24,6 +32,7 @@ export function HomeChatTranscript() { ))} +
) }