gui: revert to working approach - activeState for selected agent only
Non-selected agents show idle (green). This matches the working top indicator approach until we find a proper solution for tracking all agent states reactively in QML.
This commit is contained in:
parent
9929abc73b
commit
dbc1eabf55
24
gui/main.qml
24
gui/main.qml
|
|
@ -1125,17 +1125,6 @@ ApplicationWindow {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
radius: 4
|
radius: 4
|
||||||
visible: type !== "header"
|
visible: type !== "header"
|
||||||
property string currentState: type === "agent" ? ollie.agentState(parentId, agentId) : ""
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: ollie
|
|
||||||
function onAgentStateRevisionChanged() {
|
|
||||||
if (type === "agent") {
|
|
||||||
stateDot.currentState = ollie.agentState(parentId, agentId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
color: {
|
color: {
|
||||||
if (type === "session") {
|
if (type === "session") {
|
||||||
var cc = connectionColor || "gray"
|
var cc = connectionColor || "gray"
|
||||||
|
|
@ -1144,11 +1133,16 @@ ApplicationWindow {
|
||||||
if (cc === "red") return "#f44336"
|
if (cc === "red") return "#f44336"
|
||||||
return "#9e9e9e"
|
return "#9e9e9e"
|
||||||
}
|
}
|
||||||
// Agent: gray if paused, else state color
|
// Agent: use ollie.activeState for the selected agent (reactive)
|
||||||
|
// For non-selected agents, show idle/paused only
|
||||||
|
var isActive = (agentId === ollie.activeAgentId && parentId === ollie.activeSessionId)
|
||||||
if (ollie.isSessionPaused(parentId)) return "#9e9e9e"
|
if (ollie.isSessionPaused(parentId)) return "#9e9e9e"
|
||||||
if (currentState === "idle") return "#4caf50"
|
if (isActive) {
|
||||||
if (currentState.startsWith("calling")) return "#ff9800"
|
if (ollie.activeState === "idle") return "#4caf50"
|
||||||
return "#2196f3"
|
if (ollie.activeState.startsWith("calling")) return "#ff9800"
|
||||||
|
return "#2196f3"
|
||||||
|
}
|
||||||
|
return "#4caf50" // non-active agents show idle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in New Issue