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

Address feedback by @t1dude and @ebouchut

Deniz Cengiz 1 год назад
Родитель
Сommit
063aedc3e0

+ 22 - 1
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -36792,6 +36792,9 @@
     "App Diagnostics" : {
 
     },
+    "App diagnostics sharing, Nightscout setup, and unit and pump model selection are all complete." : {
+
+    },
     "App Expires" : {
       "localizations" : {
         "bg" : {
@@ -69577,7 +69580,7 @@
         }
       }
     },
-    "Define your glucose target, basal rates, carb ratios, and insulin sensitivity." : {
+    "Define your glucose targets, basal rates, carb ratios, and insulin sensitivities." : {
 
     },
     "Delay between fat & protein entry and first FPU entry." : {
@@ -73827,6 +73830,9 @@
         }
       }
     },
+    "Disable Sharing" : {
+
+    },
     "Disable SMBs" : {
       "localizations" : {
         "bg" : {
@@ -82837,6 +82843,9 @@
         }
       }
     },
+    "Enable Sharing" : {
+
+    },
     "Enable SMB After Carbs" : {
       "comment" : "Enable SMB After Carbs",
       "localizations" : {
@@ -101066,6 +101075,9 @@
         }
       }
     },
+    "Glucose target, basal rates, carb ratios, and insulin sensitivity match your needs." : {
+
+    },
     "Glucose Targets" : {
       "localizations" : {
         "bg" : {
@@ -163006,6 +163018,9 @@
         }
       }
     },
+    "Safety boundaries for insulin delivery and carb entries are set to help Trio keep you safe." : {
+
+    },
     "Save" : {
       "comment" : "Save preset namebutton title for saving low reservoir reminder",
       "localizations" : {
@@ -193922,6 +193937,9 @@
         }
       }
     },
+    "This is a safety limitation to avoid high SMB doses when glucose is rising abnormally fast, such as after a meal or with a very jumpy CGM sensor." : {
+
+    },
     "This is a setting for default carb absorption impact per 5 minutes. The default is an expected 8 mg/dL/5min. This affects how fast COB is decayed in situations when carb absorption is not visible in BG deviations. The default of 8 mg/dL/5min corresponds to a minimum carb absorption rate of 24g/hr at a CSF of 4 mg/dL/g." : {
       "comment" : "\"Min 5m Carbimpact\"",
       "extractionState" : "manual",
@@ -206543,6 +206561,9 @@
         }
       }
     },
+    "Trio’s algorithm features are customized to fit your preferences and needs." : {
+
+    },
     "Trio's Onboarding takes about 15-30 minutes to complete. We'll guide you through each step." : {
 
     },

+ 2 - 1
Trio/Sources/Modules/AppDiagnostics/View/PrivacyPolicyView.swift

@@ -213,6 +213,7 @@ struct PrivacyPolicyView: View {
                 .font(.footnote)
                 .foregroundStyle(Color.secondary)
                 .listRowBackground(Color.clear)
+                .fixedSize(horizontal: false, vertical: true)
                 .multilineTextAlignment(.leading)
             }
             .scrollContentBackground(.hidden)
@@ -227,6 +228,6 @@ struct PrivacyPolicyView: View {
             }
             .buttonStyle(.bordered)
             .padding([.top, .horizontal])
-        }
+        }.ignoresSafeArea(edges: .top)
     }
 }

+ 1 - 1
Trio/Sources/Modules/Onboarding/OnboardingStateModel.swift

@@ -106,7 +106,7 @@ extension Onboarding {
 
         var autosensMin: Decimal = 0.7
         var autosensMax: Decimal = 1.2
-        var rewindResetsAutosens: Bool = false
+        var rewindResetsAutosens: Bool = true
         var enableSMBAlways: Bool = false
         var enableSMBWithCOB: Bool = false
         var enableSMBWithTempTarget: Bool = false

+ 10 - 4
Trio/Sources/Modules/Onboarding/View/OnboardingSteps/CompletedStepView.swift

@@ -24,7 +24,9 @@ struct CompletedStepView: View {
                     stepIndex: 1,
                     title: String(localized: "Prepare Trio"),
                     steps: [.diagnostics, .nightscout, .unitSelection],
-                    description: "App diagnostics sharing, Nightscout setup, and unit and pump model selection are all complete."
+                    description: String(
+                        localized: "App diagnostics sharing, Nightscout setup, and unit and pump model selection are all complete."
+                    )
                 )
 
                 Divider()
@@ -33,7 +35,9 @@ struct CompletedStepView: View {
                     stepIndex: 2,
                     title: String(localized: "Therapy Settings"),
                     steps: [.glucoseTarget, .basalRates, .carbRatio, .insulinSensitivity],
-                    description: "Glucose target, basal rates, carb ratios, and insulin sensitivity match your needs."
+                    description: String(
+                        localized: "Glucose target, basal rates, carb ratios, and insulin sensitivity match your needs."
+                    )
                 )
 
                 Divider()
@@ -42,7 +46,9 @@ struct CompletedStepView: View {
                     stepIndex: 3,
                     title: String(localized: "Delivery Limits"),
                     steps: [.deliveryLimits],
-                    description: "Safety boundaries for insulin delivery and carb entries are set to help Trio keep you safe."
+                    description: String(
+                        localized: "Safety boundaries for insulin delivery and carb entries are set to help Trio keep you safe."
+                    )
                 )
 
                 Divider()
@@ -51,7 +57,7 @@ struct CompletedStepView: View {
                     stepIndex: 4,
                     title: String(localized: "Algorithm Settings"),
                     steps: [.autosensSettings, .smbSettings, .targetBehavior],
-                    description: "Trio’s algorithm features are customized to fit your preferences and needs."
+                    description: String(localized: "Trio’s algorithm features are customized to fit your preferences and needs.")
                 )
             }
             .padding()

+ 1 - 1
Trio/Sources/Modules/Onboarding/View/OnboardingSteps/OverviewStepView.swift

@@ -30,7 +30,7 @@ struct OverviewStepView: View {
                     title: String(localized: "Therapy Settings"),
                     duration: "5-10",
                     description: String(
-                        localized: "Define your glucose target, basal rates, carb ratios, and insulin sensitivity."
+                        localized: "Define your glucose targets, basal rates, carb ratios, and insulin sensitivities."
                     )
                 )
 

+ 4 - 1
Trio/Sources/Modules/Onboarding/View/OnboardingSteps/UnitSelectionStepView.swift

@@ -30,9 +30,12 @@ struct UnitSelectionStepView: View {
                         Text(pumpModel.displayName).tag(pumpModel)
                     }
                 }
-                .onChange(of: state.pumpOptionForOnboardingUnits, { _, _ in
+                .onChange(of: state.pumpOptionForOnboardingUnits, { _, newValue in
                     // Reset basal profile and related values when pump model changes
                     state.basalProfileItems = []
+
+                    // Conditionally set rewind setting, if pump model is MDT
+                    state.rewindResetsAutosens = newValue == .minimed
                 })
             }
             .padding()

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

@@ -283,10 +283,8 @@ enum AlgorithmSettingsSubstep: Int, CaseIterable, Identifiable {
         case .maxSMBMinutes:
             return VStack(spacing: 8) {
                 VStack(alignment: .leading, spacing: 8) {
-                    VStack(alignment: .leading, spacing: 1) {
-                        Text("Default: 30 minutes").bold().foregroundStyle(Color.primary)
-                        Text("(50% current basal rate)")
-                    }
+                    Text("Default: 30 minutes").bold().foregroundStyle(Color.primary)
+                    Text("(50% current basal rate)")
                     VStack(alignment: .leading, spacing: 8) {
                         Text(
                             "This is a limit on the size of a single SMB. One SMB can only be as large as this many minutes of your current profile basal rate."
@@ -313,10 +311,8 @@ enum AlgorithmSettingsSubstep: Int, CaseIterable, Identifiable {
         case .maxUAMMinutes:
             return VStack(spacing: 8) {
                 VStack(alignment: .leading, spacing: 8) {
-                    VStack(alignment: .leading, spacing: 1) {
-                        Text("Default: 30 minutes").bold().foregroundStyle(Color.primary)
-                        Text("(50% current basal rate)")
-                    }
+                    Text("Default: 30 minutes").bold().foregroundStyle(Color.primary)
+                    Text("(50% current basal rate)")
 
                     VStack(alignment: .leading, spacing: 8) {
                         Text(
@@ -346,6 +342,9 @@ enum AlgorithmSettingsSubstep: Int, CaseIterable, Identifiable {
                 Text(
                     "Maximum allowed positive percent change in glucose level to permit SMBs. If the difference in glucose is greater than this, Trio will disable SMBs."
                 )
+                Text(
+                    "This is a safety limitation to avoid high SMB doses when glucose is rising abnormally fast, such as after a meal or with a very jumpy CGM sensor."
+                )
                 Text("Note: This setting has a hard-coded cap of 40%")
             }
         case .highTempTargetRaisesSensitivity:

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

@@ -347,9 +347,9 @@ enum DiagnosticsSharingOption: String, Equatable, CaseIterable, Identifiable {
     var displayName: String {
         switch self {
         case .enabled:
-            return "Enable Sharing"
+            return String(localized: "Enable Sharing")
         case .disabled:
-            return "Disable Sharing"
+            return String(localized: "Disable Sharing")
         }
     }
 }
@@ -433,6 +433,8 @@ struct BulletPoint: View {
         HStack(alignment: .top) {
             Text("•")
             Text(text)
+                .fixedSize(horizontal: false, vertical: true)
+                .multilineTextAlignment(.leading)
         }
     }
 }

+ 3 - 0
Trio/Sources/Modules/SMBSettings/View/SMBSettingsRootView.swift

@@ -343,6 +343,9 @@ extension SMBSettings {
                         Text(
                             "Maximum allowed positive percent change in glucose level to permit SMBs. If the difference in glucose is greater than this, Trio will disable SMBs."
                         )
+                        Text(
+                            "This is a safety limitation to avoid high SMB doses when glucose is rising abnormally fast, such as after a meal or with a very jumpy CGM sensor."
+                        )
                         Text("Note: This setting has a hard-coded cap of 40%")
                     }
                 )