Integrates and utilizes the new scroll management hook across the component, enabling persistent and accurate chat scrolling behavior.

This commit is contained in:
2026-05-06 03:45:39 +02:00
parent 2af1fee98a
commit cf591c91d1

View File

@@ -1292,6 +1292,26 @@ async function regenerateFromIndex(index, overrideUserText = null) {
return chatSessions.find(s => s.session_id === activeSessionId)?.messages || [];
}, [activeSessionId, chatSessions]);
const {
activeSessionIdRef,
handleNewMsgTipClick,
newMsgTip,
restoredForRef,
scrollMessageToTop,
scrollPendingMessageForSession,
scrollToBottom,
setNewMsgTip,
setPendingScrollToLastUser,
setScrollPositions,
setUserScrolledUp,
userScrolledUpRef,
} = useChatScroll({
activeSessionId,
activeSidebarMode,
chatRef,
messagesLength: messages.length,
})
const activeChatSession = useMemo(() => {
return chatSessions.find(session => session.session_id === activeSessionId) || null
}, [activeSessionId, chatSessions])