gui: gray state indicator when session is paused
Session paused state overrides agent state for the indicator. Reacts to sessionsChanged signal for pause/resume updates.
This commit is contained in:
parent
0744d9227a
commit
7cbaaed014
|
|
@ -303,6 +303,8 @@ Item {
|
|||
radius: height / 2
|
||||
visible: type === "agent"
|
||||
color: {
|
||||
// Session paused overrides agent state
|
||||
if (ollie.isSessionPaused(parentId || "")) return "#808080" // gray - session paused
|
||||
var state = ollie.agentState(parentId || "", agentId || "")
|
||||
if (state.startsWith("calling")) return "#f0a030" // orange - calling tool
|
||||
if (state === "thinking") return "#3080f0" // blue - thinking
|
||||
|
|
@ -314,12 +316,23 @@ Item {
|
|||
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"
|
||||
stateIndicator.color = stateIndicator.computeColor()
|
||||
}
|
||||
}
|
||||
function onSessionsChanged() {
|
||||
if (type === "agent") {
|
||||
stateIndicator.color = stateIndicator.computeColor()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function computeColor() {
|
||||
if (ollie.isSessionPaused(parentId || "")) return "#808080"
|
||||
var state = ollie.agentState(parentId || "", agentId || "")
|
||||
if (state.startsWith("calling")) return "#f0a030"
|
||||
else if (state === "thinking") return "#3080f0"
|
||||
else if (state === "paused") return "#808080"
|
||||
else return "#40c040"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue