diff --git a/NucleicRemote/Shared/SessionActivityAttributes.swift b/NucleicRemote/Shared/SessionActivityAttributes.swift index 281d720..9809710 100644 --- a/NucleicRemote/Shared/SessionActivityAttributes.swift +++ b/NucleicRemote/Shared/SessionActivityAttributes.swift @@ -64,6 +64,19 @@ struct NucleicSessionAttributes: ActivityAttributes { /// The most urgent sessions, attention-first (capped, typically ≤3): the detail rows. var lines: [SessionLine] + /// The attention-bearing fingerprint of the glance: the headline counts plus each row's + /// identity and `kind`. Deliberately EXCLUDES the mid-turn churn (files/±lines and the + /// churn-derived detail), which ticks on every transcript edit while the agent works. + /// `LiveActivityManager` gates its `activity.update` on this so the glance refreshes on a + /// status change — a session starting, finishing, needing approval/input — not on every diff + /// delta mid-turn (which would burn ActivityKit's update budget for an illegible number). + /// Mirrors the host's `LiveActivitySnapshot.attentionSignature`. + var attentionSignature: [String] { + var parts = ["run:\(runningCount)", "need:\(needsYouCount)", "appr:\(approvalCount)"] + parts.append(contentsOf: lines.map { "\($0.id):\($0.kind.rawValue)" }) + return parts + } + /// The single most urgent session (drives the compact/minimal regions). var top: SessionLine? { lines.first } /// Whether anything needs the user (waiting session or a pending approval).