fix: allow scrolling during streaming
User scroll-up now unpins active chat streaming Auto-follow no longer snaps back after trusted upward scrolls
This commit is contained in:
@@ -375,7 +375,10 @@ export const useChatScrollManager = ({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const isProgrammatic = isMarkedAutoScroll(container.scrollTop);
|
const currentScrollTop = container.scrollTop;
|
||||||
|
const scrollingUp = currentScrollTop < lastScrollTopRef.current;
|
||||||
|
const isTrustedScrollUp = Boolean(event?.isTrusted && scrollingUp);
|
||||||
|
const isProgrammatic = !isTrustedScrollUp && isMarkedAutoScroll(currentScrollTop);
|
||||||
if (isProgrammatic) {
|
if (isProgrammatic) {
|
||||||
autoScrollMarkerRef.current = null;
|
autoScrollMarkerRef.current = null;
|
||||||
}
|
}
|
||||||
@@ -393,9 +396,6 @@ export const useChatScrollManager = ({
|
|||||||
schedulePinnedStateAndIndicators();
|
schedulePinnedStateAndIndicators();
|
||||||
|
|
||||||
// Handle pin/unpin logic
|
// Handle pin/unpin logic
|
||||||
const currentScrollTop = container.scrollTop;
|
|
||||||
const scrollingUp = currentScrollTop < lastScrollTopRef.current;
|
|
||||||
|
|
||||||
if (event?.isTrusted && !isProgrammatic) {
|
if (event?.isTrusted && !isProgrammatic) {
|
||||||
if (scrollingUp && isPinnedRef.current) {
|
if (scrollingUp && isPinnedRef.current) {
|
||||||
setFollowMode('none');
|
setFollowMode('none');
|
||||||
|
|||||||
Reference in New Issue
Block a user