Przeglądaj źródła

Various
* Reorder therapy settings to conform to onboarding step order
* Rename basal profile to basal rates, to conform with therapy settings
* Adjust delivery limits step description
* Move enum to OnboardingView+Util, rename it
* Add 'Delivery Limits' as searchable setting item

Deniz Cengiz 1 rok temu
rodzic
commit
1c3d1a6b15

+ 4 - 6
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -42588,6 +42588,7 @@
       }
     },
     "Basal Profile" : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -49961,9 +49962,6 @@
         }
       }
     },
-    "Carbohydrate Ratio" : {
-
-    },
     "Carbohydrates" : {
       "localizations" : {
         "bg" : {
@@ -204571,6 +204569,9 @@
         }
       }
     },
+    "Trio includes several safety limits for insulin delivery and carbohydrate entry, helping ensure a safe and effective experience." : {
+
+    },
     "Trio Information Notifications" : {
       "localizations" : {
         "bg" : {
@@ -205178,9 +205179,6 @@
         }
       }
     },
-    "Trio offers various delivery limits which represent the maximum amount of insulin it can deliver at a time. This helps ensure safe and effective experience." : {
-
-    },
     "Trio Personalization" : {
       "localizations" : {
         "bg" : {

+ 1 - 1
Trio/Sources/Modules/BasalProfileEditor/View/BasalProfileEditorRootView.swift

@@ -176,7 +176,7 @@ extension BasalProfileEditor {
                 state.calculateChartData()
             }
             .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
-            .navigationTitle("Basal Profile")
+            .navigationTitle("Basal Rates")
             .navigationBarTitleDisplayMode(.automatic)
             .toolbar(content: {
                 ToolbarItem(placement: .topBarTrailing) {

+ 16 - 10
Trio/Sources/Modules/Onboarding/View/OnboardingView+Util.swift

@@ -1,5 +1,11 @@
 import SwiftUI
 
+/// Represents the navigation direction in the onboarding flow
+enum OnboardingNavigationDirection {
+    case forward
+    case backward
+}
+
 /// Represents the different steps in the onboarding process.
 enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
     case welcome
@@ -7,7 +13,7 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
     case nightscout
     case unitSelection
     case glucoseTarget
-    case basalProfile
+    case basalRates
     case carbRatio
     case insulinSensitivity
     case deliveryLimits
@@ -36,13 +42,13 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
         case .unitSelection:
             return String(localized: "Units & Pump")
         case .glucoseTarget:
-            return String(localized: "Glucose Target")
-        case .basalProfile:
-            return String(localized: "Basal Profile")
+            return String(localized: "Glucose Targets")
+        case .basalRates:
+            return String(localized: "Basal Rates")
         case .carbRatio:
-            return String(localized: "Carbohydrate Ratio")
+            return String(localized: "Carb Ratios")
         case .insulinSensitivity:
-            return String(localized: "Insulin Sensitivity")
+            return String(localized: "Insulin Sensitivities")
         case .deliveryLimits:
             return String(localized: "Delivery Limits")
         case .completed:
@@ -73,7 +79,7 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
             return String(
                 localized: "Your glucose target is the blood glucose level you aim to maintain. Trio will use this to calculate insulin doses and provide recommendations."
             )
-        case .basalProfile:
+        case .basalRates:
             return String(
                 localized: "Your basal profile represents the amount of background insulin you need throughout the day. This helps Trio calculate your insulin needs."
             )
@@ -87,7 +93,7 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
             )
         case .deliveryLimits:
             return String(
-                localized: "Trio offers various delivery limits which represent the maximum amount of insulin it can deliver at a time. This helps ensure safe and effective experience."
+                localized: "Trio includes several safety limits for insulin delivery and carbohydrate entry, helping ensure a safe and effective experience."
             )
         case .completed:
             return String(
@@ -109,7 +115,7 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
             return "numbers.rectangle"
         case .glucoseTarget:
             return "target"
-        case .basalProfile:
+        case .basalRates:
             return "chart.xyaxis.line"
         case .carbRatio:
             return "fork.knife"
@@ -150,7 +156,7 @@ enum OnboardingStep: Int, CaseIterable, Identifiable, Equatable {
             return Color.blue
         case .glucoseTarget:
             return Color.green
-        case .basalProfile:
+        case .basalRates:
             return Color.purple
         case .carbRatio:
             return Color.orange

+ 2 - 7
Trio/Sources/Modules/Onboarding/View/OnboardingView.swift

@@ -3,15 +3,10 @@ import Swinject
 
 /// The main onboarding view that manages navigation between onboarding steps.
 extension Onboarding {
-    private enum NavigationDirection {
-        case forward
-        case backward
-    }
-
     struct RootView: BaseView {
         let resolver: Resolver
         @State var state = StateModel()
-        @State private var navigationDirection: NavigationDirection = .forward
+        @State private var navigationDirection: OnboardingNavigationDirection = .forward
         let onboardingManager: OnboardingManager
         @State private var currentStep: OnboardingStep = .welcome
         @State private var currentDeliverySubstep: DeliveryLimitSubstep = .maxIOB
@@ -151,7 +146,7 @@ extension Onboarding {
                                             UnitSelectionStepView(state: state)
                                         case .glucoseTarget:
                                             GlucoseTargetStepView(state: state)
-                                        case .basalProfile:
+                                        case .basalRates:
                                             BasalProfileStepView(state: state)
                                         case .carbRatio:
                                             CarbRatioStepView(state: state)

+ 9 - 1
Trio/Sources/Modules/Settings/SettingItems.swift

@@ -65,7 +65,15 @@ enum SettingItems {
         SettingItem(
             title: "Units and Limits",
             view: .unitsAndLimits,
-            searchContents: ["Glucose Units", "Max Basal", "Max Bolus", "Max IOB", "Max COB", "Minimum Safety Threshold"],
+            searchContents: [
+                "Glucose Units",
+                "Max Basal",
+                "Max Bolus",
+                "Max IOB",
+                "Max COB",
+                "Minimum Safety Threshold",
+                "Delivery Limits"
+            ],
             path: ["Therapy Settings", "Units and Limits"]
         ),
         SettingItem(title: "Basal Rates", view: .basalProfileEditor, path: ["Therapy Settings"]),

+ 2 - 2
Trio/Sources/Modules/Settings/View/Subviews/TherapySettingsView.swift

@@ -29,10 +29,10 @@ struct TherapySettingsView: BaseView {
             Section(
                 header: Text("Basic Insulin Rates & Targets"),
                 content: {
+                    Text("Glucose Targets").navigationLink(to: .targetsEditor, from: self)
                     Text("Basal Rates").navigationLink(to: .basalProfileEditor, from: self)
-                    Text("Insulin Sensitivities").navigationLink(to: .isfEditor, from: self)
                     Text("Carb Ratios").navigationLink(to: .crEditor, from: self)
-                    Text("Glucose Targets").navigationLink(to: .targetsEditor, from: self)
+                    Text("Insulin Sensitivities").navigationLink(to: .isfEditor, from: self)
                 }
             )
             .listRowBackground(Color.chart)