File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
multimodal/tarko/agent-web-ui/src/standalone/chat/hooks Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -197,8 +197,13 @@ export const useScrollToBottom = ({
197197
198198 const latestUserMessage = allUserMessages [ allUserMessages . length - 1 ] ;
199199
200- // Auto-scroll if we have a new user message
201- if ( latestUserMessage ?. id && latestUserMessage . id !== lastUserMessageIdRef . current ) {
200+ // Auto-scroll ONLY if:
201+ // 1. We have a new user message
202+ // 2. It's the LAST user message (most recent one)
203+ // 3. It has the isLocalMessage flag (indicating it was just sent by user)
204+ if ( latestUserMessage ?. id &&
205+ latestUserMessage . id !== lastUserMessageIdRef . current &&
206+ latestUserMessage . isLocalMessage ) {
202207 lastUserMessageIdRef . current = latestUserMessage . id ;
203208
204209 const timer = setTimeout ( autoScrollToBottom , SCROLL_CHECK_DELAY ) ;
You can’t perform that action at this time.
0 commit comments