diff --git a/web/frontend/src/components/chat/chat-page.tsx b/web/frontend/src/components/chat/chat-page.tsx index a75e3e260..f55128fd4 100644 --- a/web/frontend/src/components/chat/chat-page.tsx +++ b/web/frontend/src/components/chat/chat-page.tsx @@ -1,4 +1,4 @@ -import { IconPlus } from "@tabler/icons-react" +import { IconArrowDown, IconPlus } from "@tabler/icons-react" import { useAtom } from "jotai" import { type ChangeEvent, useRef, useState } from "react" import { useTranslation } from "react-i18next" @@ -178,11 +178,17 @@ export function ChatPage() { const hasStreamingMessage = streamingEnabled && messages.some((message) => message.role === "assistant" && message.streaming) - const { scrollRef, hasScrolled, handleScroll, handleManualScrollIntent } = - useChatAutoScroll({ - deps: [messages, isTyping], - streaming: hasStreamingMessage, - }) + const { + scrollRef, + isAtBottom, + hasScrolled, + handleScroll, + handleManualScrollIntent, + scrollToBottom, + } = useChatAutoScroll({ + deps: [messages, isTyping], + streaming: hasStreamingMessage, + }) const handleSend = () => { if ((!input.trim() && attachments.length === 0) || !canInput) return @@ -259,7 +265,7 @@ export function ChatPage() { canInput && (Boolean(input.trim()) || attachments.length > 0) return ( -