Просмотр исходного кода

Merge branch 'dev' of github.com:nightscout/Trio-dev into beta-14-fixes

Deniz Cengiz 1 год назад
Родитель
Сommit
1a2bf48911
25 измененных файлов с 235 добавлено и 80 удалено
  1. 1 1
      G7SensorKit
  2. 1 1
      LibreTransmitter
  3. 1 1
      OmniKit
  4. 1 1
      RileyLinkKit
  5. 2 2
      Trio/Sources/APS/APSManager.swift
  6. 10 2
      Trio/Sources/Application/TrioApp.swift
  7. 30 2
      Trio/Sources/Helpers/BuildDetails.swift
  8. 22 6
      Trio/Sources/Helpers/CustomProgressView.swift
  9. 99 2
      Trio/Sources/Localizations/Main/Localizable.xcstrings
  10. 1 0
      Trio/Sources/Models/NightscoutStatus.swift
  11. 2 2
      Trio/Sources/Models/TrioSettings.swift
  12. 1 1
      Trio/Sources/Modules/DataTable/View/DataTableRootView.swift
  13. 1 1
      Trio/Sources/Modules/Settings/SettingsStateModel.swift
  14. 1 1
      Trio/Sources/Modules/Settings/View/SettingsRootView.swift
  15. 8 4
      Trio/Sources/Modules/Stat/StatStateModel.swift
  16. 2 2
      Trio/Sources/Modules/Stat/View/StatRootView.swift
  17. 1 1
      Trio/Sources/Modules/Treatments/View/TreatmentsRootView.swift
  18. 6 1
      Trio/Sources/Services/Network/Nightscout/NightscoutManager.swift
  19. 1 1
      Trio/Sources/Services/RemoteControl/TrioRemoteControl+APNS.swift
  20. 18 16
      Trio/Sources/Shortcuts/Bolus/BolusIntent.swift
  21. 3 6
      Trio/Sources/Shortcuts/Bolus/BolusIntentRequest.swift
  22. 2 2
      Trio/Sources/Shortcuts/LiveActivity/RestartLiveActivityIntent.swift
  23. 16 17
      Trio/Sources/Shortcuts/Override/ApplyOverridePresetIntent.swift
  24. 3 3
      Trio/Sources/Shortcuts/Override/CancelOverrideIntent.swift
  25. 2 4
      Trio/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift

+ 1 - 1
G7SensorKit

@@ -1 +1 @@
-Subproject commit 205054e7537723c2aec58d807634b4853f687244
+Subproject commit bdfcfe83fbb9fab515a2456a4be9991420ed44bb

+ 1 - 1
LibreTransmitter

@@ -1 +1 @@
-Subproject commit a230b91a3d30c7b0d4ffbd240234b34cbaf354b1
+Subproject commit 044cf70bd79813d47048291b740a599e1ab4ab40

+ 1 - 1
OmniKit

@@ -1 +1 @@
-Subproject commit 39915b05fe46b5d73eca52e156dd7efd11193ee8
+Subproject commit 92948a7684ec382714becc53c643a1617597bb37

+ 1 - 1
RileyLinkKit

@@ -1 +1 @@
-Subproject commit a0e419da314d0ad42b41ccb04af73cd1fbf41257
+Subproject commit eddfd4f00bbf0d78035dc31e6f7715e72252c566

+ 2 - 2
Trio/Sources/APS/APSManager.swift

@@ -945,11 +945,11 @@ final class BaseAPSManager: APSManager, Injectable {
             }
             let af = pref.adjustmentFactor
             let insulin_type = pref.curve
-            let buildDate = BuildDetails.default.buildDate()
+            let buildDate = BuildDetails.shared.buildDate()
             let version = Bundle.main.releaseVersionNumber
             let build = Bundle.main.buildVersionNumber
 
-            var branch = BuildDetails.default.branchAndSha
+            var branch = BuildDetails.shared.branchAndSha
 
             let copyrightNotice_ = Bundle.main.infoDictionary?["NSHumanReadableCopyright"] as? String ?? ""
             let pump_ = pumpManager?.localizedTitle ?? ""

+ 10 - 2
Trio/Sources/Application/TrioApp.swift

@@ -80,13 +80,13 @@ extension Notification.Name {
     }
 
     init() {
-        let submodulesInfo = BuildDetails.default.submodules.map { key, value in
+        let submodulesInfo = BuildDetails.shared.submodules.map { key, value in
             "\(key): \(value.branch) \(value.commitSHA)"
         }.joined(separator: ", ")
 
         debug(
             .default,
-            "Trio Started: v\(Bundle.main.releaseVersionNumber ?? "")(\(Bundle.main.buildVersionNumber ?? "")) [buildDate: \(String(describing: BuildDetails.default.buildDate()))] [buildExpires: \(String(describing: BuildDetails.default.calculateExpirationDate()))] [submodules: \(submodulesInfo)]"
+            "Trio Started: v\(Bundle.main.releaseVersionNumber ?? "")(\(Bundle.main.buildVersionNumber ?? "")) [buildDate: \(String(describing: BuildDetails.shared.buildDate()))] [buildExpires: \(String(describing: BuildDetails.shared.calculateExpirationDate()))] [submodules: \(submodulesInfo)]"
         )
 
         // Fix bug in iOS 18 related to the translucent tab bar
@@ -127,6 +127,14 @@ extension Notification.Name {
                 }
             }
         }
+
+        Task {
+            do {
+                try await BuildDetails.shared.handleExpireDateChange()
+            } catch {
+                debug(.default, "Failed to handle expire date change: \(error)")
+            }
+        }
     }
 
     /// Attempts to initialize the CoreDataStack again after a previous failure.

+ 30 - 2
Trio/Sources/Helpers/BuildDetails.swift

@@ -1,9 +1,12 @@
 import Foundation
+import Swinject
 
-class BuildDetails {
-    static var `default` = BuildDetails()
+class BuildDetails: Injectable {
+    static var shared = BuildDetails()
+    @Injected() internal var nightscoutManager: NightscoutManager!
 
     let dict: [String: Any]
+    let previousExpireDateKey = "previousExpireDate"
 
     init() {
         guard let url = Bundle.main.url(forResource: "BuildDetails", withExtension: "plist"),
@@ -89,4 +92,29 @@ class BuildDetails {
             return String(localized: "App Expires")
         }
     }
+
+    // Upload new profile if expire date has changed
+    func handleExpireDateChange() async throws
+    {
+        if nightscoutManager == nil {
+            await injectServices(TrioApp.resolver)
+        }
+
+        let previousExpireDate = UserDefaults.standard.object(forKey: previousExpireDateKey) as? Date
+        let expireDate = calculateExpirationDate()
+
+        if previousExpireDate != expireDate {
+            debug(.nightscout, "New build expire date detected, uploading profile")
+            try await nightscoutManager.uploadProfiles()
+        }
+    }
+
+    // Store the uploaded expire date
+    func recordUploadedExpireDate(expireDate: Date?) {
+        if let expireDate = expireDate {
+            UserDefaults.standard.set(expireDate, forKey: previousExpireDateKey)
+        } else {
+            UserDefaults.standard.removeObject(forKey: previousExpireDateKey)
+        }
+    }
 }

+ 22 - 6
Trio/Sources/Helpers/CustomProgressView.swift

@@ -43,10 +43,26 @@ struct CustomProgressView: View {
     }
 }
 
-enum ProgressText: String {
-    case updatingIOB = "Updating IOB ..."
-    case updatingCOB = "Updating COB ..."
-    case updatingHistory = "Updating History ..."
-    case updatingTreatments = "Updating Treatments ..."
-    case updatingIOBandCOB = "Updating IOB and COB ..."
+enum ProgressText: CaseIterable {
+    case updatingIOB
+    case updatingCOB
+    case updatingHistory
+    case updatingTreatments
+    case updatingIOBandCOB
+
+    var displayName: String {
+        switch self {
+        case .updatingIOB:
+            return String(localized: "Updating IOB ...", comment: "Status message for updating IOB")
+        case .updatingCOB:
+
+            return String(localized: "Updating COB ...", comment: "Status message for updating COB")
+        case .updatingHistory:
+            return String(localized: "Updating History ...", comment: "Status message for updating history")
+        case .updatingTreatments:
+            return String(localized: "Updating Treatments ...", comment: "Status message for updating treatments")
+        case .updatingIOBandCOB:
+            return String(localized: "Updating IOB and COB ...", comment: "Status message for updating both IOB and COB")
+        }
+    }
 }

+ 99 - 2
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -17320,6 +17320,9 @@
         }
       }
     },
+    "A bolus command of %@ U of insulin was sent." : {
+
+    },
     "A display of On/On indicates both Dynamic ISF and CR are enabled. On/Off indicates only Dynamic ISF is enabled. Dynamic CR cannot be enabled when Dynamic ISF is disabled." : {
       "localizations" : {
         "bg" : {
@@ -18736,6 +18739,9 @@
         }
       }
     },
+    "Activate an override" : {
+
+    },
     "Activate Dynamic Carb Ratio (CR)" : {
       "comment" : "Enable Dyn CR",
       "localizations" : {
@@ -28959,6 +28965,9 @@
         }
       }
     },
+    "Allow to send a bolus to the app" : {
+
+    },
     "Allow Trio to read from and write to Apple Health." : {
       "localizations" : {
         "bg" : {
@@ -33549,6 +33558,9 @@
         }
       }
     },
+    "Applying ${bolusQuantity} U" : {
+
+    },
     "Applying ${carbQuantity} at ${dateAdded}" : {
       "localizations" : {
         "bg" : {
@@ -33749,6 +33761,9 @@
         }
       }
     },
+    "Applying ${preset} override" : {
+
+    },
     "Are you sure to add %@ g of carbs ?" : {
       "localizations" : {
         "bg" : {
@@ -33849,6 +33864,9 @@
         }
       }
     },
+    "Are you sure you want to bolus %@ U of insulin?" : {
+
+    },
     "Are you sure you want to delete %@?" : {
       "localizations" : {
         "bg" : {
@@ -39712,6 +39730,12 @@
         }
       }
     },
+    "Bolus amount (units of insulin)?" : {
+
+    },
+    "Bolus amount in U" : {
+
+    },
     "Bolus Calculator" : {
       "localizations" : {
         "bg" : {
@@ -41158,6 +41182,9 @@
         }
       }
     },
+    "Bolusing via Shortcuts is disabled in Trio settings." : {
+
+    },
     "Bottom target" : {
       "comment" : "Bottom target temp",
       "extractionState" : "manual",
@@ -43016,6 +43043,9 @@
         }
       }
     },
+    "Cancel an active override" : {
+
+    },
     "Cancel Bolus" : {
       "localizations" : {
         "bg" : {
@@ -43116,6 +43146,9 @@
         }
       }
     },
+    "Cancel override" : {
+
+    },
     "Cancel Override" : {
       "localizations" : {
         "bg" : {
@@ -51611,6 +51644,9 @@
         }
       }
     },
+    "Confirm to apply override '%@'" : {
+
+    },
     "Confirm to apply Temporary Target '%@'" : {
       "localizations" : {
         "bg" : {
@@ -88915,7 +88951,7 @@
       }
     },
     "Glucose" : {
-      "comment" : "Glucose\nHistory Mode",
+      "comment" : "Glucose\nHistory Mode\nTitle for glucose-related statistics",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -96847,6 +96883,9 @@
         }
       }
     },
+    "If toggled, you will need to confirm before applying." : {
+
+    },
     "If using Dynamic ISF (with Sigmoid), overriding your ISF will adjust the ISF used at your glucose target which extends to the ISF used at other glucose. Overriding your glucose target will change glucose level your ISF will be set to your profile ISF. Both of these can be combined in a single Override." : {
       "localizations" : {
         "bg" : {
@@ -97653,6 +97692,9 @@
         }
       }
     },
+    "Immediately applying ${bolusQuantity} U" : {
+
+    },
     "Immediately applying ${carbQuantity} at ${dateAdded}" : {
       "localizations" : {
         "bg" : {
@@ -97853,6 +97895,9 @@
         }
       }
     },
+    "Immediately applying ${preset} override" : {
+
+    },
     "Import Error" : {
       "comment" : "Import Error HeadlineImport Error Headline",
       "extractionState" : "manual",
@@ -100522,6 +100567,7 @@
       }
     },
     "Insulin" : {
+      "comment" : "Title for insulin-related statistics",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -109331,6 +109377,9 @@
         }
       }
     },
+    "Looping" : {
+      "comment" : "Title for looping and system statistics"
+    },
     "Looping Chart Type" : {
 
     },
@@ -112336,6 +112385,9 @@
         }
       }
     },
+    "Max bolus" : {
+
+    },
     "Max Bolus" : {
       "comment" : "Max setting",
       "localizations" : {
@@ -116435,7 +116487,7 @@
 
     },
     "Meals" : {
-      "comment" : "History Mode",
+      "comment" : "History Mode\nTitle for meal-related statistics",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -124485,6 +124537,9 @@
         }
       }
     },
+    "Not allowed" : {
+
+    },
     "Not paired yet" : {
       "extractionState" : "manual",
       "localizations" : {
@@ -130608,6 +130663,18 @@
         }
       }
     },
+    "Override '%@' applied" : {
+
+    },
+    "Override '%@' failed" : {
+
+    },
+    "Override canceled" : {
+
+    },
+    "Override choice" : {
+
+    },
     "Override eA1c Unit" : {
 
     },
@@ -142208,6 +142275,9 @@
     "Restart Live Activity" : {
 
     },
+    "Restarts Trio's Live Activity" : {
+
+    },
     "Result" : {
       "comment" : "For the  Bolus View pop-up",
       "localizations" : {
@@ -146931,6 +147001,9 @@
         }
       }
     },
+    "Select override" : {
+
+    },
     "Select Pump Model" : {
       "localizations" : {
         "bg" : {
@@ -165163,6 +165236,12 @@
         }
       }
     },
+    "Temporary Target '%@' applied" : {
+
+    },
+    "Temporary Target '%@' failed" : {
+
+    },
     "Temporary Target canceled" : {
       "localizations" : {
         "bg" : {
@@ -165770,6 +165849,9 @@
         }
       }
     },
+    "The bolus cannot be larger than the pump setting max bolus (%@)." : {
+
+    },
     "The current version has a critical issue and should be updated as soon as possible." : {
       "comment" : "Message for critical update alert",
       "localizations" : {
@@ -186419,6 +186501,18 @@
         }
       }
     },
+    "Updating COB ..." : {
+      "comment" : "Status message for updating COB"
+    },
+    "Updating History ..." : {
+      "comment" : "Status message for updating history"
+    },
+    "Updating IOB ..." : {
+      "comment" : "Status message for updating IOB"
+    },
+    "Updating IOB and COB ..." : {
+      "comment" : "Status message for updating both IOB and COB"
+    },
     "Updating IOB..." : {
       "comment" : "Progress text when updating IOB",
       "localizations" : {
@@ -186520,6 +186614,9 @@
         }
       }
     },
+    "Updating Treatments ..." : {
+      "comment" : "Status message for updating treatments"
+    },
     "Updating..." : {
       "comment" : "Updating Watch app",
       "extractionState" : "manual",

+ 1 - 0
Trio/Sources/Models/NightscoutStatus.swift

@@ -58,6 +58,7 @@ struct NightscoutProfileStore: JSON {
     let isAPNSProduction: Bool
     let overridePresets: [NightscoutPresetOverride]?
     let teamID: String
+    let expirationDate: Date?
 }
 
 struct NightscoutPresetOverride: JSON {

+ 2 - 2
Trio/Sources/Models/TrioSettings.swift

@@ -8,9 +8,9 @@ enum BolusShortcutLimit: String, JSON, CaseIterable, Identifiable {
     var displayName: String {
         switch self {
         case .notAllowed:
-            return String(localized: "Not allowed", table: "ShortcutsDetail")
+            return String(localized: "Not allowed")
         case .limitBolusMax:
-            return String(localized: "Max bolus", table: "ShortcutsDetail")
+            return String(localized: "Max bolus")
         }
     }
 }

+ 1 - 1
Trio/Sources/Modules/DataTable/View/DataTableRootView.swift

@@ -101,7 +101,7 @@ extension DataTable {
                 // Show custom progress view
                 /// don't show it if glucose is stale as it will block the UI
                 if state.waitForSuggestion && state.isGlucoseDataFresh(glucoseStored.first?.date) {
-                    CustomProgressView(text: progressText.rawValue)
+                    CustomProgressView(text: progressText.displayName)
                 }
             })
                 .background(appState.trioBackgroundColor(for: colorScheme))

+ 1 - 1
Trio/Sources/Modules/Settings/SettingsStateModel.swift

@@ -33,7 +33,7 @@ extension Settings {
 
             versionNumber = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown"
 
-            branch = BuildDetails.default.branchAndSha
+            branch = BuildDetails.shared.branchAndSha
 
             copyrightNotice = Bundle.main.infoDictionary?["NSHumanReadableCopyright"] as? String ?? ""
 

+ 1 - 1
Trio/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -72,7 +72,7 @@ extension Settings {
         var body: some View {
             List {
                 if searchText.isEmpty {
-                    let buildDetails = BuildDetails.default
+                    let buildDetails = BuildDetails.shared
 
                     Section(
                         header: Text("BRANCH: \(buildDetails.branchAndSha)").textCase(nil),

+ 8 - 4
Trio/Sources/Modules/Stat/StatStateModel.swift

@@ -325,10 +325,14 @@ extension Stat.StateModel {
 
         var displayName: String {
             switch self {
-            case .glucose: return "Glucose"
-            case .insulin: return "Insulin"
-            case .looping: return "Looping"
-            case .meals: return "Meals"
+            case .glucose:
+                return String(localized: "Glucose", comment: "Title for glucose-related statistics")
+            case .insulin:
+                return String(localized: "Insulin", comment: "Title for insulin-related statistics")
+            case .looping:
+                return String(localized: "Looping", comment: "Title for looping and system statistics")
+            case .meals:
+                return String(localized: "Meals", comment: "Title for meal-related statistics")
             }
         }
     }

+ 2 - 2
Trio/Sources/Modules/Stat/View/StatRootView.swift

@@ -176,7 +176,7 @@ extension Stat {
 
             Picker("Duration", selection: $state.selectedIntervalForInsulinStats) {
                 ForEach(StateModel.StatsTimeInterval.allCases) { timeInterval in
-                    Text(timeInterval.rawValue).tag(timeInterval)
+                    Text(timeInterval.displayName).tag(timeInterval)
                 }
             }
             .pickerStyle(.segmented)
@@ -316,7 +316,7 @@ extension Stat {
 
             Picker("Duration", selection: $state.selectedIntervalForMealStats) {
                 ForEach(StateModel.StatsTimeInterval.allCases, id: \.self) { timeInterval in
-                    Text(timeInterval.rawValue)
+                    Text(timeInterval.displayName)
                 }
             }
             .pickerStyle(.segmented)

+ 1 - 1
Trio/Sources/Modules/Treatments/View/TreatmentsRootView.swift

@@ -347,7 +347,7 @@ extension Treatments {
                 .blur(radius: state.isAwaitingDeterminationResult ? 5 : 0)
 
                 if state.isAwaitingDeterminationResult {
-                    CustomProgressView(text: progressText.rawValue)
+                    CustomProgressView(text: progressText.displayName)
                 }
             }
             .padding(.top)

+ 6 - 1
Trio/Sources/Services/Network/Nightscout/NightscoutManager.swift

@@ -786,6 +786,7 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
                 let isAPNSProduction = UserDefaults.standard.bool(forKey: "isAPNSProduction")
                 let presetOverrides = try await overridesStorage.getPresetOverridesForNightscout()
                 let teamID = Bundle.main.object(forInfoDictionaryKey: "TeamID") as? String ?? ""
+                let expireDate = BuildDetails.shared.calculateExpirationDate()
 
                 let profileStore = NightscoutProfileStore(
                     defaultProfile: defaultProfile,
@@ -798,7 +799,8 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
                     deviceToken: deviceToken,
                     isAPNSProduction: isAPNSProduction,
                     overridePresets: presetOverrides,
-                    teamID: teamID
+                    teamID: teamID,
+                    expirationDate: expireDate
                 )
 
                 guard let nightscout = nightscoutAPI, isNetworkReachable else {
@@ -810,6 +812,9 @@ final class BaseNightscoutManager: NightscoutManager, Injectable {
                 }
 
                 try await nightscout.uploadProfile(profileStore)
+
+                BuildDetails.shared.recordUploadedExpireDate(expireDate: expireDate)
+
                 debug(.nightscout, "Profile uploaded")
             } catch {
                 debug(.nightscout, "NightscoutManager uploadProfile: \(error.localizedDescription)")

+ 1 - 1
Trio/Sources/Services/RemoteControl/TrioRemoteControl+APNS.swift

@@ -28,6 +28,6 @@ extension TrioRemoteControl {
     }
 
     private func isRunningInAPNSProductionEnvironment() -> Bool {
-        BuildDetails.default.isTestFlightBuild()
+        BuildDetails.shared.isTestFlightBuild()
     }
 }

+ 18 - 16
Trio/Sources/Shortcuts/Bolus/BolusIntent.swift

@@ -5,38 +5,39 @@ import Swinject
 
 @available(iOS 16.0,*) struct BolusIntent: AppIntent {
     // Title of the action in the Shortcuts app
-    static var title = LocalizedStringResource("Enact Bolus", table: "ShortcutsDetail")
+    static var title = LocalizedStringResource("Enact Bolus")
 
     // Description of the action in the Shortcuts app
-    static var description = IntentDescription(.init("Allow to send a bolus to the app", table: "ShortcutsDetail"))
+    static var description = IntentDescription(.init("Allow to send a bolus to the app"))
 
     @Parameter(
-        title: LocalizedStringResource("Amount", table: "ShortcutsDetail"),
-        description: LocalizedStringResource("Bolus amount in U", table: "ShortcutsDetail"),
+        title: LocalizedStringResource("Amount"),
+        description: LocalizedStringResource("Bolus amount in U"),
         controlStyle: .field,
         /// The 200 upperBound does nothing here, the true max is set based on pump max
         /// An upperBound is specificed so that we can usethe lowerBound of 0, which ensures no negatives are allowed
         /// A preferred approach would be to just block negatives and not specify an upperBound here, since it is implemented elsewhere
         inclusiveRange: (lowerBound: 0, upperBound: 200),
-        requestValueDialog: IntentDialog(LocalizedStringResource(
-            "Bolus amount (units of insulin)?",
-            table: "ShortcutsDetail"
-        ))
+        requestValueDialog: IntentDialog(
+            LocalizedStringResource(
+                "Bolus amount (units of insulin)?"
+            )
+        )
     ) var bolusQuantity: Double
 
     @Parameter(
-        title: LocalizedStringResource("Confirm Before applying", table: "ShortcutsDetail"),
-        description: LocalizedStringResource("If toggled, you will need to confirm before applying.", table: "ShortcutsDetail"),
+        title: LocalizedStringResource("Confirm Before applying"),
+        description: LocalizedStringResource("If toggled, you will need to confirm before applying."),
         default: true
     ) var confirmBeforeApplying: Bool
 
     static var parameterSummary: some ParameterSummary {
         When(\.$confirmBeforeApplying, .equalTo, true, {
-            Summary("Applying \(\.$bolusQuantity) U", table: "ShortcutsDetail") {
+            Summary("Applying \(\.$bolusQuantity) U") {
                 \.$confirmBeforeApplying
             }
         }, otherwise: {
-            Summary("Immediately applying \(\.$bolusQuantity) U", table: "ShortcutsDetail") {
+            Summary("Immediately applying \(\.$bolusQuantity) U") {
                 \.$confirmBeforeApplying
             }
         })
@@ -50,10 +51,11 @@ import Swinject
             if confirmBeforeApplying {
                 try await requestConfirmation(
                     result: .result(
-                        dialog: IntentDialog(LocalizedStringResource(
-                            "Are you sure you want to bolus \(bolusFormatted) U of insulin?",
-                            table: "ShortcutsDetail"
-                        ))
+                        dialog: IntentDialog(
+                            LocalizedStringResource(
+                                "Are you sure you want to bolus \(bolusFormatted) U of insulin?"
+                            )
+                        )
                     )
                 )
             }

+ 3 - 6
Trio/Sources/Shortcuts/Bolus/BolusIntentRequest.swift

@@ -9,24 +9,21 @@ import Foundation
         // Block boluses if they are disabled
         case .notAllowed:
             return LocalizedStringResource(
-                "Bolusing via Shortcuts is disabled in Trio settings.",
-                table: "ShortcutsDetail"
+                "Bolusing via Shortcuts is disabled in Trio settings."
             )
 
         // Block any bolus attempted if it is larger than the max bolus in settings
         case .limitBolusMax:
             if Decimal(bolusAmount) > settingsManager.pumpSettings.maxBolus {
                 return LocalizedStringResource(
-                    "The bolus cannot be larger than the pump setting max bolus (\(settingsManager.pumpSettings.maxBolus.description)).",
-                    table: "ShortcutsDetail"
+                    "The bolus cannot be larger than the pump setting max bolus (\(settingsManager.pumpSettings.maxBolus.description))."
                 )
             } else {
                 bolusQuantity = apsManager.roundBolus(amount: Decimal(bolusAmount))
             }
             await apsManager.enactBolus(amount: Double(bolusQuantity), isSMB: false, callback: nil)
             return LocalizedStringResource(
-                "A bolus command of \(bolusQuantity.formatted()) U of insulin was sent.",
-                table: "ShortcutsDetail"
+                "A bolus command of \(bolusQuantity.formatted()) U of insulin was sent."
             )
         }
     }

+ 2 - 2
Trio/Sources/Shortcuts/LiveActivity/RestartLiveActivityIntent.swift

@@ -6,10 +6,10 @@ import Foundation
 /// dependencies injected via Swinject, and calls the restart functionality.
 @available(iOS 16.2, *) struct RestartLiveActivityIntent: LiveActivityIntent {
     /// Title of the action in the Shortcuts app.
-    static var title = LocalizedStringResource("Restart Live Activity", table: "ShortcutsDetail")
+    static var title = LocalizedStringResource("Restart Live Activity")
 
     /// Description of the action in the Shortcuts app.
-    static var description = IntentDescription(.init("Restarts Trio's Live Activity", table: "ShortcutsDetail"))
+    static var description = IntentDescription(.init("Restarts Trio's Live Activity"))
 
     /// Performs the intent by triggering the live activity restart.
     ///

+ 16 - 17
Trio/Sources/Shortcuts/Override/ApplyOverridePresetIntent.swift

@@ -4,32 +4,32 @@ import Foundation
 /// An App Intent that allows users to activate an override preset through the Shortcuts app.
 struct ApplyOverridePresetIntent: AppIntent {
     /// The title displayed for this action in the Shortcuts app.
-    static var title = LocalizedStringResource("Activate an override", table: "ShortcutsDetail")
+    static var title = LocalizedStringResource("Activate an override")
 
     /// The description displayed for this action in the Shortcuts app.
-    static var description = IntentDescription(.init("Activate an override", table: "ShortcutsDetail"))
+    static var description = IntentDescription(.init("Activate an override"))
 
     /// The override preset to be applied.
     @Parameter(
-        title: LocalizedStringResource("Override", table: "ShortcutsDetail"),
-        description: LocalizedStringResource("Override choice", table: "ShortcutsDetail")
+        title: LocalizedStringResource("Override"),
+        description: LocalizedStringResource("Override choice")
     ) var preset: OverridePreset?
 
     /// A boolean parameter that determines whether confirmation is required before applying the override.
     @Parameter(
-        title: LocalizedStringResource("Confirm Before applying", table: "ShortcutsDetail"),
-        description: LocalizedStringResource("If toggled, you will need to confirm before applying", table: "ShortcutsDetail"),
+        title: LocalizedStringResource("Confirm Before applying"),
+        description: LocalizedStringResource("If toggled, you will need to confirm before applying"),
         default: true
     ) var confirmBeforeApplying: Bool
 
     /// Defines the summary format shown in the Shortcuts app when configuring this intent.
     static var parameterSummary: some ParameterSummary {
         When(\ApplyOverridePresetIntent.$confirmBeforeApplying, .equalTo, true, {
-            Summary("Applying \(\.$preset) override", table: "ShortcutsDetail") {
+            Summary("Applying \(\.$preset) override") {
                 \.$confirmBeforeApplying
             }
         }, otherwise: {
-            Summary("Immediately applying \(\.$preset) override", table: "ShortcutsDetail") {
+            Summary("Immediately applying \(\.$preset) override") {
                 \.$confirmBeforeApplying
             }
         })
@@ -49,7 +49,7 @@ struct ApplyOverridePresetIntent: AppIntent {
                 // Request user selection if no preset is provided
                 presetToApply = try await $preset.requestDisambiguation(
                     among: await OverridePresetsIntentRequest().fetchAndProcessOverrides(),
-                    dialog: IntentDialog(LocalizedStringResource("Select override", table: "ShortcutsDetail"))
+                    dialog: IntentDialog(LocalizedStringResource("Select override"))
                 )
             }
 
@@ -59,10 +59,11 @@ struct ApplyOverridePresetIntent: AppIntent {
             if confirmBeforeApplying {
                 try await requestConfirmation(
                     result: .result(
-                        dialog: IntentDialog(LocalizedStringResource(
-                            "Confirm to apply override '\(displayName)'",
-                            table: "ShortcutsDetail"
-                        ))
+                        dialog: IntentDialog(
+                            LocalizedStringResource(
+                                "Confirm to apply override '\(displayName)'"
+                            )
+                        )
                     )
                 )
             }
@@ -72,8 +73,7 @@ struct ApplyOverridePresetIntent: AppIntent {
                 return .result(
                     dialog: IntentDialog(
                         LocalizedStringResource(
-                            "Override '\(presetToApply.name)' applied",
-                            table: "ShortcutsDetail"
+                            "Override '\(presetToApply.name)' applied"
                         )
                     )
                 )
@@ -81,8 +81,7 @@ struct ApplyOverridePresetIntent: AppIntent {
                 return .result(
                     dialog: IntentDialog(
                         LocalizedStringResource(
-                            "Override '\(presetToApply.name)' failed",
-                            table: "ShortcutsDetail"
+                            "Override '\(presetToApply.name)' failed"
                         )
                     )
                 )

+ 3 - 3
Trio/Sources/Shortcuts/Override/CancelOverrideIntent.swift

@@ -4,10 +4,10 @@ import Foundation
 /// An App Intent that allows users to cancel an active override through the Shortcuts app.
 struct CancelOverrideIntent: AppIntent {
     /// The title displayed for this action in the Shortcuts app.
-    static var title = LocalizedStringResource("Cancel override", table: "ShortcutsDetail")
+    static var title = LocalizedStringResource("Cancel override")
 
     /// The description displayed for this action in the Shortcuts app.
-    static var description = IntentDescription(.init("Cancel an active override", table: "ShortcutsDetail"))
+    static var description = IntentDescription(.init("Cancel an active override"))
 
     /// Performs the intent action to cancel an active override.
     ///
@@ -16,7 +16,7 @@ struct CancelOverrideIntent: AppIntent {
     @MainActor func perform() async throws -> some ProvidesDialog {
         await OverridePresetsIntentRequest().cancelOverride()
         return .result(
-            dialog: IntentDialog(LocalizedStringResource("Override canceled", table: "ShortcutsDetail"))
+            dialog: IntentDialog(LocalizedStringResource("Override canceled"))
         )
     }
 }

+ 2 - 4
Trio/Sources/Shortcuts/TempPresets/ApplyTempPresetIntent.swift

@@ -80,8 +80,7 @@ struct ApplyTempPresetIntent: AppIntent {
                 return .result(
                     dialog: IntentDialog(
                         LocalizedStringResource(
-                            "Temporary Target '\(presetToApply.name)' applied",
-                            table: "ShortcutsDetail"
+                            "Temporary Target '\(presetToApply.name)' applied"
                         )
                     )
                 )
@@ -89,8 +88,7 @@ struct ApplyTempPresetIntent: AppIntent {
                 return .result(
                     dialog: IntentDialog(
                         LocalizedStringResource(
-                            "Temporary Target '\(presetToApply.name)' failed",
-                            table: "ShortcutsDetail"
+                            "Temporary Target '\(presetToApply.name)' failed"
                         )
                     )
                 )