From 177efad9e36eafeb6da36070cef7df2abf211243 Mon Sep 17 00:00:00 2001 From: David Cintron Date: Sun, 4 Oct 2026 19:21:59 -0500 Subject: [PATCH 1/2] Clarify warm-up time for 10-day vs 15-day G7 sensors --- G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift b/G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift index d2ddd5a..09c1bfa 100644 --- a/G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift +++ b/G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift @@ -42,7 +42,7 @@ struct G7PairingSuccessView: View { } } - Text(String(format: LocalizedString("%1$@ is now connected to the sensor directly. Readings arrive every 5 minutes; a new sensor needs about 30 minutes to warm up first.", comment: "Body of the pairing success screen (1: appName)"), appName)) + Text(String(format: LocalizedString("%1$@ is now connected to the sensor directly. Readings arrive every 5 minutes; a new sensor needs to warm up first: about 30 minutes for a 10-day sensor, 60 for a 15-day.", comment: "Body of the pairing success screen (1: appName)"), appName)) .foregroundColor(.secondary) .fixedSize(horizontal: false, vertical: true) From 34e8009b57cf17441600ecdace4f9a3c8fa750a8 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 5 Oct 2026 11:39:22 -0500 Subject: [PATCH 2/2] Show the warm-up time the paired sensor reports The sensor reports its warm-up in the extended version message, which arrives a few seconds after pairing, so the success screen watches for it and says how long this sensor's warm-up is. Until it arrives the screen says readings start once the sensor has warmed up. --- .../G7CGMManager/G7UICoordinator.swift | 2 +- G7SensorKitUI/Localizable.xcstrings | 7 ++-- .../Onboarding/G7PairingSuccessView.swift | 35 ++++++++++++++++++- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/G7SensorKitUI/G7CGMManager/G7UICoordinator.swift b/G7SensorKitUI/G7CGMManager/G7UICoordinator.swift index 1d56ac2..4592cd2 100644 --- a/G7SensorKitUI/G7CGMManager/G7UICoordinator.swift +++ b/G7SensorKitUI/G7CGMManager/G7UICoordinator.swift @@ -207,7 +207,7 @@ class G7UICoordinator: UINavigationController, CGMManagerOnboarding, CompletionN // advertised; `.g7` when it did not announce one, matching what // the pairing screen showed a moment ago. let model = deviceName.flatMap(G7SensorModel.init(advertisedName:)) ?? .g7 - let view = G7PairingSuccessView(model: model, deviceName: deviceName, hasNextStep: offersShare) { [weak self] in + let view = G7PairingSuccessView(model: model, deviceName: deviceName, hasNextStep: offersShare, warmup: G7PairingWarmupModel(cgmManager: cgmManager)) { [weak self] in guard let self = self else { return } if offersShare { self.navigate(to: .shareSignIn) diff --git a/G7SensorKitUI/Localizable.xcstrings b/G7SensorKitUI/Localizable.xcstrings index 0234b21..36cd35a 100644 --- a/G7SensorKitUI/Localizable.xcstrings +++ b/G7SensorKitUI/Localizable.xcstrings @@ -433,8 +433,11 @@ "%1$@ connects to your G7, ONE+ or Stelo sensor directly. Pair it with the 4-digit code printed on the sensor applicator, and the Dexcom app is not needed." : { "comment" : "Descriptive text on G7StartupView (1: appName)" }, - "%1$@ is now connected to the sensor directly. Readings arrive every 5 minutes; a new sensor needs about 30 minutes to warm up first." : { - "comment" : "Body of the pairing success screen (1: appName)" + "%1$@ is now connected to the sensor directly. Readings arrive every 5 minutes after a %2$@ warm-up." : { + "comment" : "Body of the pairing success screen (1: appName, 2: warm-up duration, e.g. 27 minutes)" + }, + "%1$@ is now connected to the sensor directly. Readings arrive every 5 minutes once the sensor has warmed up." : { + "comment" : "Body of the pairing success screen before the sensor reports its warm-up time (1: appName)" }, "%1$@ will read glucose from the Dexcom app's session until you pair a sensor. The Dexcom app must stay installed for this to work." : { "comment" : "Explanation of eavesdropping mode on G7StartupView (1: appName)" diff --git a/G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift b/G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift index 09c1bfa..bad6824 100644 --- a/G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift +++ b/G7SensorKitUI/Views/Onboarding/G7PairingSuccessView.swift @@ -15,10 +15,25 @@ struct G7PairingSuccessView: View { var deviceName: String? /// Whether setup continues after this page (Dexcom Share sign-in). var hasNextStep = false + @ObservedObject var warmup: G7PairingWarmupModel var didFinish: () -> Void @Environment(\.appName) private var appName + private var bodyText: String { + guard let duration = warmup.duration, let formatted = Self.durationFormatter.string(from: duration) else { + return String(format: LocalizedString("%1$@ is now connected to the sensor directly. Readings arrive every 5 minutes once the sensor has warmed up.", comment: "Body of the pairing success screen before the sensor reports its warm-up time (1: appName)"), appName) + } + return String(format: LocalizedString("%1$@ is now connected to the sensor directly. Readings arrive every 5 minutes after a %2$@ warm-up.", comment: "Body of the pairing success screen (1: appName, 2: warm-up duration, e.g. 27 minutes)"), appName, formatted) + } + + private static let durationFormatter: DateComponentsFormatter = { + let formatter = DateComponentsFormatter() + formatter.allowedUnits = [.hour, .minute] + formatter.unitsStyle = .full + return formatter + }() + var body: some View { // Laid out like the pairing screen this arrives from: the sensor // centred at the top, the text from one left edge under it, and the @@ -42,7 +57,7 @@ struct G7PairingSuccessView: View { } } - Text(String(format: LocalizedString("%1$@ is now connected to the sensor directly. Readings arrive every 5 minutes; a new sensor needs to warm up first: about 30 minutes for a 10-day sensor, 60 for a 15-day.", comment: "Body of the pairing success screen (1: appName)"), appName)) + Text(bodyText) .foregroundColor(.secondary) .fixedSize(horizontal: false, vertical: true) @@ -65,3 +80,21 @@ struct G7PairingSuccessView: View { .navigationBarBackButtonHidden(true) } } + +/// The warm-up the sensor reports, which arrives shortly after pairing. +final class G7PairingWarmupModel: ObservableObject, G7StateObserver { + @Published private(set) var duration: TimeInterval? + + init(cgmManager: G7CGMManager?) { + duration = cgmManager?.state.extendedVersion?.warmupDuration + cgmManager?.addStateObserver(self, queue: .main) + } + + func g7StateDidUpdate(_ state: G7CGMManagerState?) { + if let warmupDuration = state?.extendedVersion?.warmupDuration { + duration = warmupDuration + } + } + + func g7ConnectionStatusDidChange() {} +}