Live Activity Session Retention

Nucleic-Session: F2CCC9F2-A7BA-4A94-ADAA-5414F168045E
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-07 02:59:49 -07:00
co-authored by Nucleic
parent 68fecc4812
commit 040f2a5e46
@@ -15,12 +15,12 @@ final class LiveActivityManager {
/// still summarize everything, this just bounds the per-session list.
private static let maxLines = 3
/// How long the terminal "all clear / Done" glance lingers before the Activity dismisses. Long
/// enough to read at a glance, short enough not to loiter on the lock screen.
private static let doneLinger: Duration = .seconds(4)
/// The delayed dismissal after the Done glance is shown, cancelled if work resumes first — so a
/// completed run flashes "Done" and then clears instead of vanishing the instant it finishes.
private var dismissTask: Task<Void, Never>?
/// Whether the glance is currently holding the terminal "Done" summary. When work finishes while
/// the app is away, the Activity is kept on the lock screen showing the finished sessions and
/// *held there* — not dismissed on a timer — until the user opens the app and sees them, so a
/// completed run isn't dropped after a few seconds unseen (UX_IOS §5.3). Set when the Done glance
/// goes up; cleared when work resumes, or when the app foregrounds and the glance ends.
private var showingDoneGlance = false
private var activity: Activity<NucleicSessionAttributes>?