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.
This commit is contained in:
Levi Neely 2026-08-09 00:16:46 +02:00
parent 3525637d60
commit eed4a1089e
1 changed files with 13 additions and 4 deletions

View File

@ -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 {