From ed509cfb5b8e0f1a0f4896537d6de926cddddafa Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sun, 5 Jul 2026 22:03:35 -0700 Subject: [PATCH] Settings Feature Enhancement Nucleic-Session: 89BFAB13-D559-43FC-BE28-0B2639BECF0F Co-authored-by: Nucleic --- .../NucleicRemote/Models/RemoteStore.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift index d1541a6..f8c4016 100644 --- a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift +++ b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift @@ -78,6 +78,20 @@ final class RemoteStore: ObservableObject { @Published private(set) var openDiff: WireSessionDiff? @Published private(set) var diffLoading = false + /// "Add a device to this mesh" (Settings): the phone asks a connected Mac to mint a join code + /// and shows it as a QR / copyable link. The phone can't mint one itself (it runs no listener), + /// so this is always relayed through a live, capable host. + enum AddDeviceState: Equatable { + case idle + case requesting // waiting on the host's `pairingCode` reply + case ready(String) // the `nucleic://pair?d=…` join code to display + case unavailable // no live host could mint one right now + } + @Published private(set) var addDevice: AddDeviceState = .idle + /// The host we asked to mint the current code, so a dismiss can tell the *same* Mac to close + /// its pairing window. + private var pairingMintHostID: String? + /// A transient host-reported error (the mobile echo of the Mac's last-error bubble): /// shown as a red bubble at the bottom of the screen, auto-dismissed after a few seconds. struct LastError: Equatable, Identifiable {