From f0c6488a064e9fcf1e337f481dd6415d57b54a80 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Thu, 9 Jul 2026 14:37:23 -0700 Subject: [PATCH] Foreground Connection Delay Adjustment Nucleic-Session: CB658C4F-A19F-447C-B313-7CB21783BD94 Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Models/RemoteStore.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift index d4864c1..985535f 100644 --- a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift +++ b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift @@ -1621,6 +1621,13 @@ final class RemoteStore: ObservableObject { /// to the first live Mac. Demo has no connections and mutates the seeded aggregate directly. private func send(_ msg: ClientMsg) { if demoMode { demoHandle(msg); return } + // Optimistic window (post launch/foreground): if no Mac is live yet but we're presenting a + // pretend-connected UI, hold the user's intent and replay it the instant a link comes up + // rather than dropping it silently. Discarded if the window lapses without a connection. + if !hasLiveConnection, isOptimisticActive, isQueueableIntent(msg) { + pendingActions.append((msg, Date())) + return + } switch msg { // Session-owning intents → the Mac that has this session. case .subscribe(let s):