From 9f2b52dd7fc4127fe88e5cb939ed6635516f7b8d Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 3 Aug 2026 15:30:10 +0200 Subject: [PATCH] fix assistant streaming scroll lock --- apps/docs/docs/management/assistant.mdx | 2 ++ .../src/components/assistant/assistant-panel.module.css | 5 ----- apps/nextjs/src/components/assistant/assistant-panel.tsx | 8 +++++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/docs/docs/management/assistant.mdx b/apps/docs/docs/management/assistant.mdx index 93db77730..8cd4af4fa 100644 --- a/apps/docs/docs/management/assistant.mdx +++ b/apps/docs/docs/management/assistant.mdx @@ -22,6 +22,8 @@ While a response is running, a compact activity bar appears at the bottom of the avatar shows a thinking indicator. The activity bar can be opened to follow the response. Completed responses add an unread count to the user menu until they are opened or dismissed. The expanded conversation has a minimize action that returns it to the activity bar without interrupting a response. +The transcript follows streamed output while it is already at the bottom, including fast responses. Scrolling +up releases that follow state until **Scroll to latest** is selected or the user returns to the bottom. `Shift + A` opens the compact conversation panel directly. The shortcut is ignored while typing in text fields, selectors, and editable content. diff --git a/apps/nextjs/src/components/assistant/assistant-panel.module.css b/apps/nextjs/src/components/assistant/assistant-panel.module.css index 7a59224f0..4690c2284 100644 --- a/apps/nextjs/src/components/assistant/assistant-panel.module.css +++ b/apps/nextjs/src/components/assistant/assistant-panel.module.css @@ -330,7 +330,6 @@ flex: 1; flex-direction: column; overflow-y: auto; - scroll-behavior: smooth; } .messages { @@ -1313,8 +1312,4 @@ animation: none; transition: none; } - - .viewport { - scroll-behavior: auto; - } } diff --git a/apps/nextjs/src/components/assistant/assistant-panel.tsx b/apps/nextjs/src/components/assistant/assistant-panel.tsx index 1cfb14dd3..886a8dea4 100644 --- a/apps/nextjs/src/components/assistant/assistant-panel.tsx +++ b/apps/nextjs/src/components/assistant/assistant-panel.tsx @@ -53,7 +53,7 @@ import { UnstyledButton, useCombobox, } from "@mantine/core"; -import { useWindowEvent } from "@mantine/hooks"; +import { useReducedMotion, useWindowEvent } from "@mantine/hooks"; import { IconActivityHeartbeat, IconAlertTriangle, @@ -2058,7 +2058,9 @@ export const AssistantConversationSurface = ({ onMinimize, }: AssistantConversationSurfaceProps) => { const t = useScopedI18n("common.assistant"); + const reducedMotion = useReducedMotion(); const [questionPortalTarget, setQuestionPortalTarget] = useState(null); + const scrollToLatestBehavior = isRunning || reducedMotion ? "instant" : "smooth"; return ( <> @@ -2122,7 +2124,7 @@ export const AssistantConversationSurface = ({ - + @@ -2134,7 +2136,7 @@ export const AssistantConversationSurface = ({ - +