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

Merge pull request #1096 from gordolio/feat/dev-scrollable-settings-search-3-ui-scroll-targets

Add scroll targets and fix search index labels for settings search
Deniz Cengiz недель назад: 2
Родитель
Сommit
f006140d64

+ 56 - 3
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,12 @@ 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",
+                "High Glucose Target": "Enable SMB With High Glucose"
+            ],
             path: ["Algorithm", "Super Micro Bolus (SMB)"]
             path: ["Algorithm", "Super Micro Bolus (SMB)"]
         ),
         ),
         SettingItem(
         SettingItem(
@@ -159,6 +171,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 +195,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"]
         )
         )
     ]
     ]
@@ -196,6 +217,12 @@ enum SettingItems {
                 "Super Bolus Factor",
                 "Super Bolus Factor",
                 "Very Low Glucose Warning"
                 "Very Low Glucose Warning"
             ],
             ],
+            scrollTargetLabels: [
+                "Enable Reduced Bolus Factor": "Enable Reduced Bolus Option",
+                "Reduced Bolus Factor": "Enable Reduced Bolus Option",
+                "Enable Super Bolus": "Enable Super Bolus Option",
+                "Super Bolus Factor": "Enable Super Bolus Option"
+            ],
             path: ["Features", "Bolus Calculator"]
             path: ["Features", "Bolus Calculator"]
         ),
         ),
         SettingItem(
         SettingItem(
@@ -212,6 +239,14 @@ enum SettingItems {
                 "Fat and Protein Percentage",
                 "Fat and Protein Percentage",
                 "FPU"
                 "FPU"
             ],
             ],
+            scrollTargetLabels: [
+                "Max Fat": "Enable Fat and Protein Entries",
+                "Max Protein": "Enable Fat and Protein Entries",
+                "Fat and Protein Delay": "Enable Fat and Protein Entries",
+                "Spread Interval": "Enable Fat and Protein Entries",
+                "Fat and Protein Percentage": "Enable Fat and Protein Entries",
+                "FPU": "Enable Fat and Protein Entries"
+            ],
             path: ["Features", "Meal Settings"]
             path: ["Features", "Meal Settings"]
         ),
         ),
         SettingItem(
         SettingItem(
@@ -235,7 +270,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,15 +277,30 @@ enum SettingItems {
                 "Bolus Display Threshold",
                 "Bolus Display Threshold",
                 "Cone",
                 "Cone",
                 "Lines",
                 "Lines",
+                "Appearance",
                 "Dark Mode",
                 "Dark Mode",
                 "Light Mode",
                 "Light Mode",
-                "Appearance",
                 "Dark Scheme",
                 "Dark Scheme",
                 "Light 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)",
+                "X-Axis Interval Step"
+            ],
+            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",
+                "Dark Scheme": "Appearance",
+                "Light Scheme": "Appearance",
+                "X-Axis Interval Step": "Show X-Axis Grid Lines",
+                "Carbs Required Threshold": "Show Carbs Required Badge"
             ],
             ],
             path: ["Features", "User Interface"]
             path: ["Features", "User Interface"]
         ),
         ),
@@ -285,6 +334,10 @@ enum SettingItems {
                 "Low Glucose Alarm Limit",
                 "Low Glucose Alarm Limit",
                 "High Glucose Alarm Limit"
                 "High Glucose Alarm Limit"
             ],
             ],
+            scrollTargetLabels: [
+                "Low Glucose Alarm Limit": "Glucose Notifications",
+                "High Glucose Alarm Limit": "Glucose Notifications"
+            ],
             path: ["Notifications", "Trio Notifications"] // Glucose
             path: ["Notifications", "Trio Notifications"] // Glucose
         ),
         ),
         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()
         }
         }
     }
     }
 }
 }