refactor: decouple permission state from attention signal

This commit is contained in:
Mohamed Boudra
2026-02-23 15:47:08 +07:00
parent 89a117e1c1
commit f3ebe0545f
18 changed files with 276 additions and 28 deletions
+4 -3
View File
@@ -30,7 +30,8 @@ function deriveFaviconStatus(
return "running";
}
const hasAttention = agents.some((agent) => agent.requiresAttention);
if (hasAttention) {
const hasNeedsInput = agents.some((agent) => (agent.pendingPermissionCount ?? 0) > 0);
if (hasAttention || hasNeedsInput) {
return "attention";
}
return "none";
@@ -41,8 +42,8 @@ function deriveMacDockBadgeCount(
): number | undefined {
const attentionCount = agents.filter(
(agent) =>
agent.requiresAttention &&
(agent.attentionReason === "permission" || agent.attentionReason === "finished")
(agent.pendingPermissionCount ?? 0) > 0 ||
(agent.requiresAttention && agent.attentionReason === "finished")
).length;
if (attentionCount > 0) {
return attentionCount;