fix: fixed issues with scrolling jumps
This commit is contained in:
@@ -67,7 +67,6 @@ const VIEWPORT_ANCHOR_MIN_UPDATE_MS = 150;
|
|||||||
export const useChatScrollManager = ({
|
export const useChatScrollManager = ({
|
||||||
currentSessionId,
|
currentSessionId,
|
||||||
sessionMessageCount,
|
sessionMessageCount,
|
||||||
streamingMessageId,
|
|
||||||
updateViewportAnchor,
|
updateViewportAnchor,
|
||||||
isSyncing,
|
isSyncing,
|
||||||
isMobile,
|
isMobile,
|
||||||
@@ -149,13 +148,12 @@ export const useChatScrollManager = ({
|
|||||||
}, [markProgrammaticScroll, scrollEngine]);
|
}, [markProgrammaticScroll, scrollEngine]);
|
||||||
|
|
||||||
const scrollPinnedToBottom = React.useCallback(() => {
|
const scrollPinnedToBottom = React.useCallback(() => {
|
||||||
if (streamingMessageId) {
|
// Auto-follow should not animate across an entire new turn.
|
||||||
scrollToBottomInternal({ followBottom: true });
|
// Keep explicit user-triggered scrolls animated, but snap pinned
|
||||||
return;
|
// updates so a new user/assistant message does not visibly travel
|
||||||
}
|
// from the previous sticky header down to the tail.
|
||||||
|
|
||||||
scrollToBottomInternal({ instant: true });
|
scrollToBottomInternal({ instant: true });
|
||||||
}, [scrollToBottomInternal, streamingMessageId]);
|
}, [scrollToBottomInternal]);
|
||||||
|
|
||||||
const updateScrollButtonVisibility = React.useCallback(() => {
|
const updateScrollButtonVisibility = React.useCallback(() => {
|
||||||
const container = scrollRef.current;
|
const container = scrollRef.current;
|
||||||
|
|||||||
Reference in New Issue
Block a user