Scroll chat to bottom on startup

This commit is contained in:
Levi Neely 2026-08-16 13:07:10 +02:00
parent b28330b5d5
commit 57c95e3192
1 changed files with 10 additions and 1 deletions

View File

@ -6,15 +6,22 @@ Item {
id: chatPane id: chatPane
property bool sidebarVisible: true property bool sidebarVisible: true
signal toggleSidebar() signal toggleSidebar()
function scrollToBottom() {
chatView.positionViewAtEnd()
}
function loadChat() { function loadChat() {
chatModel.reset() chatModel.reset()
if (ollie.activeSessionId && ollie.activeAgentId) { if (ollie.activeSessionId && ollie.activeAgentId) {
var log = ollie.readLogForSession(ollie.activeSessionId, ollie.activeAgentId) var log = ollie.readLogForSession(ollie.activeSessionId, ollie.activeAgentId)
if (log) { chatModel.appendData(log); chatModel.trimFront(20) } if (log) { chatModel.appendData(log); chatModel.trimFront(20) }
} }
scrollToBottom()
} }
Component.onCompleted: loadChat() Component.onCompleted: {
loadChat()
scrollToBottom()
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
@ -117,6 +124,8 @@ Item {
anchors.margins: 4 anchors.margins: 4
visible: ollie.daemonConnected && ollie.activeAgentId !== "" visible: ollie.daemonConnected && ollie.activeAgentId !== ""
Component.onCompleted: chatPane.scrollToBottom()
delegate: ChatBlockDelegate { delegate: ChatBlockDelegate {
width: chatView.width - 8 width: chatView.width - 8
} }