From 50c3b5979ca11597ec9f7a60701ed67da99b3f22 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 1 Aug 2026 10:20:50 +0200 Subject: [PATCH] fix streaming scroll: use Timer.singleShot + positionViewAtIndex --- gui/main.qml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gui/main.qml b/gui/main.qml index acd36d4..6bbb14f 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -313,14 +313,23 @@ ApplicationWindow { boundsBehavior: Flickable.StopAtBounds onCountChanged: { - Qt.callLater(function() { positionViewAtEnd() }) + if (count > 0) { + var idx = count - 1 + Timer.singleShot(0, function() { + positionViewAtIndex(idx, ListView.End) + }) + } } Connections { target: chatModel function onDataChanged() { - if (chatView.atYEnd) - Qt.callLater(function() { chatView.positionViewAtEnd() }) + if (chatView.atYEnd && chatView.count > 0) { + var idx = chatView.count - 1 + Timer.singleShot(0, function() { + chatView.positionViewAtIndex(idx, ListView.End) + }) + } } }