From 8103d80df28752d60889760075249077675071bf Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sun, 16 Aug 2026 12:59:36 +0200 Subject: [PATCH] Load chat history when chat pane starts --- gui/ChatPane.qml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/gui/ChatPane.qml b/gui/ChatPane.qml index 15803dd..2096d16 100644 --- a/gui/ChatPane.qml +++ b/gui/ChatPane.qml @@ -6,6 +6,15 @@ Item { id: chatPane property bool sidebarVisible: true signal toggleSidebar() + 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) } + } + } + + Component.onCompleted: loadChat() ColumnLayout { anchors.fill: parent @@ -254,15 +263,16 @@ Item { Connections { target: ollie - 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) } - } - } - function onActiveSessionIdChanged() { loadChat() } - function onActiveAgentIdChanged() { loadChat() } + function onSessionsChanged() { chatPane.loadChat() } + function onActiveSessionIdChanged() { chatPane.loadChat() } + function onActiveAgentIdChanged() { chatPane.loadChat() } +} + +Timer { + interval: 0 + repeat: false + running: true + onTriggered: chatPane.loadChat() } }