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() { ))} +
) }