From 44116a20d1160f261787f2d1ec4b54fa2197f4ec Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Tue, 7 Jul 2026 03:00:02 -0700 Subject: [PATCH] Live Activity Session Retention Nucleic-Session: F2CCC9F2-A7BA-4A94-ADAA-5414F168045E Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/LiveActivityManager.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NucleicRemote/NucleicRemote/LiveActivityManager.swift b/NucleicRemote/NucleicRemote/LiveActivityManager.swift index 72dfa34..703b405 100644 --- a/NucleicRemote/NucleicRemote/LiveActivityManager.swift +++ b/NucleicRemote/NucleicRemote/LiveActivityManager.swift @@ -34,7 +34,14 @@ final class LiveActivityManager { /// itself carries an `AlertConfiguration` (sound/haptic). Starts `true` — `onAppear` runs /// foreground; the background adopt path flips it. Mirrors the host's connected-vs-away gate for /// the pushed glance, but for the still-connected phone whose own socket is alive. - var foreground = true + var foreground = true { + didSet { + // The app just came forward and the user can now see the in-app session list — so dismiss + // the "Done" glance we were holding on the lock screen for exactly this moment. The + // counterpart to `finishWithDoneGlance` keeping it up while the app was away. + if foreground, !oldValue, showingDoneGlance { end() } + } + } /// The last content we pushed. Updates that don't change it are skipped so we don't spend /// ActivityKit's update budget on no-ops — `sync` fires on every host message (dashboard,