From d31e556ca8e684611ab7459d1af91ba577025876 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Thu, 9 Jul 2026 14:37:00 -0700 Subject: [PATCH] Foreground Connection Delay Adjustment Nucleic-Session: CB658C4F-A19F-447C-B313-7CB21783BD94 Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Models/RemoteStore.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift index d3ba854..3a87b72 100644 --- a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift +++ b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift @@ -482,6 +482,11 @@ final class RemoteStore: ObservableObject { func onForeground() { endBackgroundHold() guard !demoMode, isPaired else { return } + // Pretend we're still connected for a few seconds while the (possibly OS-killed) sockets + // re-handshake — the reconnect below is fast, and flashing "Disconnected" in the meantime + // just feels janky. Set before `reconnect()` so the connecting/reconnecting states it + // produces are overlaid with the last-live projection (see `rebuildAggregate`). + beginOptimisticWindow() // Foreground again: the app self-creates its own Live Activity now, so tell the hosts to stop // push-to-starting it (UX_IOS §5.3). Sent to already-live hosts; ones still reconnecting get // it via `didUpdate` once live.