AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(frontend/builder): auto-scroll to bottom when AI responds in chat panel
Zamil Majdy109f28d9d16f
diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderChatPanel/BuilderChatPanel.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderChatPanel/BuilderChatPanel.tsxindex dee945112c..bde9052d51 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderChatPanel/BuilderChatPanel.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/BuilderChatPanel/BuilderChatPanel.tsx@@ -9,7 +9,7 @@ import {StopCircle,X,} from "@phosphor-icons/react";-import { KeyboardEvent, useRef, useState } from "react";+import { KeyboardEvent, useEffect, useRef, useState } from "react";import type { CustomNode } from "../FlowEditor/nodes/CustomNode/CustomNode";import { GraphAction } from "./helpers";import { useBuilderChatPanel } from "./useBuilderChatPanel";@@ -38,6 +38,11 @@ export function BuilderChatPanel({ className, isGraphLoaded }: Props) {const messagesEndRef = useRef<HTMLDivElement>(null);const isStreaming = status === "streaming" || status === "submitted";+ // Scroll to bottom whenever a new message lands (AI response or user send)+ useEffect(() => {+ messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });+ }, [messages.length]);+function handleSend() {const text = inputValue.trim();if (!text || isStreaming) return;