iOS Live Activity Updates

Nucleic-Session: 665980BA-E8A5-4E84-9DF4-1757CF792353
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 12:55:08 -07:00
co-authored by Nucleic
parent c71150d5ab
commit 0c6841a8fb
@@ -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).