Logs panel follows its tail by scrolling its own list: scrollIntoView scrolled every ancestor too, so with the code editor expanded each new line slid the whole editor up to bring the hidden dock into view

This commit is contained in:
2026-10-16 10:39:09 +02:00
parent d06804b145
commit cb377ba00e
+5 -1
View File
@@ -102,9 +102,13 @@ function OpenLogsPanel({
const bottom = useRef<HTMLLIElement | null>(null)
// Follow the tail, which is where a running flow puts what just happened.
// Only the list moves: `scrollIntoView` would scroll every ancestor too, and
// with the code editor expanded the dock sits below the canvas, so the whole
// editor slid up to bring this line into view.
// biome-ignore lint/correctness/useExhaustiveDependencies: a new line is what scrolls.
useEffect(() => {
bottom.current?.scrollIntoView({ block: "end" })
const viewport = bottom.current?.closest("[data-slot=scroll-area-viewport]")
viewport?.scrollTo({ top: viewport.scrollHeight })
}, [lines.length])
// Escape still closes it, like everything else floating over this canvas.