From eed4a1089edfffc897c4f1d1f2bfa9abed236785 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 9 Aug 2026 00:16:46 +0200 Subject: [PATCH] gui: restore scroll-follow with debounced Timer Use a 16ms Timer restarted from onContentHeightChanged and onCountChanged. The timer fires after the polish pass completes, avoiding the recursive layout loop that the old synchronous positionViewAtEnd() caused. --- gui/main.qml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gui/main.qml b/gui/main.qml index b865d7e..8319d04 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -888,14 +888,23 @@ ApplicationWindow { onCountChanged: { if (followTail) - Qt.callLater(chatView.scrollToEnd) + scrollTimer.restart() + } + + onContentHeightChanged: { + if (followTail) + scrollTimer.restart() } onMovementEnded: followTail = atYEnd - function scrollToEnd() { - if (followTail && contentHeight > height) - positionViewAtEnd() + Timer { + id: scrollTimer + interval: 16 + onTriggered: { + if (chatView.followTail && chatView.contentHeight > chatView.height) + chatView.positionViewAtEnd() + } } delegate: ChatBlockDelegate {