Live Activity Launch Consistency

Nucleic-Session: 9D2EE9AB-2E44-485B-A196-54D250F9D89B
Co-authored-by: Nucleic <[email protected]>
This commit is contained in:
2026-07-06 20:05:06 -07:00
co-authored by Nucleic
parent 63c92ee093
commit 3bbba42895
@@ -1511,6 +1511,14 @@ final class RemoteStore: ObservableObject {
private var pushToStartToken: String?
/// Host ids that already have the current push-to-start token (mirrors `liveActivitySentTo`).
private var pushToStartSentTo: Set<String> = []
/// Whether the app is currently foreground. Reported to capable Macs (`ClientMsg.setForeground`)
/// so they know whether to defer to the phone's own Live Activity creation (foreground) or
/// push-to-start the glance themselves (backgrounded — the phone can't reliably start one). Starts
/// `true`: `onAppear` runs in the foreground; the background adopt-wake flips it first (§5.3).
private var isForeground = true
/// Host ids already told the *current* `isForeground` value — cleared whenever it flips so the
/// next sync re-notifies every host (mirrors `pushToStartSentTo`).
private var foregroundSentTo: Set<String> = []
/// Guards `setupLiveActivityBridge` — it's called from both `onAppear` and the background adopt
/// wake, and installing the callbacks / observers once is enough.