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