|
| 1 | +// |
| 2 | +// InPlayConnectionInfoView.swift |
| 3 | +// OmnipodKit |
| 4 | +// |
| 5 | +// Detail screen behind the persistent "slow connections expected" notice shown in pod |
| 6 | +// settings when an InPlay-variant DASH pod is paired with an affected iPhone model |
| 7 | +// (iPhone 16 family or iPhone 17e). See BluetoothManager's eager-connect watchdog. |
| 8 | +// |
| 9 | +// Copyright © 2026 LoopKit Authors. All rights reserved. |
| 10 | +// |
| 11 | + |
| 12 | +import SwiftUI |
| 13 | +import UIKit |
| 14 | +import LoopKitUI |
| 15 | + |
| 16 | +struct InPlayConnectionInfoView: View { |
| 17 | + |
| 18 | + var body: some View { |
| 19 | + List { |
| 20 | + Section { |
| 21 | + VStack(alignment: .leading, spacing: 12) { |
| 22 | + HStack(spacing: 10) { |
| 23 | + Image(systemName: "exclamationmark.triangle.fill") |
| 24 | + .foregroundColor(.orange) |
| 25 | + .imageScale(.large) |
| 26 | + Text(LocalizedString("Slower Connections Expected", comment: "Title on InPlay connection info view")) |
| 27 | + .font(.headline) |
| 28 | + } |
| 29 | + Text(String(format: LocalizedString("Your pod uses an “InPlay” Bluetooth radio, and your phone (%1$@) is a model known to trigger a bug in that radio’s firmware. When it happens, the Bluetooth connection silently stalls while being established.", comment: "InPlay connection info: what is happening (1: iPhone model name)"), UIDevice.modelName)) |
| 30 | + .fixedSize(horizontal: false, vertical: true) |
| 31 | + } |
| 32 | + .padding(.vertical, 8) |
| 33 | + } |
| 34 | + |
| 35 | + Section(header: SectionHeader(label: LocalizedString("What to Expect", comment: "Section header on InPlay connection info view"))) { |
| 36 | + VStack(alignment: .leading, spacing: 10) { |
| 37 | + Text(LocalizedString("Connecting to the pod may sometimes take noticeably longer than usual — occasionally up to 30 seconds — while stalled attempts are detected and retried automatically. Commands still complete once the connection is made.", comment: "InPlay connection info: what to expect body 1")) |
| 38 | + .fixedSize(horizontal: false, vertical: true) |
| 39 | + Text(LocalizedString("Pairing a new pod may also need extra time or an additional attempt.", comment: "InPlay connection info: what to expect body 2")) |
| 40 | + .fixedSize(horizontal: false, vertical: true) |
| 41 | + } |
| 42 | + .padding(.vertical, 4) |
| 43 | + } |
| 44 | + |
| 45 | + Section(header: SectionHeader(label: LocalizedString("Pump Heartbeat", comment: "Section header on InPlay connection info view"))) { |
| 46 | + VStack(alignment: .leading, spacing: 10) { |
| 47 | + Text(LocalizedString("The usual method for the pod to wake the app on a timer can't be used on this combination. Instead, the app is woken when the pod's connection drops, and reconnects right away.", comment: "InPlay connection info: heartbeat body 1")) |
| 48 | + .fixedSize(horizontal: false, vertical: true) |
| 49 | + Text(LocalizedString("These wake-ups are less regular than usual — roughly every few minutes. If your CGM delivers readings to the app, it provides the wake-ups instead and looping continues normally.", comment: "InPlay connection info: heartbeat body 2")) |
| 50 | + .fixedSize(horizontal: false, vertical: true) |
| 51 | + } |
| 52 | + .padding(.vertical, 4) |
| 53 | + } |
| 54 | + |
| 55 | + Section(header: SectionHeader(label: LocalizedString("What You Can Do", comment: "Section header on InPlay connection info view"))) { |
| 56 | + VStack(alignment: .leading, spacing: 10) { |
| 57 | + Text(LocalizedString("No action is needed — this is not a pod fault, and insulin delivery is not affected. The pod continues its programmed delivery even while disconnected.", comment: "InPlay connection info: guidance body 1")) |
| 58 | + .fixedSize(horizontal: false, vertical: true) |
| 59 | + Text(LocalizedString("Keeping your phone near the pod helps connections complete faster. Not every pod uses this radio — a future pod may connect normally.", comment: "InPlay connection info: guidance body 2")) |
| 60 | + .fixedSize(horizontal: false, vertical: true) |
| 61 | + } |
| 62 | + .padding(.vertical, 4) |
| 63 | + } |
| 64 | + } |
| 65 | + .insetGroupedListStyle() |
| 66 | + .navigationBarTitle(LocalizedString("Pod Connections", comment: "Navigation bar title for InPlay connection info view"), displayMode: .inline) |
| 67 | + } |
| 68 | +} |
| 69 | + |
| 70 | +struct InPlayConnectionInfoView_Previews: PreviewProvider { |
| 71 | + static var previews: some View { |
| 72 | + NavigationView { |
| 73 | + InPlayConnectionInfoView() |
| 74 | + } |
| 75 | + } |
| 76 | +} |
0 commit comments