diff --git a/frontend/src/components/chat/ChatWidget.tsx b/frontend/src/components/chat/ChatWidget.tsx index 53fbd9f..5ff4184 100644 --- a/frontend/src/components/chat/ChatWidget.tsx +++ b/frontend/src/components/chat/ChatWidget.tsx @@ -197,9 +197,14 @@ export default function ChatWidget() { const activeConv = getActiveConversation(); const messages = activeConv?.messages ?? []; - // Auto-scroll on new messages + // Auto-scroll on new messages — use direct scrollTop instead of scrollIntoView + // because scrollIntoView walks up the DOM and scrolls ALL ancestors (including + // the panel with overflow:hidden), which pushes the header off-screen. useEffect(() => { - messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' }); + const container = messagesEndRef.current?.parentElement; + if (container) { + container.scrollTo({ top: container.scrollHeight, behavior: 'smooth' }); + } }, [messages.length, streaming]); // Focus input when panel opens