gui: use explicit properties for agent state dot binding

Create agentState and isPaused properties to ensure proper binding
updates when model roles change via setProperty
This commit is contained in:
Levi Neely 2026-08-04 16:17:11 +02:00
parent 9e5352f700
commit 457a6a55dc
1 changed files with 5 additions and 4 deletions

View File

@ -1125,6 +1125,8 @@ ApplicationWindow {
Layout.alignment: Qt.AlignVCenter
radius: 4
visible: type !== "header"
property string agentState: (type === "agent") ? (state || "idle") : ""
property bool isPaused: (type === "agent") ? (parentPaused === true) : false
color: {
if (type === "session") {
// Session: RPC connection health
@ -1135,11 +1137,10 @@ ApplicationWindow {
return "#9e9e9e"
}
// Agent: gray if parent session is paused
if (parentPaused === true) return "#9e9e9e"
if (isPaused) return "#9e9e9e"
// Agent: use state role from model
var s = state || "idle"
if (s === "idle") return "#4caf50"
if (s.startsWith("calling")) return "#ff9800"
if (agentState === "idle") return "#4caf50"
if (agentState.startsWith("calling")) return "#ff9800"
return "#2196f3"
}
}