Explorar o código

Revert "Add functionality to display setting default in verboseHint popup,"

This reverts commit 46cc12c1767aa231f70938d11970e29ba59e4f97.
Mike Plante hai 1 ano
pai
achega
9a56859fb2

+ 9 - 24
FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/View/AlgorithmAdvancedSettingsRootView.swift

@@ -9,7 +9,6 @@ extension AlgorithmAdvancedSettings {
         @State var hintDetent = PresentationDetent.large
         @State var hintDetent = PresentationDetent.large
         @State var selectedVerboseHint: AnyView?
         @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State var hintLabel: String?
-        @State var hintDefaultSetting: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
         @State private var booleanPlaceholder: Bool = false
 
 
@@ -56,9 +55,6 @@ extension AlgorithmAdvancedSettings {
                         set: {
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
                             selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Max Daily Safety Multiplier", comment: "Max Daily Safety Multiplier")
                             hintLabel = NSLocalizedString("Max Daily Safety Multiplier", comment: "Max Daily Safety Multiplier")
-                            hintDefaultSetting =
-                                "\((PickerSettingsProvider.shared.settings.maxDailySafetyMultiplier.value * 100).description) " +
-                                "%"
                         }
                         }
                     ),
                     ),
                     units: state.units,
                     units: state.units,
@@ -66,6 +62,7 @@ extension AlgorithmAdvancedSettings {
                     label: NSLocalizedString("Max Daily Safety Multiplier", comment: "Max Daily Safety Multiplier"),
                     label: NSLocalizedString("Max Daily Safety Multiplier", comment: "Max Daily Safety Multiplier"),
                     miniHint: "Limits temporary basal rates to this percentage of your largest basal rate",
                     miniHint: "Limits temporary basal rates to this percentage of your largest basal rate",
                     verboseHint: VStack(spacing: 10) {
                     verboseHint: VStack(spacing: 10) {
+                        Text("Default: 300%").bold()
                         VStack(alignment: .leading, spacing: 10) {
                         VStack(alignment: .leading, spacing: 10) {
                             Text(
                             Text(
                                 "This setting restricts the maximum temporary basal rate Trio can set. At the default of 300%, it caps it at 3 times your highest programmed basal rate."
                                 "This setting restricts the maximum temporary basal rate Trio can set. At the default of 300%, it caps it at 3 times your highest programmed basal rate."
@@ -88,9 +85,6 @@ extension AlgorithmAdvancedSettings {
                                 "Current Basal Safety Multiplier",
                                 "Current Basal Safety Multiplier",
                                 comment: "Current Basal Safety Multiplier"
                                 comment: "Current Basal Safety Multiplier"
                             )
                             )
-                            hintDefaultSetting =
-                                "\((PickerSettingsProvider.shared.settings.currentBasalSafetyMultiplier.value * 100).description) " +
-                                "%"
                         }
                         }
                     ),
                     ),
                     units: state.units,
                     units: state.units,
@@ -98,6 +92,7 @@ extension AlgorithmAdvancedSettings {
                     label: NSLocalizedString("Current Basal Safety Multiplier", comment: "Current Basal Safety Multiplier"),
                     label: NSLocalizedString("Current Basal Safety Multiplier", comment: "Current Basal Safety Multiplier"),
                     miniHint: "Limits temporary basal rates to this percentage of the current basal rate",
                     miniHint: "Limits temporary basal rates to this percentage of the current basal rate",
                     verboseHint: VStack(spacing: 10) {
                     verboseHint: VStack(spacing: 10) {
+                        Text("Default: 400%").bold()
                         VStack(alignment: .leading, spacing: 10) {
                         VStack(alignment: .leading, spacing: 10) {
                             Text(
                             Text(
                                 "This limits the automatic adjustment of the temporary basal rate to this percentage of the current hourly profile basal rate at the time of the loop cycle."
                                 "This limits the automatic adjustment of the temporary basal rate to this percentage of the current hourly profile basal rate at the time of the loop cycle."
@@ -119,8 +114,6 @@ extension AlgorithmAdvancedSettings {
                         set: {
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
                             selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Duration of Insulin Action"
                             hintLabel = "Duration of Insulin Action"
-                            hintDefaultSetting = "\(PickerSettingsProvider.shared.settings.dia.value.description) " +
-                                "hr"
                         }
                         }
                     ),
                     ),
                     units: state.units,
                     units: state.units,
@@ -128,6 +121,7 @@ extension AlgorithmAdvancedSettings {
                     label: "Duration of Insulin Action",
                     label: "Duration of Insulin Action",
                     miniHint: "Number of hours insulin is active in your body",
                     miniHint: "Number of hours insulin is active in your body",
                     verboseHint: VStack(spacing: 10) {
                     verboseHint: VStack(spacing: 10) {
+                        Text("Default: 6 hours").bold()
                         VStack(alignment: .leading, spacing: 10) {
                         VStack(alignment: .leading, spacing: 10) {
                             Text(
                             Text(
                                 "The Duration of Insulin Action (DIA) defines how long your insulin continues to lower glucose readings after a dose."
                                 "The Duration of Insulin Action (DIA) defines how long your insulin continues to lower glucose readings after a dose."
@@ -152,9 +146,6 @@ extension AlgorithmAdvancedSettings {
                         set: {
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
                             selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Use Custom Peak Time", comment: "Use Custom Peak Time")
                             hintLabel = NSLocalizedString("Use Custom Peak Time", comment: "Use Custom Peak Time")
-                            hintDefaultSetting =
-                                "\(PickerSettingsProvider.shared.settings.insulinPeakTime.value.description) " +
-                                "min"
                         }
                         }
                     ),
                     ),
                     units: state.units,
                     units: state.units,
@@ -163,6 +154,7 @@ extension AlgorithmAdvancedSettings {
                     conditionalLabel: NSLocalizedString("Insulin Peak Time", comment: "Insulin Peak Time"),
                     conditionalLabel: NSLocalizedString("Insulin Peak Time", comment: "Insulin Peak Time"),
                     miniHint: "Sets time of insulin's peak effect",
                     miniHint: "Sets time of insulin's peak effect",
                     verboseHint: VStack(spacing: 10) {
                     verboseHint: VStack(spacing: 10) {
+                        Text("Default: Set by Insulin Type").bold()
                         VStack(alignment: .leading, spacing: 10) {
                         VStack(alignment: .leading, spacing: 10) {
                             Text(
                             Text(
                                 "Insulin Peak Time defines when insulin is most effective in lowering glucose, set in minutes after dosing."
                                 "Insulin Peak Time defines when insulin is most effective in lowering glucose, set in minutes after dosing."
@@ -294,9 +286,6 @@ extension AlgorithmAdvancedSettings {
                         set: {
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
                             selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Min 5m Carb Impact", comment: "Min 5m Carb Impact")
                             hintLabel = NSLocalizedString("Min 5m Carb Impact", comment: "Min 5m Carb Impact")
-                            hintDefaultSetting =
-                                "\(PickerSettingsProvider.shared.settings.min5mCarbimpact.value.description) " + state.units
-                                    .rawValue
                         }
                         }
                     ),
                     ),
                     units: state.units,
                     units: state.units,
@@ -304,6 +293,8 @@ extension AlgorithmAdvancedSettings {
                     label: NSLocalizedString("Min 5m Carb Impact", comment: "Min 5m Carb Impact"),
                     label: NSLocalizedString("Min 5m Carb Impact", comment: "Min 5m Carb Impact"),
                     miniHint: "Estimates the impact of carb absorbtion after 5 minutes",
                     miniHint: "Estimates the impact of carb absorbtion after 5 minutes",
                     verboseHint: VStack(spacing: 10) {
                     verboseHint: VStack(spacing: 10) {
+                        //     let myText = (state.units == .mgdL ? 8.description : 8.formmatedAsMmolL) as! String + "Default:" + state.units.rawValue
+                        //     Text(myText).bold
                         VStack(alignment: .leading, spacing: 10) {
                         VStack(alignment: .leading, spacing: 10) {
                             Text(
                             Text(
                                 "Min 5m Carb Impact sets the expected glucose rise from carbs over 5 minutes when absorption isn't obvious from glucose data."
                                 "Min 5m Carb Impact sets the expected glucose rise from carbs over 5 minutes when absorption isn't obvious from glucose data."
@@ -327,9 +318,6 @@ extension AlgorithmAdvancedSettings {
                         set: {
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
                             selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Remaining Carbs Percentage", comment: "Remaining Carbs Percentage")
                             hintLabel = NSLocalizedString("Remaining Carbs Percentage", comment: "Remaining Carbs Percentage")
-                            hintDefaultSetting =
-                                "\((PickerSettingsProvider.shared.settings.remainingCarbsFraction.value * 100).description) " +
-                                "%"
                         }
                         }
                     ),
                     ),
                     units: state.units,
                     units: state.units,
@@ -337,6 +325,7 @@ extension AlgorithmAdvancedSettings {
                     label: NSLocalizedString("Remaining Carbs Percentage", comment: "Remaining Carbs Percentage"),
                     label: NSLocalizedString("Remaining Carbs Percentage", comment: "Remaining Carbs Percentage"),
                     miniHint: "% of carbs still available if no absorption is detected",
                     miniHint: "% of carbs still available if no absorption is detected",
                     verboseHint: VStack(spacing: 10) {
                     verboseHint: VStack(spacing: 10) {
+                        Text("Default: 100%").bold()
                         VStack(alignment: .leading, spacing: 10) {
                         VStack(alignment: .leading, spacing: 10) {
                             Text(
                             Text(
                                 "Remaining Carbs Percentage estimates carbs still absorbing over 4 hours if glucose data doesn't show clear absorption."
                                 "Remaining Carbs Percentage estimates carbs still absorbing over 4 hours if glucose data doesn't show clear absorption."
@@ -357,8 +346,6 @@ extension AlgorithmAdvancedSettings {
                         set: {
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
                             selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Remaining Carbs Cap", comment: "Remaining Carbs Cap")
                             hintLabel = NSLocalizedString("Remaining Carbs Cap", comment: "Remaining Carbs Cap")
-                            hintDefaultSetting =
-                                "\(PickerSettingsProvider.shared.settings.remainingCarbsCap.value.description) " + "g"
                         }
                         }
                     ),
                     ),
                     units: state.units,
                     units: state.units,
@@ -366,6 +353,7 @@ extension AlgorithmAdvancedSettings {
                     label: NSLocalizedString("Remaining Carbs Cap", comment: "Remaining Carbs Cap"),
                     label: NSLocalizedString("Remaining Carbs Cap", comment: "Remaining Carbs Cap"),
                     miniHint: "Maximum amount of carbs still available if no absorption is detected",
                     miniHint: "Maximum amount of carbs still available if no absorption is detected",
                     verboseHint: VStack(spacing: 10) {
                     verboseHint: VStack(spacing: 10) {
+                        Text("Default: 90g").bold()
                         VStack(alignment: .leading, spacing: 10) {
                         VStack(alignment: .leading, spacing: 10) {
                             Text(
                             Text(
                                 "The Remaining Carbs Cap defines the upper limit for how many carbs the system will assume are absorbing over 4 hours, even when there's no clear sign of absorption from your glucose readings."
                                 "The Remaining Carbs Cap defines the upper limit for how many carbs the system will assume are absorbing over 4 hours, even when there's no clear sign of absorption from your glucose readings."
@@ -386,9 +374,6 @@ extension AlgorithmAdvancedSettings {
                         set: {
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
                             selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Noisy CGM Target Multiplier", comment: "Noisy CGM Target Multiplier")
                             hintLabel = NSLocalizedString("Noisy CGM Target Multiplier", comment: "Noisy CGM Target Multiplier")
-                            hintDefaultSetting =
-                                "\((PickerSettingsProvider.shared.settings.noisyCGMTargetMultiplier.value * 100).description) " +
-                                "%"
                         }
                         }
                     ),
                     ),
                     units: state.units,
                     units: state.units,
@@ -396,6 +381,7 @@ extension AlgorithmAdvancedSettings {
                     label: NSLocalizedString("Noisy CGM Target Increase", comment: "Noisy CGM Target Increase"),
                     label: NSLocalizedString("Noisy CGM Target Increase", comment: "Noisy CGM Target Increase"),
                     miniHint: "Increase glucose target when noisy CGM data detected%",
                     miniHint: "Increase glucose target when noisy CGM data detected%",
                     verboseHint: VStack(spacing: 10) {
                     verboseHint: VStack(spacing: 10) {
+                        Text("Default: 130%").bold()
                         VStack(alignment: .leading, spacing: 10) {
                         VStack(alignment: .leading, spacing: 10) {
                             Text(
                             Text(
                                 "The Noisy CGM Target Multiplier increases your glucose target when the system detects noisy or raw CGM data. By default, the target is increased by 130% to account for the less reliable glucose readings."
                                 "The Noisy CGM Target Multiplier increases your glucose target when the system detects noisy or raw CGM data. By default, the target is increased by 130% to account for the less reliable glucose readings."
@@ -412,7 +398,6 @@ extension AlgorithmAdvancedSettings {
                     hintDetent: $hintDetent,
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
                     hintLabel: hintLabel ?? "",
-                    hintDefaultSetting: hintDefaultSetting ?? "",
                     hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                     sheetTitle: "Help"
                 )
                 )

+ 0 - 8
FreeAPS/Sources/Views/DefinitionRow.swift

@@ -3,7 +3,6 @@ import SwiftUI
 
 
 struct DefinitionRow<DefinitionView: View>: View {
 struct DefinitionRow<DefinitionView: View>: View {
     var term: String
     var term: String
-    var defaultSetting: String?
     var definition: DefinitionView
     var definition: DefinitionView
     var color: Color?
     var color: Color?
     var fontSize: Font?
     var fontSize: Font?
@@ -16,13 +15,6 @@ struct DefinitionRow<DefinitionView: View>: View {
                 }
                 }
                 Text(term).font(fontSize ?? .subheadline).fontWeight(.semibold)
                 Text(term).font(fontSize ?? .subheadline).fontWeight(.semibold)
             }.padding(.bottom, 5)
             }.padding(.bottom, 5)
-            if defaultSetting != nil {
-                Text("Default: \(defaultSetting ?? "")")
-                    .font(fontSize ?? .subheadline)
-                    .foregroundColor(.secondary)
-                    .padding(.bottom, 5)
-                    .bold()
-            }
             definition
             definition
                 .font(fontSize ?? .subheadline)
                 .font(fontSize ?? .subheadline)
                 .foregroundColor(.secondary)
                 .foregroundColor(.secondary)

+ 0 - 2
FreeAPS/Sources/Views/SettingInputHintView.swift

@@ -4,7 +4,6 @@ struct SettingInputHintView<HintView: View>: View {
     @Binding var hintDetent: PresentationDetent
     @Binding var hintDetent: PresentationDetent
     @Binding var shouldDisplayHint: Bool
     @Binding var shouldDisplayHint: Bool
     var hintLabel: String
     var hintLabel: String
-    var hintDefaultSetting: String?
     var hintText: HintView
     var hintText: HintView
     var sheetTitle: String
     var sheetTitle: String
 
 
@@ -31,7 +30,6 @@ struct SettingInputHintView<HintView: View>: View {
             List {
             List {
                 DefinitionRow(
                 DefinitionRow(
                     term: hintLabel,
                     term: hintLabel,
-                    defaultSetting: hintDefaultSetting,
                     definition: hintText,
                     definition: hintText,
                     fontSize: .body
                     fontSize: .body
                 )
                 )