diff --git a/gui/main.qml b/gui/main.qml index be59a29..bf4ec6a 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -1125,17 +1125,6 @@ ApplicationWindow { Layout.alignment: Qt.AlignVCenter radius: 4 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: { if (type === "session") { var cc = connectionColor || "gray" @@ -1144,11 +1133,16 @@ ApplicationWindow { if (cc === "red") return "#f44336" 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 (currentState === "idle") return "#4caf50" - if (currentState.startsWith("calling")) return "#ff9800" - return "#2196f3" + if (isActive) { + if (ollie.activeState === "idle") return "#4caf50" + if (ollie.activeState.startsWith("calling")) return "#ff9800" + return "#2196f3" + } + return "#4caf50" // non-active agents show idle } } }