Browse Source

Add scroll targets and fix search index labels for settings search

Gordon Child 1 month ago
parent
commit
6aab0ae5b0

+ 35 - 8
Trio/Sources/Modules/Settings/SettingItems.swift

@@ -100,6 +100,12 @@ enum SettingItems {
                 "Minimum Safety Threshold",
                 "Minimum Safety Threshold",
                 "Delivery Limits"
                 "Delivery Limits"
             ],
             ],
+            scrollTargetLabels: [
+                "Max IOB": "Maximum Insulin on Board (IOB)",
+                "Max Bolus": "Maximum Bolus",
+                "Max Basal": "Maximum Basal Rate",
+                "Max COB": "Maximum Carbs on Board (COB)"
+            ],
             path: ["Therapy Settings", "Units and Limits"]
             path: ["Therapy Settings", "Units and Limits"]
         ),
         ),
         SettingItem(title: "Basal Rates", view: .basalProfileEditor, path: ["Therapy Settings"]),
         SettingItem(title: "Basal Rates", view: .basalProfileEditor, path: ["Therapy Settings"]),
@@ -133,6 +139,11 @@ enum SettingItems {
                 "Max UAM SMB Basal Minutes",
                 "Max UAM SMB Basal Minutes",
                 "Max Allowed Glucose Rise for SMB"
                 "Max Allowed Glucose Rise for SMB"
             ],
             ],
+            scrollTargetLabels: [
+                "Enable SMB With Temporary Target": "Enable SMB With Temptarget",
+                "Allow SMB With High Temporary Target": "Allow SMB With High Temptarget",
+                "Max UAM SMB Basal Minutes": "Max UAM Basal Minutes"
+            ],
             path: ["Algorithm", "Super Micro Bolus (SMB)"]
             path: ["Algorithm", "Super Micro Bolus (SMB)"]
         ),
         ),
         SettingItem(
         SettingItem(
@@ -159,6 +170,10 @@ enum SettingItems {
                 "Resistance Lowers Target",
                 "Resistance Lowers Target",
                 "Half Basal Exercise Target"
                 "Half Basal Exercise Target"
             ],
             ],
+            scrollTargetLabels: [
+                "High Temptarget Raises Sensitivity": "High Temp Target Raises Sensitivity",
+                "Low Temptarget Lowers Sensitivity": "Low Temp Target Lowers Sensitivity"
+            ],
             path: ["Algorithm", "Target Behavior"]
             path: ["Algorithm", "Target Behavior"]
         ),
         ),
         SettingItem(
         SettingItem(
@@ -179,6 +194,11 @@ enum SettingItems {
                 "Remaining Carbs Cap",
                 "Remaining Carbs Cap",
                 "Noisy CGM Target Multiplier"
                 "Noisy CGM Target Multiplier"
             ],
             ],
+            scrollTargetLabels: [
+                "Min 5m Carbimpact": "Min 5m Carb Impact",
+                "Remaining Carbs Fraction": "Remaining Carbs Percentage",
+                "Noisy CGM Target Multiplier": "Noisy CGM Target Increase"
+            ],
             path: ["Algorithm", "Additionals"]
             path: ["Algorithm", "Additionals"]
         )
         )
     ]
     ]
@@ -190,10 +210,10 @@ enum SettingItems {
             searchContents: [
             searchContents: [
                 "Display Meal Presets",
                 "Display Meal Presets",
                 "Recommended Bolus Percentage",
                 "Recommended Bolus Percentage",
-                "Enable Reduced Bolus Factor",
-                "Reduced Bolus Factor",
-                "Enable Super Bolus",
-                "Super Bolus Factor",
+                "Enable Reduced Bolus Option",
+                "Reduced Bolus Percentage",
+                "Enable Super Bolus Option",
+                "Super Bolus Percentage",
                 "Very Low Glucose Warning"
                 "Very Low Glucose Warning"
             ],
             ],
             path: ["Features", "Bolus Calculator"]
             path: ["Features", "Bolus Calculator"]
@@ -235,7 +255,6 @@ enum SettingItems {
                 "Show Low and High Thresholds",
                 "Show Low and High Thresholds",
                 "Low Threshold",
                 "Low Threshold",
                 "High Threshold",
                 "High Threshold",
-                "X-Axis Interval Step",
                 "eA1c/GMI Display Unit",
                 "eA1c/GMI Display Unit",
                 "Show Carbs Required Badge",
                 "Show Carbs Required Badge",
                 "Carbs Required Threshold",
                 "Carbs Required Threshold",
@@ -243,16 +262,24 @@ enum SettingItems {
                 "Bolus Display Threshold",
                 "Bolus Display Threshold",
                 "Cone",
                 "Cone",
                 "Lines",
                 "Lines",
+                "Appearance",
                 "Dark Mode",
                 "Dark Mode",
                 "Light Mode",
                 "Light Mode",
-                "Appearance",
-                "Dark Scheme",
-                "Light Scheme",
                 "Glucose Color Scheme",
                 "Glucose Color Scheme",
                 "Time in Range Type",
                 "Time in Range Type",
                 "Time in Tight Range (TITR)",
                 "Time in Tight Range (TITR)",
                 "Time in Normoglycemia (TING)"
                 "Time in Normoglycemia (TING)"
             ],
             ],
+            scrollTargetLabels: [
+                "Show Y-Axis Grid Lines": "Show X-Axis Grid Lines",
+                "High Threshold": "Low Threshold",
+                "Cone": "Forecast Display Type",
+                "Lines": "Forecast Display Type",
+                "Dark Mode": "Appearance",
+                "Light Mode": "Appearance",
+                "Time in Tight Range (TITR)": "Time in Range Type",
+                "Time in Normoglycemia (TING)": "Time in Range Type"
+            ],
             path: ["Features", "User Interface"]
             path: ["Features", "User Interface"]
         ),
         ),
         SettingItem(
         SettingItem(

+ 9 - 8
Trio/Sources/Modules/UserInterfaceSettings/View/UserInterfaceSettingsRootView.swift

@@ -96,7 +96,7 @@ extension UserInterfaceSettings {
                             }.padding(.top)
                             }.padding(.top)
                         }.padding(.bottom)
                         }.padding(.bottom)
                     }
                     }
-                ).listRowBackground(Color.chart)
+                ).settingsSearchTarget(label: String(localized: "Appearance"))
 
 
                 Section {
                 Section {
                     VStack {
                     VStack {
@@ -154,7 +154,7 @@ extension UserInterfaceSettings {
                             ).buttonStyle(BorderlessButtonStyle())
                             ).buttonStyle(BorderlessButtonStyle())
                         }.padding(.top)
                         }.padding(.top)
                     }.padding(.bottom)
                     }.padding(.bottom)
-                }.listRowBackground(Color.chart)
+                }.settingsSearchTarget(label: String(localized: "Glucose Color Scheme"))
 
 
                 Section(
                 Section(
                     header: Text("Home View Settings"),
                     header: Text("Home View Settings"),
@@ -189,7 +189,7 @@ extension UserInterfaceSettings {
                             }.padding(.top)
                             }.padding(.top)
                         }.padding(.vertical)
                         }.padding(.vertical)
                     }
                     }
-                ).listRowBackground(Color.chart)
+                ).settingsSearchTarget(label: String(localized: "Show X-Axis Grid Lines"))
 
 
                 SettingInputSection(
                 SettingInputSection(
                     decimalValue: $decimalPlaceholder,
                     decimalValue: $decimalPlaceholder,
@@ -319,7 +319,7 @@ extension UserInterfaceSettings {
                                 ).buttonStyle(BorderlessButtonStyle())
                                 ).buttonStyle(BorderlessButtonStyle())
                             }.padding(.top)
                             }.padding(.top)
                         }.padding(.bottom)
                         }.padding(.bottom)
-                    }.listRowBackground(Color.chart)
+                    }.settingsSearchTarget(label: String(localized: "Low Threshold"))
                 }
                 }
 
 
                 Section {
                 Section {
@@ -374,7 +374,7 @@ extension UserInterfaceSettings {
                             ).buttonStyle(BorderlessButtonStyle())
                             ).buttonStyle(BorderlessButtonStyle())
                         }.padding(.top)
                         }.padding(.top)
                     }.padding(.bottom)
                     }.padding(.bottom)
-                }.listRowBackground(Color.chart)
+                }.settingsSearchTarget(label: String(localized: "Forecast Display Type"))
 
 
                 Section {
                 Section {
                     VStack {
                     VStack {
@@ -416,7 +416,7 @@ extension UserInterfaceSettings {
                             ).buttonStyle(BorderlessButtonStyle())
                             ).buttonStyle(BorderlessButtonStyle())
                         }.padding(.top)
                         }.padding(.top)
                     }.padding(.bottom)
                     }.padding(.bottom)
-                }.listRowBackground(Color.chart)
+                }.settingsSearchTarget(label: String(localized: "Bolus Display Threshold"))
 
 
                 Section(
                 Section(
                     header: Text("Trio Statistics"),
                     header: Text("Trio Statistics"),
@@ -459,7 +459,7 @@ extension UserInterfaceSettings {
                             }.padding(.top)
                             }.padding(.top)
                         }.padding(.bottom)
                         }.padding(.bottom)
                     }
                     }
-                ).listRowBackground(Color.chart)
+                ).settingsSearchTarget(label: String(localized: "eA1c/GMI Display Unit"))
 
 
                 Section {
                 Section {
                     VStack(alignment: .leading) {
                     VStack(alignment: .leading) {
@@ -538,7 +538,7 @@ extension UserInterfaceSettings {
                             ).buttonStyle(BorderlessButtonStyle())
                             ).buttonStyle(BorderlessButtonStyle())
                         }.padding(.top)
                         }.padding(.top)
                     }.padding(.bottom)
                     }.padding(.bottom)
-                }.listRowBackground(Color.chart)
+                }.settingsSearchTarget(label: String(localized: "Time in Range Type"))
 
 
                 SettingInputSection(
                 SettingInputSection(
                     decimalValue: $state.carbsRequiredThreshold,
                     decimalValue: $state.carbsRequiredThreshold,
@@ -577,6 +577,7 @@ extension UserInterfaceSettings {
             .onAppear(perform: configureView)
             .onAppear(perform: configureView)
             .navigationBarTitle("User Interface")
             .navigationBarTitle("User Interface")
             .navigationBarTitleDisplayMode(.automatic)
             .navigationBarTitleDisplayMode(.automatic)
+            .settingsHighlightScroll()
         }
         }
     }
     }
 }
 }