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:
Bohdan Triapitsyn
2026-05-07 23:03:46 +03:00
parent 585e2a55f1
commit 35d95c3044
@@ -375,7 +375,10 @@ export const useChatScrollManager = ({
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) {
autoScrollMarkerRef.current = null;
}
@@ -393,9 +396,6 @@ export const useChatScrollManager = ({
schedulePinnedStateAndIndicators();
// Handle pin/unpin logic
const currentScrollTop = container.scrollTop;
const scrollingUp = currentScrollTop < lastScrollTopRef.current;
if (event?.isTrusted && !isProgrammatic) {
if (scrollingUp && isPinnedRef.current) {
setFollowMode('none');