fix assistant streaming scroll lock
This commit is contained in:
1 parent
87a42f09be
commit
9f2b52dd7f
3 files changed
+7
-8
No files matched your search
@@ -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
|
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
|
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.
|
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
|
`Shift + A` opens the compact conversation panel directly. The shortcut is ignored while typing in text
|
||||||
fields, selectors, and editable content.
|
fields, selectors, and editable content.
|
||||||
|
|||||||
@@ -330,7 +330,6 @@
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
scroll-behavior: smooth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.messages {
|
.messages {
|
||||||
@@ -1313,8 +1312,4 @@
|
|||||||
animation: none;
|
animation: none;
|
||||||
transition: none;
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.viewport {
|
|
||||||
scroll-behavior: auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ import {
|
|||||||
UnstyledButton,
|
UnstyledButton,
|
||||||
useCombobox,
|
useCombobox,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useWindowEvent } from "@mantine/hooks";
|
import { useReducedMotion, useWindowEvent } from "@mantine/hooks";
|
||||||
import {
|
import {
|
||||||
IconActivityHeartbeat,
|
IconActivityHeartbeat,
|
||||||
IconAlertTriangle,
|
IconAlertTriangle,
|
||||||
@@ -2058,7 +2058,9 @@ export const AssistantConversationSurface = ({
|
|||||||
onMinimize,
|
onMinimize,
|
||||||
}: AssistantConversationSurfaceProps) => {
|
}: AssistantConversationSurfaceProps) => {
|
||||||
const t = useScopedI18n("common.assistant");
|
const t = useScopedI18n("common.assistant");
|
||||||
|
const reducedMotion = useReducedMotion();
|
||||||
const [questionPortalTarget, setQuestionPortalTarget] = useState<HTMLDivElement | null>(null);
|
const [questionPortalTarget, setQuestionPortalTarget] = useState<HTMLDivElement | null>(null);
|
||||||
|
const scrollToLatestBehavior = isRunning || reducedMotion ? "instant" : "smooth";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -2122,7 +2124,7 @@ export const AssistantConversationSurface = ({
|
|||||||
</Group>
|
</Group>
|
||||||
<AssistantQuestionPortalProvider target={questionPortalTarget}>
|
<AssistantQuestionPortalProvider target={questionPortalTarget}>
|
||||||
<ThreadPrimitive.Root className={classes.thread}>
|
<ThreadPrimitive.Root className={classes.thread}>
|
||||||
<ThreadPrimitive.Viewport className={classes.viewport}>
|
<ThreadPrimitive.Viewport className={classes.viewport} autoScroll>
|
||||||
<Box className={classes.messages}>
|
<Box className={classes.messages}>
|
||||||
<EmptyThread />
|
<EmptyThread />
|
||||||
<ThreadPrimitive.Messages components={{ UserMessage, AssistantMessage }} />
|
<ThreadPrimitive.Messages components={{ UserMessage, AssistantMessage }} />
|
||||||
@@ -2134,7 +2136,7 @@ export const AssistantConversationSurface = ({
|
|||||||
</Button>
|
</Button>
|
||||||
</SelectionToolbarPrimitive.Quote>
|
</SelectionToolbarPrimitive.Quote>
|
||||||
</SelectionToolbarPrimitive.Root>
|
</SelectionToolbarPrimitive.Root>
|
||||||
<ThreadPrimitive.ScrollToBottom asChild>
|
<ThreadPrimitive.ScrollToBottom behavior={scrollToLatestBehavior} asChild>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
className={classes.scrollToBottom}
|
className={classes.scrollToBottom}
|
||||||
variant="default"
|
variant="default"
|
||||||
|
|||||||
Reference in new issue
Block a user