gui: use revision inside binding expression for proper dependency tracking

This commit is contained in:
Levi Neely 2026-08-04 16:24:10 +02:00
parent 22980e376a
commit 670d759769
1 changed files with 4 additions and 5 deletions

View File

@ -1125,10 +1125,7 @@ ApplicationWindow {
Layout.alignment: Qt.AlignVCenter
radius: 4
visible: type !== "header"
// Bind to revision so we re-evaluate when any agent state changes
property int _rev: ollie.agentStateRevision
color: {
void(_rev) // force dependency
if (type === "session") {
var cc = connectionColor || "gray"
if (cc === "green") return "#4caf50"
@ -1136,9 +1133,11 @@ ApplicationWindow {
if (cc === "red") return "#f44336"
return "#9e9e9e"
}
// Agent: gray if paused, else state color
// Agent: gray if paused, else state color from map
// Revision forces re-eval when any state changes
var rev = ollie.agentStateRevision
if (ollie.isSessionPaused(parentId)) return "#9e9e9e"
var s = ollie.agentState(parentId, agentId)
var s = rev >= 0 ? ollie.agentState(parentId, agentId) : "idle"
if (s === "idle") return "#4caf50"
if (s.startsWith("calling")) return "#ff9800"
return "#2196f3"