From e8ac67093a25b8246270bf4ff3e4a9f6569662c9 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Mon, 6 Jul 2026 15:02:02 -0700 Subject: [PATCH] Investigate Live Activity Session Load Nucleic-Session: 044A9B93-AB31-4B6B-9A27-3631261269B1 Co-authored-by: Nucleic --- .../NucleicRemote/Models/RemoteStore.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift index e02ecd0..d257c53 100644 --- a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift +++ b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift @@ -550,6 +550,24 @@ final class RemoteStore: ObservableObject { dashboard = DashboardSnapshot.merged([host1Dashboard, host2Dashboard]) LiveActivityManager.shared.sync(hostName: hostName, sessions: liveSessions) NotificationRouter.shared.updateBadge(needsYouCount) + // TEMP DIAGNOSTIC: simulate a Live Activity cold-launch, where the detail opens while the + // channel is still offline and the connection lands a moment later (disconnected→live under + // an open detail). Gated on an env var so normal demo is untouched. + if ProcessInfo.processInfo.environment["NUCLEIC_DEMO_DELAY_CONNECT"] == "1" { + connectivity = .reconnecting + Task { @MainActor [weak self] in + try? await Task.sleep(for: .seconds(2)) + guard let self else { return } + self.connectivity = .connected(.lan) + // The snapshot arriving for the open session (approval + a fresh event). + if let id = self.openSessionID { + self.openApprovals = [ApprovalRequest( + id: Self.demoApprovalID(for: id), sessionID: id, toolCallID: "t-appr", + toolName: "Bash", input: ["command": "npm run deploy"], + title: "Run npm run deploy", risk: .execute, createdAt: Date())] + } + } + } } /// Offline diff fixture (NUCLEIC_DEMO) so the full-patch Diff tab renders without a host.