فهرست منبع

Fix: Make weighted average setting available for both dynamicISF formulas

Deniz Cengiz 1 سال پیش
والد
کامیت
c94f621c47
1فایلهای تغییر یافته به همراه29 افزوده شده و 29 حذف شده
  1. 29 29
      Trio/Sources/Modules/DynamicSettings/View/DynamicSettingsRootView.swift

+ 29 - 29
Trio/Sources/Modules/DynamicSettings/View/DynamicSettingsRootView.swift

@@ -169,35 +169,6 @@ extension DynamicSettings {
                                 )
                             }
                         )
-
-                        SettingInputSection(
-                            decimalValue: $state.weightPercentage,
-                            booleanValue: $booleanPlaceholder,
-                            shouldDisplayHint: $shouldDisplayHint,
-                            selectedVerboseHint: Binding(
-                                get: { selectedVerboseHint },
-                                set: {
-                                    selectedVerboseHint = $0.map { AnyView($0) }
-                                    hintLabel = String(localized: "Weighted Average of TDD")
-                                }
-                            ),
-                            units: state.units,
-                            type: .decimal("weightPercentage"),
-                            label: String(localized: "Weighted Average of TDD"),
-                            miniHint: String(localized: "Weight of 24-hr TDD against 10-day TDD."),
-                            verboseHint:
-                            VStack(alignment: .leading, spacing: 10) {
-                                Text("Default: 35%").bold()
-                                Text(
-                                    "This setting adjusts how much weight is given to your recent total daily insulin dose when calculating Dynamic ISF and Dynamic CR."
-                                )
-                                Text(
-                                    "At the default setting, 35% of the calculation is based on the last 24 hours of insulin use, with the remaining 65% considering the last 10 days of data."
-                                )
-                                Text("Setting this to 100% means only the past 24 hours will be used.")
-                                Text("A lower value smooths out these variations for more stability.")
-                            }
-                        )
                     } else {
                         SettingInputSection(
                             decimalValue: $state.adjustmentFactorSigmoid,
@@ -234,6 +205,35 @@ extension DynamicSettings {
                     }
 
                     SettingInputSection(
+                        decimalValue: $state.weightPercentage,
+                        booleanValue: $booleanPlaceholder,
+                        shouldDisplayHint: $shouldDisplayHint,
+                        selectedVerboseHint: Binding(
+                            get: { selectedVerboseHint },
+                            set: {
+                                selectedVerboseHint = $0.map { AnyView($0) }
+                                hintLabel = String(localized: "Weighted Average of TDD")
+                            }
+                        ),
+                        units: state.units,
+                        type: .decimal("weightPercentage"),
+                        label: String(localized: "Weighted Average of TDD"),
+                        miniHint: String(localized: "Weight of 24-hr TDD against 10-day TDD."),
+                        verboseHint:
+                        VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: 35%").bold()
+                            Text(
+                                "This setting adjusts how much weight is given to your recent total daily insulin dose when calculating Dynamic ISF and Dynamic CR."
+                            )
+                            Text(
+                                "At the default setting, 35% of the calculation is based on the last 24 hours of insulin use, with the remaining 65% considering the last 10 days of data."
+                            )
+                            Text("Setting this to 100% means only the past 24 hours will be used.")
+                            Text("A lower value smooths out these variations for more stability.")
+                        }
+                    )
+
+                    SettingInputSection(
                         decimalValue: $decimalPlaceholder,
                         booleanValue: $state.tddAdjBasal,
                         shouldDisplayHint: $shouldDisplayHint,