gui: add agent state indicator dot to session tree
Small colored dot to the right of agent name shows execution state: - Green: idle - Blue: thinking - Orange: calling tool - Gray: paused Updates reactively via agentStateChanged event signal.
This commit is contained in:
parent
d8b24ae26d
commit
64559de661
|
|
@ -291,6 +291,36 @@ Item {
|
|||
visible: modelIndex !== renamingIndex
|
||||
}
|
||||
}
|
||||
|
||||
// Agent state indicator (agent rows only)
|
||||
Rectangle {
|
||||
id: stateIndicator
|
||||
Layout.preferredWidth: 8
|
||||
Layout.preferredHeight: 8
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: 4
|
||||
radius: 4
|
||||
visible: type === "agent"
|
||||
color: {
|
||||
var state = ollie.agentState(parentId || "", agentId || "")
|
||||
if (state.startsWith("calling")) return "#f0a030" // orange - calling tool
|
||||
if (state === "thinking") return "#3080f0" // blue - thinking
|
||||
if (state === "paused") return "#808080" // gray - paused
|
||||
return "#40c040" // green - idle
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ollie
|
||||
function onAgentStateChanged(sid, aid, state) {
|
||||
if (type === "agent" && sid === parentId && aid === agentId) {
|
||||
if (state.startsWith("calling")) stateIndicator.color = "#f0a030"
|
||||
else if (state === "thinking") stateIndicator.color = "#3080f0"
|
||||
else if (state === "paused") stateIndicator.color = "#808080"
|
||||
else stateIndicator.color = "#40c040"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
highlighted: (type === "agent" && agentId === ollie.activeAgentId && parentId === ollie.activeSessionId)
|
||||
|
|
|
|||
Loading…
Reference in New Issue