Add integrated chat minimap
This commit is contained in:
parent
b0e46fdfbc
commit
183f30ca23
|
|
@ -124,13 +124,48 @@ Item {
|
|||
anchors.margins: 4
|
||||
visible: ollie.daemonConnected && ollie.activeAgentId !== ""
|
||||
|
||||
Component.onCompleted: chatPane.scrollToBottom()
|
||||
|
||||
delegate: ChatBlockDelegate {
|
||||
width: chatView.width - 8
|
||||
}
|
||||
}
|
||||
|
||||
// Chat overview and navigation minimap
|
||||
Rectangle {
|
||||
id: chatMinimap
|
||||
anchors.top: chatView.top
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: chatView.bottom
|
||||
width: 24
|
||||
color: Qt.rgba(theme.midColor.r, theme.midColor.g, theme.midColor.b, 0.05)
|
||||
visible: chatView.visible && chatModel.count > 0
|
||||
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
spacing: 1
|
||||
Repeater {
|
||||
model: chatModel
|
||||
Rectangle {
|
||||
width: chatMinimap.width
|
||||
height: Math.max(2, chatMinimap.height / Math.max(1, chatModel.count) - 1)
|
||||
color: {
|
||||
switch (model.blockType) {
|
||||
case "user": return "#4caf50"
|
||||
case "assistant": return "#2196f3"
|
||||
case "error": return "#f44336"
|
||||
case "tool": return "#ff9800"
|
||||
default: return theme.midColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: chatView.positionViewAtIndex(
|
||||
Math.floor(mouse.y / height * chatModel.count), ListView.Beginning)
|
||||
}
|
||||
}
|
||||
Button {
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
|
|
|||
Reference in New Issue