gui: reload full chat history when scrolling to trimmed block

When scrollToBlockId fails to find a block (trimmed from view),
reload the full chat without trimming and scroll to it.
This commit is contained in:
Levi Neely 2026-10-09 14:57:53 +02:00
parent 922b53de4a
commit 233a5cc2e9
1 changed files with 17 additions and 0 deletions

View File

@ -46,7 +46,24 @@ Item {
var idx = chatModel.indexForBlockId(blockId)
if (idx >= 0) {
chatView.positionViewAtIndex(idx, ListView.Center)
return true
}
// Block not in current view — reload full chat and try again
if (ollie.activeSessionId && ollie.activeAgentId) {
chatModel.reset()
var log = ollie.readLogForSession(ollie.activeSessionId, ollie.activeAgentId)
if (log) {
chatModel.appendData(log)
// Don't trim — keep full history so we can find the block
idx = chatModel.indexForBlockId(blockId)
if (idx >= 0) {
chatView.positionViewAtIndex(idx, ListView.Center)
return true
}
}
}
console.log("Block not found:", blockId)
return false
}
function trimVisibleBlocks() {
if (chatModel.count > chatPane.maxVisibleBlocks)