Fix savings chat autoscroll

This commit is contained in:
Matthias
2026-06-16 11:02:00 +02:00
parent 9f17d4d1e1
commit 15bf5d2036
4 changed files with 62 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import {
buildSourcesFromToolTrace,
buildReasoningSteps,
getToolTraceSummary,
scrollConversationToBottom,
} from "./agentChatModel";
const assistantMessage: AgentChatMessage = {
@@ -31,6 +32,17 @@ const assistantMessage: AgentChatMessage = {
};
describe("AgentChat phase 1 components", () => {
test("scrolls the conversation container directly to the bottom", () => {
const container = {
scrollTop: 0,
scrollHeight: 1200,
};
scrollConversationToBottom(container);
expect(container.scrollTop).toBe(1200);
});
test("summarizes tool traces for compact agent transparency", () => {
expect(getToolTraceSummary(undefined)).toBe("Keine Werkzeuge");
expect(getToolTraceSummary([])).toBe("Keine Werkzeuge");