diff --git a/app/src/components/LogViewer.tsx b/app/src/components/LogViewer.tsx index b7a4921..b0bf04e 100644 --- a/app/src/components/LogViewer.tsx +++ b/app/src/components/LogViewer.tsx @@ -22,7 +22,6 @@ export const LogViewer = forwardRef(function Lo // When true, new log lines scroll the view to the bottom. Scrolling up to read // pauses it; scrolling back to the bottom (or the play button) resumes. const [autoScroll, setAutoScroll] = useState(true) - const bottomRef = useRef(null) const preRef = useRef(null) useEffect(() => { @@ -57,10 +56,13 @@ export const LogViewer = forwardRef(function Lo return () => window.removeEventListener("keydown", onKey) }, [maximized]) - // Jump to the newest line only while auto-scroll is on. Instant (not smooth) so - // the scroll-position check below never sees a mid-animation false "scrolled up". + // Jump to the newest line only while auto-scroll is on. Scroll the
+  // container directly (not scrollIntoView, which would walk up to the window
+  // and jump the whole page). Instant, so the scroll-position check below never
+  // sees a mid-animation false "scrolled up".
   useEffect(() => {
-    if (autoScroll) bottomRef.current?.scrollIntoView()
+    const el = preRef.current
+    if (autoScroll && el) el.scrollTop = el.scrollHeight
   }, [logs, autoScroll])
 
   // Keep auto-scroll in sync with where the user is: away from the bottom pauses,
@@ -129,7 +131,6 @@ export const LogViewer = forwardRef(function Lo
             
           ))
         )}
-        
)