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

Merge pull request #104 from tmhastings/settings-update

Settings update
Deniz Cengiz 1 год назад
Родитель
Сommit
eae7a0d4b0
100 измененных файлов с 1844 добавлено и 847 удалено
  1. 13 0
      FreeAPS.xcodeproj/project.pbxproj
  2. 0 23
      FreeAPS/Resources/Assets.xcassets/app_icon_images/trioLoop.imageset/Contents.json
  3. BIN
      FreeAPS/Resources/Assets.xcassets/app_icon_images/trioLoop.imageset/imageLoop 1.png
  4. BIN
      FreeAPS/Resources/Assets.xcassets/app_icon_images/trioLoop.imageset/imageLoop 2.png
  5. BIN
      FreeAPS/Resources/Assets.xcassets/app_icon_images/trioLoop.imageset/imageLoop 3.png
  6. 0 20
      FreeAPS/Resources/Assets.xcassets/app_icons/trioLoop.appiconset/Contents.json
  7. BIN
      FreeAPS/Resources/Assets.xcassets/app_icons/trioLoop.appiconset/trioLoop watch.png
  8. BIN
      FreeAPS/Resources/Assets.xcassets/app_icons/trioLoop.appiconset/trioLoop.png
  9. 1 1
      FreeAPS/Resources/javascript/bundle/determine-basal.js
  10. 3 3
      FreeAPS/Resources/json/defaults/freeaps/freeaps_settings.json
  11. 1 1
      FreeAPS/Resources/json/defaults/preferences.json
  12. 1 1
      FreeAPS/Resources/json/defaults/settings/settings.json
  13. 16 17
      FreeAPS/Sources/APS/APSManager.swift
  14. 4 0
      FreeAPS/Sources/Helpers/ConstantValues.swift
  15. 1 1
      FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings
  16. 1 1
      FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings
  17. 1 1
      FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings
  18. 1 1
      FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings
  19. 1 1
      FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings
  20. 1 1
      FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings
  21. 1 1
      FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings
  22. 1 1
      FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings
  23. 1 1
      FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings
  24. 1 1
      FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings
  25. 1 1
      FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings
  26. 1 1
      FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings
  27. 1 1
      FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings
  28. 1 1
      FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings
  29. 1 1
      FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings
  30. 1 1
      FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings
  31. 1 1
      FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings
  32. 1 1
      FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings
  33. 1 1
      FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings
  34. 1 1
      FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings
  35. 1 1
      FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings
  36. 1 1
      FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings
  37. 17 17
      FreeAPS/Sources/Models/DecimalPickerSettings.swift
  38. 7 7
      FreeAPS/Sources/Models/FreeAPSSettings.swift
  39. 16 0
      FreeAPS/Sources/Models/HbA1cDisplayUnit.swift
  40. 0 1
      FreeAPS/Sources/Models/Icons.swift
  41. 1 1
      FreeAPS/Sources/Models/Preferences.swift
  42. 16 0
      FreeAPS/Sources/Models/TimeInRangeChartStyle.swift
  43. 2 2
      FreeAPS/Sources/Models/TotalInsulinDisplayType.swift
  44. 1 1
      FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/AlgorithmAdvancedSettingsProvider.swift
  45. 1 1
      FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/AlgorithmAdvancedSettingsStateModel.swift
  46. 175 96
      FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/View/AlgorithmAdvancedSettingsRootView.swift
  47. 50 20
      FreeAPS/Sources/Modules/AutosensSettings/View/AutosensSettingsRootView.swift
  48. 23 18
      FreeAPS/Sources/Modules/AutotuneConfig/View/AutotuneConfigRootView.swift
  49. 67 21
      FreeAPS/Sources/Modules/BolusCalculatorConfig/View/BolusCalculatorConfigRootView.swift
  50. 33 12
      FreeAPS/Sources/Modules/CGM/View/CGMRootView.swift
  51. 47 11
      FreeAPS/Sources/Modules/CalendarEventSettings/View/CalendarEventSettingsRootView.swift
  52. 1 1
      FreeAPS/Sources/Modules/CarbRatioEditor/CarbRatioEditorStateModel.swift
  53. 1 1
      FreeAPS/Sources/Modules/DataTable/DataTableProvider.swift
  54. 154 33
      FreeAPS/Sources/Modules/DynamicSettings/View/DynamicSettingsRootView.swift
  55. 1 1
      FreeAPS/Sources/Modules/GeneralSettings/UnitsLimitsSettingsProvider.swift
  56. 57 20
      FreeAPS/Sources/Modules/GeneralSettings/View/UnitsLimitsSettingsRootView.swift
  57. 89 32
      FreeAPS/Sources/Modules/GlucoseNotificationSettings/View/GlucoseNotificationSettingsRootView.swift
  58. 21 16
      FreeAPS/Sources/Modules/HealthKit/View/AppleHealthKitRootView.swift
  59. 1 1
      FreeAPS/Sources/Modules/Home/HomeProvider.swift
  60. 3 3
      FreeAPS/Sources/Modules/Home/HomeStateModel.swift
  61. 20 9
      FreeAPS/Sources/Modules/Home/View/HomeRootView.swift
  62. 48 8
      FreeAPS/Sources/Modules/LiveActivitySettings/View/LiveActivitySettingsRootView.swift
  63. 121 30
      FreeAPS/Sources/Modules/MealSettings/View/MealSettingsRootView.swift
  64. 1 1
      FreeAPS/Sources/Modules/NightscoutConfig/NightscoutConfigProvider.swift
  65. 36 14
      FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConfigRootView.swift
  66. 2 1
      FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConnectView.swift
  67. 24 9
      FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutFetchView.swift
  68. 26 9
      FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutUploadView.swift
  69. 12 5
      FreeAPS/Sources/Modules/NightscoutConfig/View/ProfileImport/ReviewInsulinActionView.swift
  70. 1 1
      FreeAPS/Sources/Modules/PumpConfig/PumpConfigProvider.swift
  71. 20 5
      FreeAPS/Sources/Modules/PumpConfig/View/PumpConfigRootView.swift
  72. 15 6
      FreeAPS/Sources/Modules/RemoteControlConfig/View/RemoteControlConfig.swift
  73. 189 78
      FreeAPS/Sources/Modules/SMBSettings/View/SMBSettingsRootView.swift
  74. 10 8
      FreeAPS/Sources/Modules/Settings/SettingItems.swift
  75. 46 39
      FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift
  76. 1 1
      FreeAPS/Sources/Modules/Settings/View/Subviews/AlgorithmSettings.swift
  77. 6 6
      FreeAPS/Sources/Modules/Settings/View/Subviews/FeatureSettingsView.swift
  78. 25 12
      FreeAPS/Sources/Modules/Settings/View/Subviews/NotificationsView.swift
  79. 1 1
      FreeAPS/Sources/Modules/Settings/View/Subviews/TherapySettingsView.swift
  80. 4 2
      FreeAPS/Sources/Modules/Settings/View/TidepoolStartView.swift
  81. 15 6
      FreeAPS/Sources/Modules/ShortcutsConfig/View/ShortcutsConfigView.swift
  82. 4 4
      FreeAPS/Sources/Modules/Stat/StatStateModel.swift
  83. 7 7
      FreeAPS/Sources/Modules/Stat/View/ChartsView.swift
  84. 15 15
      FreeAPS/Sources/Modules/Stat/View/StatRootView.swift
  85. 15 7
      FreeAPS/Sources/Modules/Stat/View/StatsView.swift
  86. 71 40
      FreeAPS/Sources/Modules/TargetBehavoir/View/TargetBehavoirRootView.swift
  87. 1 1
      FreeAPS/Sources/Modules/TargetsEditor/View/TargetsEditorRootView.swift
  88. 1 1
      FreeAPS/Sources/Modules/Treatments/TreatmentsProvider.swift
  89. 1 1
      FreeAPS/Sources/Modules/Treatments/View/PopupView.swift
  90. 2 1
      FreeAPS/Sources/Modules/Treatments/View/TreatmentsRootView.swift
  91. 6 5
      FreeAPS/Sources/Modules/UserInterfaceSettings/UserInterfaceSettingsStateModel.swift
  92. 210 84
      FreeAPS/Sources/Modules/UserInterfaceSettings/View/UserInterfaceSettingsRootView.swift
  93. 23 12
      FreeAPS/Sources/Modules/WatchConfig/View/WatchConfigAppleWatchView.swift
  94. 12 6
      FreeAPS/Sources/Modules/WatchConfig/View/WatchConfigGarminView.swift
  95. 1 1
      FreeAPS/Sources/Modules/WatchConfig/View/WatchConfigRootView.swift
  96. 1 1
      FreeAPS/Sources/Services/SettingsManager/SettingsManager.swift
  97. 1 1
      FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift
  98. 3 3
      FreeAPS/Sources/Views/DefinitionRow.swift
  99. 2 2
      FreeAPS/Sources/Views/SettingInputHintView.swift
  100. 0 0
      FreeAPS/Sources/Views/SettingInputSection.swift

+ 13 - 0
FreeAPS.xcodeproj/project.pbxproj

@@ -359,6 +359,7 @@
 		BDF530D82B40F8AC002CAF43 /* LockScreenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF530D72B40F8AC002CAF43 /* LockScreenView.swift */; };
 		BDFD165A2AE40438007F0DDA /* TreatmentsRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDFD16592AE40438007F0DDA /* TreatmentsRootView.swift */; };
 		BF1667ADE69E4B5B111CECAE /* ManualTempBasalProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 680C4420C9A345D46D90D06C /* ManualTempBasalProvider.swift */; };
+		C2A0A42F2CE03131003B98E8 /* ConstantValues.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2A0A42E2CE0312C003B98E8 /* ConstantValues.swift */; };
 		C967DACD3B1E638F8B43BE06 /* ManualTempBasalStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFCFE0781F9074C2917890E8 /* ManualTempBasalStateModel.swift */; };
 		CA370FC152BC98B3D1832968 /* BasalProfileEditorRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF8BCB0C37DEB5EC377B9612 /* BasalProfileEditorRootView.swift */; };
 		CC6C406E2ACDD69E009B8058 /* RawFetchedProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC6C406D2ACDD69E009B8058 /* RawFetchedProfile.swift */; };
@@ -423,6 +424,7 @@
 		D6DEC113821A7F1056C4AA1E /* NightscoutConfigDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F2A13DF0EDEEEDC4106AA2A /* NightscoutConfigDataFlow.swift */; };
 		D76333C9256787610B3B4875 /* AutotuneConfigStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D295A3F870E826BE371C0BB5 /* AutotuneConfigStateModel.swift */; };
 		DBA5254DBB2586C98F61220C /* ISFEditorProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9F137F126D9F8DEB799F26 /* ISFEditorProvider.swift */; };
+		DD07CA142CE80B73002D45A9 /* TimeInRangeChartStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD07CA132CE80B73002D45A9 /* TimeInRangeChartStyle.swift */; };
 		DD09D47B2C5986D1003FEA5D /* CalendarEventSettingsDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD09D47A2C5986D1003FEA5D /* CalendarEventSettingsDataFlow.swift */; };
 		DD09D47D2C5986DA003FEA5D /* CalendarEventSettingsProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD09D47C2C5986DA003FEA5D /* CalendarEventSettingsProvider.swift */; };
 		DD09D47F2C5986E5003FEA5D /* CalendarEventSettingsStateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD09D47E2C5986E5003FEA5D /* CalendarEventSettingsStateModel.swift */; };
@@ -494,6 +496,7 @@
 		DDD1631A2C4C695E00CD525A /* EditOverrideForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD163192C4C695E00CD525A /* EditOverrideForm.swift */; };
 		DDD1631C2C4C697400CD525A /* AddOverrideForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD1631B2C4C697400CD525A /* AddOverrideForm.swift */; };
 		DDD1631F2C4C6F6900CD525A /* TrioCoreDataPersistentContainer.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = DDD1631D2C4C6F6900CD525A /* TrioCoreDataPersistentContainer.xcdatamodeld */; };
+		DDD6D4D32CDE90720029439A /* HbA1cDisplayUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD6D4D22CDE90720029439A /* HbA1cDisplayUnit.swift */; };
 		DDE179522C910127003CDDB7 /* MealPresetStored+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDE179322C910127003CDDB7 /* MealPresetStored+CoreDataClass.swift */; };
 		DDE179532C910127003CDDB7 /* MealPresetStored+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDE179332C910127003CDDB7 /* MealPresetStored+CoreDataProperties.swift */; };
 		DDE179542C910127003CDDB7 /* LoopStatRecord+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDE179342C910127003CDDB7 /* LoopStatRecord+CoreDataClass.swift */; };
@@ -1059,6 +1062,8 @@
 		BDF530D72B40F8AC002CAF43 /* LockScreenView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LockScreenView.swift; sourceTree = "<group>"; };
 		BDFD16592AE40438007F0DDA /* TreatmentsRootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreatmentsRootView.swift; sourceTree = "<group>"; };
 		BF8BCB0C37DEB5EC377B9612 /* BasalProfileEditorRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BasalProfileEditorRootView.swift; sourceTree = "<group>"; };
+		C19984D62EFC0035A9E9644D /* BolusProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BolusProvider.swift; sourceTree = "<group>"; };
+		C2A0A42E2CE0312C003B98E8 /* ConstantValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstantValues.swift; sourceTree = "<group>"; };
 		C19984D62EFC0035A9E9644D /* TreatmentsProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TreatmentsProvider.swift; sourceTree = "<group>"; };
 		C377490C77661D75E8C50649 /* ManualTempBasalRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ManualTempBasalRootView.swift; sourceTree = "<group>"; };
 		C8D1A7CA8C10C4403D4BBFA7 /* TreatmentsDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TreatmentsDataFlow.swift; sourceTree = "<group>"; };
@@ -1125,6 +1130,7 @@
 		D0BDC6993C1087310EDFC428 /* CarbRatioEditorRootView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CarbRatioEditorRootView.swift; sourceTree = "<group>"; };
 		D295A3F870E826BE371C0BB5 /* AutotuneConfigStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AutotuneConfigStateModel.swift; sourceTree = "<group>"; };
 		DC2C6489D29ECCCAD78E0721 /* GlucoseNotificationSettingsStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = GlucoseNotificationSettingsStateModel.swift; sourceTree = "<group>"; };
+		DD07CA132CE80B73002D45A9 /* TimeInRangeChartStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeInRangeChartStyle.swift; sourceTree = "<group>"; };
 		DD09D47A2C5986D1003FEA5D /* CalendarEventSettingsDataFlow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarEventSettingsDataFlow.swift; sourceTree = "<group>"; };
 		DD09D47C2C5986DA003FEA5D /* CalendarEventSettingsProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarEventSettingsProvider.swift; sourceTree = "<group>"; };
 		DD09D47E2C5986E5003FEA5D /* CalendarEventSettingsStateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendarEventSettingsStateModel.swift; sourceTree = "<group>"; };
@@ -1198,6 +1204,7 @@
 		DDD163192C4C695E00CD525A /* EditOverrideForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditOverrideForm.swift; sourceTree = "<group>"; };
 		DDD1631B2C4C697400CD525A /* AddOverrideForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddOverrideForm.swift; sourceTree = "<group>"; };
 		DDD1631E2C4C6F6900CD525A /* TrioCoreDataPersistentContainer.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = TrioCoreDataPersistentContainer.xcdatamodel; sourceTree = "<group>"; };
+		DDD6D4D22CDE90720029439A /* HbA1cDisplayUnit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HbA1cDisplayUnit.swift; sourceTree = "<group>"; };
 		DDE179322C910127003CDDB7 /* MealPresetStored+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MealPresetStored+CoreDataClass.swift"; sourceTree = "<group>"; };
 		DDE179332C910127003CDDB7 /* MealPresetStored+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MealPresetStored+CoreDataProperties.swift"; sourceTree = "<group>"; };
 		DDE179342C910127003CDDB7 /* LoopStatRecord+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "LoopStatRecord+CoreDataClass.swift"; sourceTree = "<group>"; };
@@ -1990,6 +1997,7 @@
 		388E5A5925B6F0250019842D /* Models */ = {
 			isa = PBXGroup;
 			children = (
+				DD07CA132CE80B73002D45A9 /* TimeInRangeChartStyle.swift */,
 				DD940BA92CA7585D000830A5 /* GlucoseColorScheme.swift */,
 				DD6D67E32C9C253500660C9B /* ColorSchemeOption.swift */,
 				385CEAC025F2EA52002D6D5B /* Announcement.swift */,
@@ -2037,6 +2045,7 @@
 				DD6B7CB32C7B71F700B75029 /* ForecastDisplayType.swift */,
 				DD6B7CB52C7B748B00B75029 /* TotalInsulinDisplayType.swift */,
 				DD9ECB692CA99F6C00AA7C45 /* PushMessage.swift */,
+				DDD6D4D22CDE90720029439A /* HbA1cDisplayUnit.swift */,
 			);
 			path = Models;
 			sourceTree = "<group>";
@@ -2044,6 +2053,7 @@
 		388E5A5A25B6F05F0019842D /* Helpers */ = {
 			isa = PBXGroup;
 			children = (
+				C2A0A42E2CE0312C003B98E8 /* ConstantValues.swift */,
 				DD940BAB2CA75889000830A5 /* DynamicGlucoseColor.swift */,
 				38F37827261260DC009DB701 /* Color+Extensions.swift */,
 				389ECE042601144100D86C4F /* ConcurrentMap.swift */,
@@ -3411,6 +3421,7 @@
 			files = (
 				DD5DC9F12CF3D97C00AB8703 /* AdjustmentsStateModel+Overrides.swift in Sources */,
 				3811DE2325C9D48300A708ED /* MainDataFlow.swift in Sources */,
+				C2A0A42F2CE03131003B98E8 /* ConstantValues.swift in Sources */,
 				BD3CC0722B0B89D50013189E /* MainChartView.swift in Sources */,
 				3811DEEB25CA063400A708ED /* PersistedProperty.swift in Sources */,
 				38E44537274E411700EC9A94 /* Disk+Helpers.swift in Sources */,
@@ -3441,6 +3452,7 @@
 				382C134B25F14E3700715CE1 /* BGTargets.swift in Sources */,
 				38AEE75725F0F18E0013F05B /* CarbsStorage.swift in Sources */,
 				38B4F3CA25E502E200E76A18 /* SwiftNotificationCenter.swift in Sources */,
+				DD07CA142CE80B73002D45A9 /* TimeInRangeChartStyle.swift in Sources */,
 				38AEE75225F022080013F05B /* SettingsManager.swift in Sources */,
 				3894873A2614928B004DF424 /* DispatchTimer.swift in Sources */,
 				3895E4C625B9E00D00214B37 /* Preferences.swift in Sources */,
@@ -3541,6 +3553,7 @@
 				DD1745482C55C61D00211FAC /* AutosensSettingsStateModel.swift in Sources */,
 				DD1745462C55C61500211FAC /* AutosensSettingsProvider.swift in Sources */,
 				3811DEAF25C9D88300A708ED /* KeyValueStorage.swift in Sources */,
+				DDD6D4D32CDE90720029439A /* HbA1cDisplayUnit.swift in Sources */,
 				38FE826D25CC8461001FF17A /* NightscoutAPI.swift in Sources */,
 				388358C825EEF6D200E024B2 /* BasalProfileEntry.swift in Sources */,
 				3811DE0B25C9D32F00A708ED /* BaseView.swift in Sources */,

+ 0 - 23
FreeAPS/Resources/Assets.xcassets/app_icon_images/trioLoop.imageset/Contents.json

@@ -1,23 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "imageLoop 1.png",
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "filename" : "imageLoop 2.png",
-      "idiom" : "universal",
-      "scale" : "2x"
-    },
-    {
-      "filename" : "imageLoop 3.png",
-      "idiom" : "universal",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
FreeAPS/Resources/Assets.xcassets/app_icon_images/trioLoop.imageset/imageLoop 1.png


BIN
FreeAPS/Resources/Assets.xcassets/app_icon_images/trioLoop.imageset/imageLoop 2.png


BIN
FreeAPS/Resources/Assets.xcassets/app_icon_images/trioLoop.imageset/imageLoop 3.png


+ 0 - 20
FreeAPS/Resources/Assets.xcassets/app_icons/trioLoop.appiconset/Contents.json

@@ -1,20 +0,0 @@
-{
-  "images" : [
-    {
-      "filename" : "trioLoop.png",
-      "idiom" : "universal",
-      "platform" : "ios",
-      "size" : "1024x1024"
-    },
-    {
-      "filename" : "trioLoop watch.png",
-      "idiom" : "universal",
-      "platform" : "watchos",
-      "size" : "1024x1024"
-    }
-  ],
-  "info" : {
-    "author" : "xcode",
-    "version" : 1
-  }
-}

BIN
FreeAPS/Resources/Assets.xcassets/app_icons/trioLoop.appiconset/trioLoop watch.png


BIN
FreeAPS/Resources/Assets.xcassets/app_icons/trioLoop.appiconset/trioLoop.png


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Resources/javascript/bundle/determine-basal.js


+ 3 - 3
FreeAPS/Resources/json/defaults/freeaps/freeaps_settings.json

@@ -33,14 +33,14 @@
   "useAppleHealth" : false,
   "smoothGlucose" : false,
   "displayOnWatch" : "BGTarget",
-  "overrideHbA1cUnit" : false,
+  "hbA1cDisplayUnit" : "percent",
   "high" : 180,
   "low" : 70,
   "hours" : 6,
   "glucoseColorScheme" : "staticColor",
   "xGridLines" : true,
   "yGridLines" : true,
-  "oneDimensionalGraph" : false,
+  "timeInRangeChartStyle" : "vertical",
   "rulerMarks" : true,
   "forecastDisplayType": "cone",
   "maxCarbs": 250,
@@ -52,7 +52,7 @@
   "fattyMeals": false,
   "fattyMealFactor": 0.7,
   "sweetMeals": false,
-  "sweetMealFactor": 2,
+  "sweetMealFactor": 1,
   "lockScreenView": "simple",
   "useCalendar": false,
   "displayCalendarIOBandCOB": false,

+ 1 - 1
FreeAPS/Resources/json/defaults/preferences.json

@@ -45,7 +45,7 @@
   "enableDynamicCR" : false,
   "useNewFormula" : false,
   "useWeightedAverage" : false,
-  "weightPercentage" : 0.65,
+  "weightPercentage" : 0.35,
   "tddAdjBasal" : false,
   "enableSMB_high_bg" : false,
   "enableSMB_high_bg_target" : 110,

+ 1 - 1
FreeAPS/Resources/json/defaults/settings/settings.json

@@ -1,5 +1,5 @@
 {
-    "insulin_action_curve": 6,
+    "insulin_action_curve": 10,
     "maxBolus": 10,
     "maxBasal": 2
 }

+ 16 - 17
FreeAPS/Sources/APS/APSManager.swift

@@ -1043,10 +1043,8 @@ final class BaseAPSManager: APSManager, Injectable {
                 scheduled_basal: 0,
                 total_average: 0
             )
-
-            let gs = await glucoseStats
-            let overrideHbA1cUnit = gs.overrideHbA1cUnit
-            let hbA1cUnit = !overrideHbA1cUnit ? (units == .mmolL ? "mmol/mol" : "%") : (units == .mmolL ? "%" : "mmol/mol")
+            let processedGlucoseStats = await glucoseStats
+            let hbA1cDisplayUnit = processedGlucoseStats.hbA1cDisplayUnit
 
             let dailystat = await Statistics(
                 created_at: Date(),
@@ -1064,14 +1062,15 @@ final class BaseAPSManager: APSManager, Injectable {
                 insulinType: insulin_type.rawValue,
                 peakActivityTime: iPa,
                 Carbs_24h: await carbTotal,
-                GlucoseStorage_Days: Decimal(roundDouble(gs.numberofDays, 1)),
+                GlucoseStorage_Days: Decimal(roundDouble(processedGlucoseStats.numberofDays, 1)),
                 Statistics: Stats(
-                    Distribution: gs.TimeInRange,
-                    Glucose: gs.avg,
-                    HbA1c: gs.hbs, Units: Units(Glucose: units.rawValue, HbA1c: hbA1cUnit),
+                    Distribution: processedGlucoseStats.TimeInRange,
+                    Glucose: processedGlucoseStats.avg,
+                    HbA1c: processedGlucoseStats.hbs,
+                    Units: Units(Glucose: units.rawValue, HbA1c: hbA1cDisplayUnit.rawValue),
                     LoopCycles: loopStats,
                     Insulin: insulin,
-                    Variance: gs.variance
+                    Variance: processedGlucoseStats.variance
                 )
             )
             storage.save(dailystat, as: file)
@@ -1234,7 +1233,7 @@ final class BaseAPSManager: APSManager, Injectable {
                 cv: Double,
                 readings: Double
             ),
-            overrideHbA1cUnit: Bool,
+            hbA1cDisplayUnit: HbA1cDisplayUnit,
             numberofDays: Double,
             TimeInRange: TIRs,
             avg: Averages,
@@ -1270,7 +1269,7 @@ final class BaseAPSManager: APSManager, Injectable {
                 cv: Double,
                 readings: Double
             ),
-            overrideHbA1cUnit: Bool,
+            hbA1cDisplayUnit: HbA1cDisplayUnit,
             numberofDays: Double,
             TimeInRange: TIRs,
             avg: Averages,
@@ -1301,18 +1300,18 @@ final class BaseAPSManager: APSManager, Injectable {
                 total: self.roundDecimal(Decimal(totalDaysGlucose.median), 1)
             )
 
-            let overrideHbA1cUnit = self.settingsManager.settings.overrideHbA1cUnit
+            let hbA1cDisplayUnit = self.settingsManager.settings.hbA1cDisplayUnit
 
             let hbs = Durations(
-                day: ((units == .mmolL && !overrideHbA1cUnit) || (units == .mgdL && overrideHbA1cUnit)) ?
+                day: ((units == .mmolL && hbA1cDisplayUnit == .mmolMol) || (units == .mgdL && hbA1cDisplayUnit == .percent)) ?
                     self.roundDecimal(Decimal(oneDayGlucose.ifcc), 1) : self.roundDecimal(Decimal(oneDayGlucose.ngsp), 1),
-                week: ((units == .mmolL && !overrideHbA1cUnit) || (units == .mgdL && overrideHbA1cUnit)) ?
+                week: ((units == .mmolL && hbA1cDisplayUnit == .mmolMol) || (units == .mgdL && hbA1cDisplayUnit == .percent)) ?
                     self.roundDecimal(Decimal(sevenDaysGlucose.ifcc), 1) : self
                     .roundDecimal(Decimal(sevenDaysGlucose.ngsp), 1),
-                month: ((units == .mmolL && !overrideHbA1cUnit) || (units == .mgdL && overrideHbA1cUnit)) ?
+                month: ((units == .mmolL && hbA1cDisplayUnit == .mmolMol) || (units == .mgdL && hbA1cDisplayUnit == .percent)) ?
                     self.roundDecimal(Decimal(thirtyDaysGlucose.ifcc), 1) : self
                     .roundDecimal(Decimal(thirtyDaysGlucose.ngsp), 1),
-                total: ((units == .mmolL && !overrideHbA1cUnit) || (units == .mgdL && overrideHbA1cUnit)) ?
+                total: ((units == .mmolL && hbA1cDisplayUnit == .mmolMol) || (units == .mgdL && hbA1cDisplayUnit == .percent)) ?
                     self.roundDecimal(Decimal(totalDaysGlucose.ifcc), 1) : self.roundDecimal(Decimal(totalDaysGlucose.ngsp), 1)
             )
 
@@ -1386,7 +1385,7 @@ final class BaseAPSManager: APSManager, Injectable {
             )
             let variance = Variance(SD: standardDeviations, CV: cvs)
 
-            result = (oneDayGlucose, overrideHbA1cUnit, numberOfDays, TimeInRange, avg, hbs, variance)
+            result = (oneDayGlucose, hbA1cDisplayUnit, numberOfDays, TimeInRange, avg, hbs, variance)
         }
 
         return result!

+ 4 - 0
FreeAPS/Sources/Helpers/ConstantValues.swift

@@ -0,0 +1,4 @@
+import SwiftUI
+
+// Global constant for list section separation
+let sectionSpacing: CGFloat = 15

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/en.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings


+ 17 - 17
FreeAPS/Sources/Models/DecimalPickerSettings.swift

@@ -35,7 +35,7 @@ class PickerSettingsProvider: ObservableObject {
 struct DecimalPickerSettings {
     var lowGlucose = PickerSetting(value: 70, step: 5, min: 40, max: 100, type: PickerSetting.PickerSettingType.glucose)
     var highGlucose = PickerSetting(value: 180, step: 5, min: 100, max: 400, type: PickerSetting.PickerSettingType.glucose)
-    var carbsRequiredThreshold = PickerSetting(value: 10, step: 1, min: 0, max: 100, type: PickerSetting.PickerSettingType.gramms)
+    var carbsRequiredThreshold = PickerSetting(value: 10, step: 1, min: 0, max: 100, type: PickerSetting.PickerSettingType.gram)
     var individualAdjustmentFactor = PickerSetting(
         value: 0.5,
         step: 0.05,
@@ -45,12 +45,12 @@ struct DecimalPickerSettings {
     )
     var high = PickerSetting(value: 180, step: 1, min: 100, max: 500, type: PickerSetting.PickerSettingType.glucose)
     var low = PickerSetting(value: 70, step: 1, min: 40, max: 100, type: PickerSetting.PickerSettingType.glucose)
-    var maxCarbs = PickerSetting(value: 250, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gramms)
-    var maxFat = PickerSetting(value: 250, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gramms)
-    var maxProtein = PickerSetting(value: 250, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gramms)
+    var maxCarbs = PickerSetting(value: 250, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gram)
+    var maxFat = PickerSetting(value: 250, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gram)
+    var maxProtein = PickerSetting(value: 250, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gram)
     var overrideFactor = PickerSetting(value: 0.8, step: 0.05, min: 0.5, max: 1.5, type: PickerSetting.PickerSettingType.factor)
-    var fattyMealFactor = PickerSetting(value: 0.7, step: 0.05, min: 0.5, max: 2, type: PickerSetting.PickerSettingType.factor)
-    var sweetMealFactor = PickerSetting(value: 2, step: 0.05, min: 1, max: 3, type: PickerSetting.PickerSettingType.factor)
+    var fattyMealFactor = PickerSetting(value: 0.7, step: 0.05, min: 0.05, max: 1, type: PickerSetting.PickerSettingType.factor)
+    var sweetMealFactor = PickerSetting(value: 1, step: 0.05, min: 0.05, max: 2, type: PickerSetting.PickerSettingType.factor)
     var maxIOB = PickerSetting(value: 0, step: 1, min: 0, max: 20, type: PickerSetting.PickerSettingType.insulinUnit)
     var maxDailySafetyMultiplier = PickerSetting(
         value: 3,
@@ -76,8 +76,8 @@ struct DecimalPickerSettings {
         max: 300,
         type: PickerSetting.PickerSettingType.glucose
     )
-    var maxCOB = PickerSetting(value: 120, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gramms)
-    var min5mCarbimpact = PickerSetting(value: 8, step: 1, min: 0, max: 20, type: PickerSetting.PickerSettingType.gramms)
+    var maxCOB = PickerSetting(value: 120, step: 5, min: 0, max: 300, type: PickerSetting.PickerSettingType.gram)
+    var min5mCarbimpact = PickerSetting(value: 8, step: 1, min: 1, max: 20, type: PickerSetting.PickerSettingType.glucose)
     var autotuneISFAdjustmentFraction = PickerSetting(
         value: 1.0,
         step: 0.05,
@@ -92,7 +92,7 @@ struct DecimalPickerSettings {
         max: 1,
         type: PickerSetting.PickerSettingType.factor
     )
-    var remainingCarbsCap = PickerSetting(value: 90, step: 5, min: 0, max: 200, type: PickerSetting.PickerSettingType.gramms)
+    var remainingCarbsCap = PickerSetting(value: 90, step: 5, min: 0, max: 200, type: PickerSetting.PickerSettingType.gram)
     var maxSMBBasalMinutes = PickerSetting(value: 30, step: 5, min: 30, max: 180, type: PickerSetting.PickerSettingType.minute)
     var maxUAMSMBBasalMinutes = PickerSetting(value: 30, step: 5, min: 30, max: 180, type: PickerSetting.PickerSettingType.minute)
     var smbInterval = PickerSetting(value: 3, step: 1, min: 1, max: 10, type: PickerSetting.PickerSettingType.minute)
@@ -103,8 +103,8 @@ struct DecimalPickerSettings {
         max: 1,
         type: PickerSetting.PickerSettingType.insulinUnit
     )
-    var insulinPeakTime = PickerSetting(value: 75, step: 5, min: 35, max: 120, type: PickerSetting.PickerSettingType.minute)
-    var carbsReqThreshold = PickerSetting(value: 1.0, step: 0.1, min: 0, max: 10, type: PickerSetting.PickerSettingType.gramms)
+    var insulinPeakTime = PickerSetting(value: 75, step: 1, min: 35, max: 120, type: PickerSetting.PickerSettingType.minute)
+    var carbsReqThreshold = PickerSetting(value: 1.0, step: 0.1, min: 0, max: 10, type: PickerSetting.PickerSettingType.gram)
     var noisyCGMTargetMultiplier = PickerSetting(
         value: 1.3,
         step: 0.05,
@@ -119,15 +119,15 @@ struct DecimalPickerSettings {
         max: 0.4,
         type: PickerSetting.PickerSettingType.factor
     )
-    var adjustmentFactor = PickerSetting(value: 0.8, step: 0.1, min: 0.5, max: 1.5, type: PickerSetting.PickerSettingType.factor)
+    var adjustmentFactor = PickerSetting(value: 0.8, step: 0.05, min: 0.3, max: 1.5, type: PickerSetting.PickerSettingType.factor)
     var adjustmentFactorSigmoid = PickerSetting(
         value: 0.5,
-        step: 0.1,
-        min: 0.5,
+        step: 0.05,
+        min: 0.1,
         max: 2,
         type: PickerSetting.PickerSettingType.factor
     )
-    var weightPercentage = PickerSetting(value: 0.65, step: 0.1, min: 0.1, max: 1, type: PickerSetting.PickerSettingType.factor)
+    var weightPercentage = PickerSetting(value: 0.35, step: 0.05, min: 0.05, max: 1, type: PickerSetting.PickerSettingType.factor)
     var enableSMB_high_bg_target = PickerSetting(
         value: 110,
         step: 1,
@@ -141,7 +141,7 @@ struct DecimalPickerSettings {
     var minuteInterval = PickerSetting(value: 20, step: 5, min: 5, max: 60, type: PickerSetting.PickerSettingType.minute)
     var timeCap = PickerSetting(value: 8, step: 1, min: 5, max: 12, type: PickerSetting.PickerSettingType.hour)
     var hours = PickerSetting(value: 6, step: 0.5, min: 2, max: 24, type: PickerSetting.PickerSettingType.hour)
-    var dia = PickerSetting(value: 6, step: 0.5, min: 4, max: 10, type: PickerSetting.PickerSettingType.hour)
+    var dia = PickerSetting(value: 10, step: 0.5, min: 5, max: 10, type: PickerSetting.PickerSettingType.hour)
     var maxBolus = PickerSetting(value: 10, step: 0.5, min: 1, max: 30, type: PickerSetting.PickerSettingType.insulinUnit)
     var maxBasal = PickerSetting(value: 10, step: 0.5, min: 1, max: 30, type: PickerSetting.PickerSettingType.insulinUnit)
 }
@@ -156,7 +156,7 @@ struct PickerSetting {
     enum PickerSettingType {
         case glucose
         case factor
-        case gramms
+        case gram
         case insulinUnit
         case minute
         case hour

+ 7 - 7
FreeAPS/Sources/Models/FreeAPSSettings.swift

@@ -53,14 +53,14 @@ struct FreeAPSSettings: JSON, Equatable {
     var useAppleHealth: Bool = false
     var smoothGlucose: Bool = false
     var displayOnWatch: AwConfig = .BGTarget
-    var overrideHbA1cUnit: Bool = false
+    var hbA1cDisplayUnit: HbA1cDisplayUnit = .percent
     var high: Decimal = 180
     var low: Decimal = 70
     var hours: Int = 6
     var glucoseColorScheme: GlucoseColorScheme = .staticColor
     var xGridLines: Bool = true
     var yGridLines: Bool = true
-    var oneDimensionalGraph: Bool = false
+    var timeInRangeChartStyle: TimeInRangeChartStyle = .vertical
     var rulerMarks: Bool = true
     var forecastDisplayType: ForecastDisplayType = .cone
     var maxCarbs: Decimal = 250
@@ -73,7 +73,7 @@ struct FreeAPSSettings: JSON, Equatable {
     var fattyMeals: Bool = false
     var fattyMealFactor: Decimal = 0.7
     var sweetMeals: Bool = false
-    var sweetMealFactor: Decimal = 2
+    var sweetMealFactor: Decimal = 1
     var displayPresets: Bool = true
     var useLiveActivity: Bool = false
     var lockScreenView: LockScreenView = .simple
@@ -283,8 +283,8 @@ extension FreeAPSSettings: Decodable {
             settings.yGridLines = yGridLines
         }
 
-        if let oneDimensionalGraph = try? container.decode(Bool.self, forKey: .oneDimensionalGraph) {
-            settings.oneDimensionalGraph = oneDimensionalGraph
+        if let timeInRangeChartStyle = try? container.decode(TimeInRangeChartStyle.self, forKey: .timeInRangeChartStyle) {
+            settings.timeInRangeChartStyle = timeInRangeChartStyle
         }
 
         if let rulerMarks = try? container.decode(Bool.self, forKey: .rulerMarks) {
@@ -295,8 +295,8 @@ extension FreeAPSSettings: Decodable {
             settings.forecastDisplayType = forecastDisplayType
         }
 
-        if let overrideHbA1cUnit = try? container.decode(Bool.self, forKey: .overrideHbA1cUnit) {
-            settings.overrideHbA1cUnit = overrideHbA1cUnit
+        if let hbA1cDisplayUnit = try? container.decode(HbA1cDisplayUnit.self, forKey: .hbA1cDisplayUnit) {
+            settings.hbA1cDisplayUnit = hbA1cDisplayUnit
         }
 
         if let maxCarbs = try? container.decode(Decimal.self, forKey: .maxCarbs) {

+ 16 - 0
FreeAPS/Sources/Models/HbA1cDisplayUnit.swift

@@ -0,0 +1,16 @@
+import Foundation
+
+enum HbA1cDisplayUnit: String, JSON, CaseIterable, Identifiable, Codable, Hashable {
+    var id: String { rawValue }
+    case percent
+    case mmolMol
+
+    var displayName: String {
+        switch self {
+        case .percent:
+            return NSLocalizedString("Percent", comment: "")
+        case .mmolMol:
+            return NSLocalizedString("mmol/mol", comment: "")
+        }
+    }
+}

+ 0 - 1
FreeAPS/Sources/Models/Icons.swift

@@ -11,7 +11,6 @@ enum Icon_: String, CaseIterable, Identifiable {
     case wilford = "diabeetus"
     case catWithPod
     case catWithPodWhite = "catWithPodWhiteBG"
-    case loop = "trioLoop"
     var id: String { rawValue }
 }
 

+ 1 - 1
FreeAPS/Sources/Models/Preferences.swift

@@ -48,7 +48,7 @@ struct Preferences: JSON, Equatable {
     var enableDynamicCR: Bool = false
     var useNewFormula: Bool = false
     var useWeightedAverage: Bool = false
-    var weightPercentage: Decimal = 0.65
+    var weightPercentage: Decimal = 0.35
     var tddAdjBasal: Bool = false
     var enableSMB_high_bg: Bool = false
     var enableSMB_high_bg_target: Decimal = 110

+ 16 - 0
FreeAPS/Sources/Models/TimeInRangeChartStyle.swift

@@ -0,0 +1,16 @@
+import Foundation
+
+enum TimeInRangeChartStyle: String, JSON, CaseIterable, Identifiable, Codable, Hashable {
+    var id: String { rawValue }
+    case vertical
+    case horizontal
+
+    var displayName: String {
+        switch self {
+        case .vertical:
+            return NSLocalizedString("Vertical", comment: "")
+        case .horizontal:
+            return NSLocalizedString("Horizontal", comment: "")
+        }
+    }
+}

+ 2 - 2
FreeAPS/Sources/Models/TotalInsulinDisplayType.swift

@@ -14,9 +14,9 @@ enum TotalInsulinDisplayType: String, JSON, CaseIterable, Identifiable, Codable,
     var displayName: String {
         switch self {
         case .totalDailyDose:
-            return NSLocalizedString("Total Daily Dose", comment: "")
+            return NSLocalizedString("TDD", comment: "")
         case .totalInsulinInScope:
-            return NSLocalizedString("Total Insulin in Scope", comment: "")
+            return NSLocalizedString("TINS", comment: "")
         }
     }
 }

+ 1 - 1
FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/AlgorithmAdvancedSettingsProvider.swift

@@ -12,7 +12,7 @@ extension AlgorithmAdvancedSettings {
         func settings() -> PumpSettings {
             storage.retrieve(OpenAPS.Settings.settings, as: PumpSettings.self)
                 ?? PumpSettings(from: OpenAPS.defaults(for: OpenAPS.Settings.settings))
-                ?? PumpSettings(insulinActionCurve: 6.0, maxBolus: 10, maxBasal: 2)
+                ?? PumpSettings(insulinActionCurve: 10.0, maxBolus: 10, maxBasal: 2)
         }
 
         func savePreferences(_ preferences: Preferences) {

+ 1 - 1
FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/AlgorithmAdvancedSettingsStateModel.swift

@@ -23,7 +23,7 @@ extension AlgorithmAdvancedSettings {
         @Published var remainingCarbsCap: Decimal = 90
         @Published var noisyCGMTargetMultiplier: Decimal = 1.3
 
-        var insulinActionCurve: Decimal = 6
+        var insulinActionCurve: Decimal = 10
 
         var pumpSettings: PumpSettings {
             provider.settings()

+ 175 - 96
FreeAPS/Sources/Modules/AlgorithmAdvancedSettings/View/AlgorithmAdvancedSettingsRootView.swift

@@ -7,7 +7,7 @@ extension AlgorithmAdvancedSettings {
         @StateObject var state = StateModel()
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -23,7 +23,7 @@ extension AlgorithmAdvancedSettings {
                     content: {
                         VStack(alignment: .leading) {
                             Text(
-                                "The settings in this section are designed for advanced expert users and typically do not require ANY modifications."
+                                "The settings in this section typically do not require ANY modifications. Do not alter them without a solid understanding of what you are changing and the full impact it will have on the algorithm."
                             ).bold()
                         }
                     }
@@ -37,18 +37,23 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Max Daily Safety Multiplier", comment: "Max Daily Safety Multiplier")
                         }
                     ),
                     units: state.units,
                     type: .decimal("maxDailySafetyMultiplier"),
                     label: NSLocalizedString("Max Daily Safety Multiplier", comment: "Max Daily Safety Multiplier"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "This is an important OpenAPS safety limit. The default setting (which is unlikely to need adjusting) is 3. This means that OpenAPS will never be allowed to set a temporary basal rate that is more than 3x the highest hourly basal rate programmed in a user’s pump, or, if enabled, determined by autotune.",
-                        comment: "Max Daily Safety Multiplier"
-                    )
+                    miniHint: "Limits temporary basal rates to this percentage of your largest basal rate.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 300%").bold()
+                        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."
+                        )
+                        Text("It serves as a safety limit, ensuring no temporary basal rates exceed safe levels.")
+                        Text("Warning: Increasing this setting is not advised.").bold()
+                    }
                 )
 
                 SettingInputSection(
@@ -58,7 +63,7 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString(
                                 "Current Basal Safety Multiplier",
                                 comment: "Current Basal Safety Multiplier"
@@ -68,11 +73,18 @@ extension AlgorithmAdvancedSettings {
                     units: state.units,
                     type: .decimal("currentBasalSafetyMultiplier"),
                     label: NSLocalizedString("Current Basal Safety Multiplier", comment: "Current Basal Safety Multiplier"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "This is another important OpenAPS safety limit. The default setting (which is also unlikely to need adjusting) is 4. This means that OpenAPS will never be allowed to set a temporary basal rate that is more than 4x the current hourly basal rate programmed in a user’s pump, or, if enabled, determined by autotune.",
-                        comment: "Current Basal Safety Multiplier"
-                    )
+                    miniHint: "Limits temporary basal rates to this percentage of the current basal rate.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 400%").bold()
+                        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."
+                        )
+                        Text(
+                            "This prevents excessive dosing, especially during times of variable insulin sensitivity, enhancing safety."
+                        )
+                        Text("Warning: Increasing this setting is not advised.").bold()
+                    }
                 )
 
                 SettingInputSection(
@@ -82,15 +94,27 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Duration of Insulin Action"
                         }
                     ),
                     units: state.units,
                     type: .decimal("dia"),
                     label: "Duration of Insulin Action",
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: "Duration of Insulin Action… bla bla bla"
+                    miniHint: "Number of hours insulin is active in your body.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 10 hours").bold()
+                        Text(
+                            "The Duration of Insulin Action (DIA) defines how long your insulin continues to lower glucose readings after a dose."
+                        )
+                        Text(
+                            "This helps the system accurately track Insulin on Board (IOB), avoiding over- or under-corrections by considering the tail end of insulin's effect."
+                        )
+                        Text(
+                            "Tip: It is better to use Custom Peak Time rather than adjust your Duration of Insulin Action (DIA)."
+                        )
+                    }
                 )
 
                 SettingInputSection(
@@ -100,7 +124,7 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Use Custom Peak Time", comment: "Use Custom Peak Time")
                         }
                     ),
@@ -108,13 +132,20 @@ extension AlgorithmAdvancedSettings {
                     type: .conditionalDecimal("insulinPeakTime"),
                     label: NSLocalizedString("Use Custom Peak Time", comment: "Use Custom Peak Time"),
                     conditionalLabel: NSLocalizedString("Insulin Peak Time", comment: "Insulin Peak Time"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Defaults to false. Setting to true allows changing insulinPeakTime", comment: "Use Custom Peak Time"
-                    ) + NSLocalizedString(
-                        "Time of maximum blood glucose lowering effect of insulin, in minutes. Beware: Oref assumes for ultra-rapid (Lyumjev) & rapid-acting (Fiasp) curves minimal (35 & 50 min) and maximal (100 & 120 min) applicable insulinPeakTimes. Using a custom insulinPeakTime outside these bounds will result in issues with Trio, longer loop calculations and possible red loops.",
-                        comment: "Insulin Peak Time"
-                    )
+                    miniHint: "Set a custom time for peak insulin effect.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: Set by Insulin Type").bold()
+                        Text(
+                            "Insulin Peak Time defines when insulin is most effective in lowering glucose, set in minutes after dosing."
+                        )
+                        Text(
+                            "This peak informs the system when to expect the most potent glucose-lowering effect, helping it predict glucose trends more accurately."
+                        )
+                        Text("System-Determined Defaults:").bold()
+                        Text("Ultra-Rapid: 55 minutes (permitted range 35-100 minutes)")
+                        Text("Rapid-Acting: 75 minutes (permitted range 50-120 minutes)")
+                    }
                 )
 
                 SettingInputSection(
@@ -124,18 +155,24 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Skip Neutral Temps", comment: "Skip Neutral Temps")
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: NSLocalizedString("Skip Neutral Temps", comment: "Skip Neutral Temps"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Defaults to false, so that Trio will set temps whenever it can, so it will be easier to see if the system is working, even when you are offline. This means Trio will set a “neutral” temp (same as your default basal) if no adjustments are needed. This is an old setting for OpenAPS to have the options to minimise sounds and notifications from the 'rig', that may wake you up during the night.",
-                        comment: "Skip Neutral Temps"
-                    )
+                    miniHint: "Skip neutral temporary basal rates to reduce MDT pump alerts.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "When Skip Neutral Temps is enabled, Trio will not set neutral basal rates shortly before the hour, minimizing hourly pump alerts on MDT pumps. This can help light sleepers avoid alerts but will delay basal adjustments. This will also only come into effect if SMB's are disabled for whatever reason."
+                        )
+                        Text(
+                            "For most users, leaving this OFF is recommended to ensure consistent basal delivery and loop calculation. If this option is effective, loops will be skipped during the last 5 minutes of the hour."
+                        )
+                    }
                 )
 
                 SettingInputSection(
@@ -145,18 +182,22 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Unsuspend If No Temp", comment: "Unsuspend If No Temp")
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: NSLocalizedString("Unsuspend If No Temp", comment: "Unsuspend If No Temp"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Many people occasionally forget to resume / unsuspend their pump after reconnecting it. If you’re one of them, and you are willing to reliably set a zero temp basal whenever suspending and disconnecting your pump, this feature has your back. If enabled, it will automatically resume / unsuspend the pump if you forget to do so before your zero temp expires. As long as the zero temp is still running, it will leave the pump suspended.",
-                        comment: "Unsuspend If No Temp"
-                    )
+                    miniHint: "Resume pump automatically after suspension.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "Enabling Unsuspend If No Temp allows Trio to resume your pump if you forget, as long as a zero temp basal was set first. This feature ensures insulin delivery restarts if you forget to manually unsuspend, adding a safeguard for pump reconnections."
+                        )
+                        Text("Note: Applies only to pumps with on-pump suspend options")
+                    }
                 )
 
                 SettingInputSection(
@@ -166,43 +207,53 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Suspend Zeros IOB", comment: "Suspend Zeros IOB")
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: NSLocalizedString("Suspend Zeros IOB", comment: "Suspend Zeros IOB"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Default is false. Any existing temp basals during times the pump was suspended will be deleted and 0 temp basals to negate the profile basal rates during times pump is suspended will be added.",
-                        comment: "Suspend Zeros IOB"
-                    )
+                    miniHint: "Clear temporary basal rates and reset IOB when suspended.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "When Suspend Zeros IOB is enabled, any active temporary basal rates during a pump suspension are reset, with new 0 U/hr temporary basal rates added to counteract those done during suspension."
+                        )
+                        Text(
+                            "This prevents lingering insulin effects when your pump is suspended, ensuring safer management of insulin on board."
+                        )
+                        Text("Note: Applies only to pumps with on-pump suspend options.")
+                    }
                 )
 
-                SettingInputSection(
-                    decimalValue: $state.autotuneISFAdjustmentFraction,
-                    booleanValue: $booleanPlaceholder,
-                    shouldDisplayHint: $shouldDisplayHint,
-                    selectedVerboseHint: Binding(
-                        get: { selectedVerboseHint },
-                        set: {
-                            selectedVerboseHint = $0
-                            hintLabel = NSLocalizedString(
-                                "Autotune ISF Adjustment Fraction",
-                                comment: "Autotune ISF Adjustment Fraction"
-                            )
-                        }
-                    ),
-                    units: state.units,
-                    type: .decimal("autotuneISFAdjustmentFraction"),
-                    label: NSLocalizedString("Autotune ISF Adjustment Fraction", comment: "Autotune ISF Adjustment Fraction"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "The default of 0.5 for this value keeps autotune ISF closer to pump ISF via a weighted average of fullNewISF and pumpISF. 1.0 allows full adjustment, 0 is no adjustment from pump ISF.",
-                        comment: "Autotune ISF Adjustment Fraction"
-                    )
-                )
+                // Commenting out Autotune from Settings Menu until full removal is complete
+                // SettingInputSection(
+                // decimalValue: $state.autotuneISFAdjustmentFraction,
+                // booleanValue: $booleanPlaceholder,
+                // shouldDisplayHint: $shouldDisplayHint,
+                // selectedVerboseHint: Binding(
+                // get: { selectedVerboseHint },
+                // set: {
+                // selectedVerboseHint = $0.map { AnyView($0) }
+                // hintLabel = NSLocalizedString(
+                // "Autotune ISF Adjustment Percent",
+                // comment: "Autotune ISF Adjustment Percent"
+                // )
+                // }
+                // ),
+                // units: state.units,
+                // type: .decimal("autotuneISFAdjustmentFraction"),
+                // label: NSLocalizedString("Autotune ISF Adjustment Percent", comment: "Autotune ISF Adjustment Percent"),
+                // miniHint: "Using Autotune is not advised",
+                // verboseHint: Text(
+                // NSLocalizedString(
+                // "The default of 50% for this value keeps autotune ISF closer to pump ISF via a weighted average of fullNewISF and pumpISF. 100% allows full adjustment, 0% is no adjustment from pump ISF.",
+                // comment: "Autotune ISF Adjustment Percent"
+                // )
+                // )
+                // )
 
                 SettingInputSection(
                     decimalValue: $state.min5mCarbimpact,
@@ -211,18 +262,26 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
-                            hintLabel = NSLocalizedString("Min 5m Carbimpact", comment: "Min 5m Carbimpact")
+                            selectedVerboseHint = $0.map { AnyView($0) }
+                            hintLabel = NSLocalizedString("Min 5m Carb Impact", comment: "Min 5m Carb Impact")
                         }
                     ),
                     units: state.units,
                     type: .decimal("min5mCarbimpact"),
-                    label: NSLocalizedString("Min 5m Carbimpact", comment: "Min 5m Carbimpact"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "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"
-                    )
+                    label: NSLocalizedString("Min 5m Carb Impact", comment: "Min 5m Carb Impact"),
+                    miniHint: "Default impact of carb absorption over a 5 minute interval.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text(
+                            "Min 5m Carb Impact sets the expected glucose rise from carbs over 5 minutes when absorption isn't obvious from glucose data."
+                        )
+                        Text(
+                            "The default value of 8 mg/dL per 5 minutes corresponds to an absorption rate of 24 g of carbs per hour."
+                        )
+                        Text(
+                            "This setting helps the system estimate how much glucose your body is absorbing, even when it's not immediately visible in your glucose data, ensuring more accurate insulin dosing during carb absorption."
+                        )
+                    }
                 )
 
                 SettingInputSection(
@@ -232,18 +291,24 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
-                            hintLabel = NSLocalizedString("Remaining Carbs Fraction", comment: "Remaining Carbs Fraction")
+                            selectedVerboseHint = $0.map { AnyView($0) }
+                            hintLabel = NSLocalizedString("Remaining Carbs Percentage", comment: "Remaining Carbs Percentage")
                         }
                     ),
                     units: state.units,
                     type: .decimal("remainingCarbsFraction"),
-                    label: NSLocalizedString("Remaining Carbs Fraction", comment: "Remaining Carbs Fraction"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "This is the fraction of carbs we’ll assume will absorb over 4h if we don’t yet see carb absorption.",
-                        comment: "Remaining Carbs Fraction"
-                    )
+                    label: NSLocalizedString("Remaining Carbs Percentage", comment: "Remaining Carbs Percentage"),
+                    miniHint: "Percentage of carbs still available if no absorption is detected.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 100%").bold()
+                        Text(
+                            "Remaining Carbs Percentage estimates carbs still absorbing over 4 hours if glucose data doesn't show clear absorption."
+                        )
+                        Text(
+                            "This fallback setting prevents under-dosing by spreading a portion of the entered carbs over time, balancing insulin needs with undetected carb impact."
+                        )
+                    }
                 )
 
                 SettingInputSection(
@@ -253,18 +318,24 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Remaining Carbs Cap", comment: "Remaining Carbs Cap")
                         }
                     ),
                     units: state.units,
                     type: .decimal("remainingCarbsCap"),
                     label: NSLocalizedString("Remaining Carbs Cap", comment: "Remaining Carbs Cap"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "This is the amount of the maximum number of carbs we’ll assume will absorb over 4h if we don’t yet see carb absorption.",
-                        comment: "Remaining Carbs Cap"
-                    )
+                    miniHint: "Maximum amount of carbs still available if no absorption is detected.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 90 g").bold()
+                        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."
+                        )
+                        Text(
+                            "This cap prevents the system from overestimating how much insulin is needed when carb absorption isn't visible, offering a safeguard for accurate dosing."
+                        )
+                    }
                 )
 
                 SettingInputSection(
@@ -274,26 +345,34 @@ extension AlgorithmAdvancedSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Noisy CGM Target Multiplier", comment: "Noisy CGM Target Multiplier")
                         }
                     ),
                     units: state.units,
                     type: .decimal("noisyCGMTargetMultiplier"),
-                    label: NSLocalizedString("Noisy CGM Target Multiplier", comment: "Noisy CGM Target Multiplier"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Defaults to 1.3. Increase target by this amount when looping off raw/noisy CGM data",
-                        comment: "Noisy CGM Target Multiplier"
-                    )
+                    label: NSLocalizedString("Noisy CGM Target Increase", comment: "Noisy CGM Target Increase"),
+                    miniHint: "Percentage increase of glucose target when CGM is inconsistent.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 130%").bold()
+                        Text(
+                            "The Noisy CGM Target Increase raises your glucose target when the system detects noisy or raw CGM data. By default, the target is increased to 130% of your set target glucose to account for the less reliable glucose readings."
+                        )
+                        Text(
+                            "This helps reduce the risk of incorrect insulin dosing based on inaccurate sensor data, ensuring safer insulin adjustments during periods of poor CGM accuracy."
+                        )
+                        Text("Note: A CGM is considered noisy when it provides inconsistent readings.")
+                    }
                 )
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 50 - 20
FreeAPS/Sources/Modules/AutosensSettings/View/AutosensSettingsRootView.swift

@@ -7,7 +7,7 @@ extension AutosensSettings {
         @StateObject var state = StateModel()
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -25,18 +25,27 @@ extension AutosensSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Autosens Max", comment: "Autosens Max")
                         }
                     ),
                     units: state.units,
                     type: .decimal("autosensMax"),
                     label: NSLocalizedString("Autosens Max", comment: "Autosens Max"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "This is a multiplier cap for autosens (and autotune) to set a 20% max limit on how high the autosens ratio can be, which in turn determines how high autosens can adjust basals, how low it can adjust ISF, and how low it can set the BG target.",
-                        comment: "Autosens Max"
-                    ),
+                    miniHint: "Upper limit of the Autosens Ratio.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 120%").bold()
+                        Text(
+                            "Autosens Max sets the maximum Autosens Ratio used by Autosens, Dynamic ISF, and Sigmoid Formula."
+                        )
+                        Text(
+                            "The Autosens Ratio is used to calculate the amount of adjustment needed to basal rates, ISF, and CR."
+                        )
+                        Text(
+                            "Tip: Increasing this value allows automatic adjustments of basal rates to be higher, ISF to be lower, and CR to be lower."
+                        )
+                    },
                     headerText: "Glucose Deviations Algorithm"
                 )
 
@@ -47,18 +56,27 @@ extension AutosensSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Autosens Min", comment: "Autosens Min")
                         }
                     ),
                     units: state.units,
                     type: .decimal("autosensMin"),
                     label: NSLocalizedString("Autosens Min", comment: "Autosens Min"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "The other side of the autosens safety limits, putting a cap on how low autosens can adjust basals, and how high it can adjust ISF and BG targets.",
-                        comment: "Autosens Min"
-                    )
+                    miniHint: "Lower limit of the Autosens Ratio.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 80%").bold()
+                        Text(
+                            "Autosens Min sets the minimum Autosens Ratio used by Autosens, Dynamic ISF, and Sigmoid Formula."
+                        )
+                        Text(
+                            "The Autosens Ratio is used to calculate the amount of adjustment needed to basal rates, ISF, and CR."
+                        )
+                        Text(
+                            "Tip: Decreasing this value allows automatic adjustments of basal rates to be lower, ISF to be higher, and CR to be higher."
+                        )
+                    }
                 )
 
                 SettingInputSection(
@@ -68,26 +86,38 @@ extension AutosensSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Rewind Resets Autosens", comment: "Rewind Resets Autosens")
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: NSLocalizedString("Rewind Resets Autosens", comment: "Rewind Resets Autosens"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "This feature, enabled by default, resets the autosens ratio to neutral when you rewind your pump, on the assumption that this corresponds to a probable site change. Autosens will begin learning sensitivity anew from the time of the rewind, which may take up to 6 hours. If you usually rewind your pump independently of site changes, you may want to consider disabling this feature.",
-                        comment: "Rewind Resets Autosens"
-                    )
+                    miniHint: "Pump rewind initiates a reset in Autosens Ratio.",
+                    verboseHint: VStack(alignment: .leading, spacing: 5) {
+                        Text("Default: ON").bold()
+                        Text("Medtronic Users Only").bold()
+                        VStack(alignment: .leading, spacing: 10) {
+                            Text(
+                                "This feature resets the Autosens Ratio to neutral when you rewind your pump on the assumption that this corresponds to a site change."
+                            )
+                            Text(
+                                "Autosens will begin learning sensitivity anew from the time of the rewind, which may take up to 6 hours."
+                            )
+                            Text(
+                                "Tip: If you usually rewind your pump independently of site changes, you may want to consider disabling this feature."
+                            )
+                        }
+                    }
                 )
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 23 - 18
FreeAPS/Sources/Modules/AutotuneConfig/View/AutotuneConfigRootView.swift

@@ -8,7 +8,7 @@ extension AutotuneConfig {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -48,15 +48,20 @@ extension AutotuneConfig {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Use Autotune"
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: "Use Autotune",
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: "Autotune… bla bla bla",
+                    miniHint: "It is not advised to use Autotune with Trio.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("It is not advised to use Autotune with Trio").bold()
+                        Text("Autotune is not designed to work with Trio. It is best to keep Autotune off and do not use it.")
+
+                    },
                     headerText: "Data-driven Adjustments"
                 )
 
@@ -68,15 +73,15 @@ extension AutotuneConfig {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
+                                selectedVerboseHint = $0.map { AnyView($0) }
                                 hintLabel = "Only Autotune Basal Insulin"
                             }
                         ),
                         units: state.units,
                         type: .boolean,
                         label: "Only Autotune Basal Insulin",
-                        miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                        verboseHint: "Only Autotune Basal Insulin… bla bla bla"
+                        miniHint: "Restricts Autotune adjustments to only basal settings.",
+                        verboseHint: Text("Restricts Autotune adjustments to only basal settings.")
                     )
                 }
 
@@ -156,16 +161,16 @@ extension AutotuneConfig {
                         .tint(.white)
                     }
 
-                    // Section {
-                    //     Button {
-                    //         replaceAlert = true
-                    //     } label: {
-                    //         Text("Save as Normal Basal Rates")
-                    //     }
-                    //     .frame(maxWidth: .infinity, alignment: .center)
-                    //     .listRowBackground(Color(.systemGray4))
-                    //     .tint(.white)
-                    // }
+                    Section {
+                        Button {
+                            replaceAlert = true
+                        } label: {
+                            Text("Save as Normal Basal Rates")
+                        }
+                        .frame(maxWidth: .infinity, alignment: .center)
+                        .listRowBackground(Color(.systemGray4))
+                        .tint(.white)
+                    }
                 }
             }
             .sheet(isPresented: $shouldDisplayHint) {
@@ -173,7 +178,7 @@ extension AutotuneConfig {
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 67 - 21
FreeAPS/Sources/Modules/BolusCalculatorConfig/View/BolusCalculatorConfigRootView.swift

@@ -9,7 +9,7 @@ extension BolusCalculatorConfig {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -32,7 +32,7 @@ extension BolusCalculatorConfig {
         }
 
         var body: some View {
-            Form {
+            List {
                 SettingInputSection(
                     decimalValue: $decimalPlaceholder,
                     booleanValue: $state.displayPresets,
@@ -40,15 +40,18 @@ extension BolusCalculatorConfig {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Display Meal Presets"
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: "Display Meal Presets",
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr."
+                    miniHint: "Allow the creation of saved, preset meals.",
+                    verboseHint: VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: ON").bold()
+                        Text("Enabling this feature allows you to create and save preset meals.")
+                    }
                 )
 
                 SettingInputSection(
@@ -58,15 +61,27 @@ extension BolusCalculatorConfig {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Recommended Bolus Percentage"
                         }
                     ),
                     units: state.units,
                     type: .decimal("overrideFactor"),
                     label: "Recommended Bolus Percentage",
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: "Recommended Bolus Percentage… bla bla bla",
+                    miniHint: "Percentage of bolus suggested in bolus calculator.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: 80%").bold()
+                        Text(
+                            "Recommended Bolus Percentage is a safety feature built into Trio. Trio first calculates an insulin required value, which is the full dosage. That dosage is then multiplied by your Recommended Bolus Percentage to display your suggested insulin dose in the bolus calculator."
+                        )
+                        Text(
+                            "Because Trio utilizes SMBs and UAM SMBs to help you reach your target glucose and other AID systems do not bolus for COB the same way Trio does, this is initially set to below the full calculated amount (80%). When SMBs and UAM SMBs are enabled, you may find your current CR results in lows and needs to be increased before you increase this setting closer to or at 100%."
+                        )
+                        Text(
+                            "Tip: If you are a new Trio user, it is not advised to set this to 100% until you have verified that your core settings (basal rates, ISF, and CR) do not need adjusting."
+                        )
+                    },
                     headerText: "Calculator Configuration"
                 )
 
@@ -77,16 +92,31 @@ extension BolusCalculatorConfig {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
-                            hintLabel = "Fatty Meal Factor"
+                            selectedVerboseHint = $0.map { AnyView($0) }
+                            hintLabel = "Fatty Meal"
                         }
                     ),
                     units: state.units,
                     type: .conditionalDecimal("fattyMealFactor"),
-                    label: "Enable Fatty Meal Factor",
-                    conditionalLabel: "Fatty Meal Factor",
-                    miniHint: "Lower your bolus recommendation by factor x for fatty meals.",
-                    verboseHint: "You can add the option in your bolus calculator to apply another (!) customizable factor at the end of the calculation which could be useful for fatty meals, e.g Pizza (default 0.7)."
+                    label: "Enable Fatty Meal Option",
+                    conditionalLabel: "Fatty Meal Bolus Percentage",
+                    miniHint: "Add and set a bolus option for meals that absorb slowly.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text("Default Percent: 70%").bold()
+                        Text("Do not enable this feature until you have optimized your CR (carb ratio) setting.").bold()
+                        Text(
+                            "Enabling this setting adds a \"Fatty Meal\" option to the bolus calculator. Once this feature is enabled, a percentage setting will appear for you to select."
+                        )
+                        Text(
+                            "When \"Fatty Meal\" is selected in the bolus calculator, the recommended bolus will be multiplied by the \"Fatty Meal Bolus Percentage\" as well as the \"Recommended Bolus Percentage\"."
+                        )
+                        Text(
+                            "If you have a \"Recommended Bolus Percentage\" of 80%, and a \"Fatty Meal Bolus Percentage\" of 70%, your recommended bolus will be multiplied by: (80 × 70) ÷ 100 = 56%."
+                        )
+                        Text("This could be useful for slow absorbing meals like pizza.")
+                    }
                 )
 
                 SettingInputSection(
@@ -96,24 +126,40 @@ extension BolusCalculatorConfig {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
-                            hintLabel = "Super Bolus & Sweet Meal Factor"
+                            selectedVerboseHint = $0.map { AnyView($0) }
+                            hintLabel = "Super Bolus"
                         }
                     ),
                     units: state.units,
                     type: .conditionalDecimal("sweetMealFactor"),
-                    label: "Enable Super Bolus",
-                    conditionalLabel: "Super Bolus Factor",
-                    miniHint: "Add x times current scheduled basal rate to your bolus recommendation.",
-                    verboseHint: "You can enable the super bolus functionality which could be useful when eating sweets/cake etc. Therefore your current basal rate will be added x-times to your bolus recommendation. You can adjust the factor X here, the default is 2 times your current scheduled basal rate."
+                    label: "Enable Super Bolus Option",
+                    conditionalLabel: "Super Bolus Percentage",
+                    miniHint: "Add and set a bolus option for meals that absorb quickly.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text("Default Percent: 200%").bold()
+                        Text("Do not enable this feature until you have optimized your CR (carb ratio) setting.").bold()
+                        Text(
+                            "Enabling this setting adds a \"Super Bolus\" option to the bolus calculator. Once this feature is enabled, a percentage setting will appear for you to select."
+                        )
+                        Text(
+                            "When \"Super Bolus\" is selected in the bolus calculator, your current basal rate multiplied by \"Super Bolus Percentage\" will be added to your bolus recommendation."
+                        )
+                        Text(
+                            "If your current basal rate is 0.8 U/hr and \"Super Bolus Percentage\" is set to 200%: 0.8 × (200 ÷ 100) = 1.6 units will be added to your bolus recommendation."
+                        )
+                        Text("This could be useful for fast absorbing meals like sugary cereal.")
+                    }
                 )
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 33 - 12
FreeAPS/Sources/Modules/CGM/View/CGMRootView.swift

@@ -11,7 +11,7 @@ extension CGM {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -21,7 +21,7 @@ extension CGM {
 
         var body: some View {
             NavigationView {
-                Form {
+                List {
                     Section(
                         header: Text("CGM Integration to Trio"),
                         content: {
@@ -35,9 +35,9 @@ extension CGM {
                                     }
                                 }.padding(.top)
 
-                                HStack(alignment: .top) {
+                                HStack(alignment: .center) {
                                     Text(
-                                        "Lorem ipsum dolor sit amet, consetetur sadipscing elitr."
+                                        "Select your CGM. See hint for compatible devices."
                                     )
                                     .font(.footnote)
                                     .foregroundColor(.secondary)
@@ -47,7 +47,11 @@ extension CGM {
                                         action: {
                                             hintLabel = "Available CGM Types for Trio"
                                             selectedVerboseHint =
-                                                "CGM Types… bla bla \n\nLorem ipsum dolor sit amet, consetetur sadipscing elitr."
+                                                AnyView(
+                                                    Text(
+                                                        "• Dexcom G5 \n• Dexcom G6 / ONE \n• Dexcom G7 / ONE+ \n• Dexcom Share \n• Freestyle Libre \n• Freestyle Libre Demo \n• Glucose Simulator \n• Medtronic Enlite \n• Nightscout \n• xDrip4iOS"
+                                                    )
+                                                )
                                             shouldDisplayHint.toggle()
                                         },
                                         label: {
@@ -146,9 +150,9 @@ extension CGM {
                                     Text("CGM is not used as heartbeat.").padding(.top)
                                 }
 
-                                HStack(alignment: .top) {
+                                HStack(alignment: .center) {
                                     Text(
-                                        "Lorem ipsum dolor sit amet, consetetur sadipscing elitr."
+                                        "A heartbeat tells Trio to start a loop cycle. This is required for closed loop."
                                     )
                                     .font(.footnote)
                                     .foregroundColor(.secondary)
@@ -157,7 +161,12 @@ extension CGM {
                                     Button(
                                         action: {
                                             hintLabel = "CGM Heartbeat"
-                                            selectedVerboseHint = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr."
+                                            selectedVerboseHint =
+                                                AnyView(
+                                                    Text(
+                                                        "The CGM Heartbeat can come from either a CGM or a pump to wake up Trio when phone is locked or in the background. If CGM is on the same phone as Trio and xDrip4iOS is configured to use the same AppGroup as Trio and the heartbeat feature is turned on in xDrip4iOS, then the CGM can provide a heartbeat to wake up Trio when phone is locked or app is in the background."
+                                                    )
+                                                )
                                             shouldDisplayHint.toggle()
                                         },
                                         label: {
@@ -184,15 +193,27 @@ extension CGM {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
+                                selectedVerboseHint = $0.map { AnyView($0) }
                                 hintLabel = "Smooth Glucose Value"
                             }
                         ),
                         units: state.units,
                         type: .boolean,
                         label: "Smooth Glucose Value",
-                        miniHint: "Smooth CGM readings using Savitzky–Golay filtering.",
-                        verboseHint: "Smooth Glucose Value… bla bla bla"
+                        miniHint: "Smooth CGM readings using Savitzky-Golay filtering.",
+                        verboseHint:
+                        VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: OFF").bold()
+                            Text(
+                                "This filter looks at small groups of nearby readings and fits them to a simple mathematical curve. This process doesn't change the overall pattern of your glucose data but helps smooth out the \"noise\" or irregular fluctuations that could lead to false highs or lows."
+                            )
+                            Text(
+                                "It's designed to keep the important trends in your data while minimizing those small, misleading variations, giving you and Trio a clearer sense of where your blood sugar is really headed. This type of filtering is useful in Trio, as it can help prevent over-corrections based on inaccurate glucose readings. This can help reduce the impact of sudden spikes or dips that might not reflect your true blood glucose levels."
+                            )
+                            Text(
+                                "Note: If enabled, the smoothed values you see in Trio may differ from what is shown in your CGM app."
+                            )
+                        }
                     )
                 }
                 .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
@@ -205,7 +226,7 @@ extension CGM {
                         hintDetent: $hintDetent,
                         shouldDisplayHint: $shouldDisplayHint,
                         hintLabel: hintLabel ?? "",
-                        hintText: selectedVerboseHint ?? "",
+                        hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                         sheetTitle: "Help"
                     )
                 }

+ 47 - 11
FreeAPS/Sources/Modules/CalendarEventSettings/View/CalendarEventSettingsRootView.swift

@@ -7,7 +7,7 @@ extension CalendarEventSettings {
         @StateObject var state = StateModel()
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -25,15 +25,28 @@ extension CalendarEventSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Create Events in Calendar"
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: "Create Events in Calendar",
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: "Create Calendar Events… bla bla bla",
+                    miniHint: "Use calendar events to display current data.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "When enabled, Trio will create a customizable calendar event to keep you notified of your current glucose reading with every successful loop cycle."
+                        )
+                        Text(
+                            "This is useful if you use CarPlay or a variety of other external services that limit the view of most apps, but allow the calendar app."
+                        )
+                        Text(
+                            "Once enabled, the available customizations will appear. You can customize with the calendar of your choosing, use of emoji labels, and the inclusion of IOB & COB data."
+                        )
+                        Text("Note: Once a new calendar event is created, the previous event will be deleted.")
+                    },
                     headerText: "Diabetes Data as Calendar Event"
                 )
 
@@ -55,15 +68,32 @@ extension CalendarEventSettings {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
+                                selectedVerboseHint = $0.map { AnyView($0) }
                                 hintLabel = "Display Emojis as Labels"
                             }
                         ),
                         units: state.units,
                         type: .boolean,
                         label: "Display Emojis as Labels",
-                        miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                        verboseHint: "Display Emojis as Labels… bla bla bla"
+                        miniHint: "Use emojis for calendar events. See hint for more details.",
+                        verboseHint: VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: OFF").bold()
+                            VStack(alignment: .leading, spacing: 5) {
+                                Text(
+                                    "When enabled, the calendar event created will indicate whether glucose readings are in-range or out-of-range using the following color emojis:"
+                                )
+                                Text("🟢: In-Range")
+                                Text("🟠: Above-Range")
+                                Text("🔴: Below-Range")
+                            }
+                            VStack(alignment: .leading, spacing: 5) {
+                                Text(
+                                    "If \"Display IOB and COB\" is also enabled, \"IOB\" and \"COB\" will be replaced with the following emojis:"
+                                )
+                                Text("💉: IOB")
+                                Text("🥨: COB")
+                            }
+                        }
                     )
 
                     SettingInputSection(
@@ -73,15 +103,20 @@ extension CalendarEventSettings {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
+                                selectedVerboseHint = $0.map { AnyView($0) }
                                 hintLabel = "Display IOB and COB"
                             }
                         ),
                         units: state.units,
                         type: .boolean,
                         label: "Display IOB and COB",
-                        miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                        verboseHint: "Display IOB and COB… bla bla bla"
+                        miniHint: "Include IOB & COB in the calendar event data.",
+                        verboseHint: VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: OFF").bold()
+                            Text(
+                                "When enabled, Trio will include the current IOB and COB values, along with the current glucose reading, in each calendar event created."
+                            )
+                        }
                     )
                 } else if state.useCalendar {
                     if #available(iOS 17.0, *) {
@@ -98,12 +133,13 @@ extension CalendarEventSettings {
                     }
                 }
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 1 - 1
FreeAPS/Sources/Modules/CarbRatioEditor/CarbRatioEditorStateModel.swift

@@ -10,7 +10,7 @@ extension CarbRatioEditor {
 
         let timeValues = stride(from: 0.0, to: 1.days.timeInterval, by: 30.minutes.timeInterval).map { $0 }
 
-        let rateValues = stride(from: 1.0, to: 501.0, by: 1.0).map { ($0.decimal ?? .zero) / 10 }
+        let rateValues = stride(from: 30.0, to: 501.0, by: 1.0).map { ($0.decimal ?? .zero) / 10 }
 
         var canAdd: Bool {
             guard let lastItem = items.last else { return true }

+ 1 - 1
FreeAPS/Sources/Modules/DataTable/DataTableProvider.swift

@@ -11,7 +11,7 @@ extension DataTable {
         func pumpSettings() -> PumpSettings {
             storage.retrieve(OpenAPS.Settings.settings, as: PumpSettings.self)
                 ?? PumpSettings(from: OpenAPS.defaults(for: OpenAPS.Settings.settings))
-                ?? PumpSettings(insulinActionCurve: 6, maxBolus: 10, maxBasal: 2)
+                ?? PumpSettings(insulinActionCurve: 10, maxBolus: 10, maxBasal: 2)
         }
 
         func deleteCarbsFromNightscout(withID id: String) {

Разница между файлами не показана из-за своего большого размера
+ 154 - 33
FreeAPS/Sources/Modules/DynamicSettings/View/DynamicSettingsRootView.swift


+ 1 - 1
FreeAPS/Sources/Modules/GeneralSettings/UnitsLimitsSettingsProvider.swift

@@ -16,7 +16,7 @@ extension UnitsLimitsSettings {
         func settings() -> PumpSettings {
             storage.retrieve(OpenAPS.Settings.settings, as: PumpSettings.self)
                 ?? PumpSettings(from: OpenAPS.defaults(for: OpenAPS.Settings.settings))
-                ?? PumpSettings(insulinActionCurve: 6.0, maxBolus: 10, maxBasal: 2)
+                ?? PumpSettings(insulinActionCurve: 10.0, maxBolus: 10, maxBasal: 2)
         }
 
         func save(settings: PumpSettings) -> AnyPublisher<Void, Error> {

Разница между файлами не показана из-за своего большого размера
+ 57 - 20
FreeAPS/Sources/Modules/GeneralSettings/View/UnitsLimitsSettingsRootView.swift


Разница между файлами не показана из-за своего большого размера
+ 89 - 32
FreeAPS/Sources/Modules/GlucoseNotificationSettings/View/GlucoseNotificationSettingsRootView.swift


+ 21 - 16
FreeAPS/Sources/Modules/HealthKit/View/AppleHealthKitRootView.swift

@@ -8,7 +8,7 @@ extension AppleHealthKit {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -17,7 +17,7 @@ extension AppleHealthKit {
         @Environment(AppState.self) var appState
 
         var body: some View {
-            Form {
+            List {
                 SettingInputSection(
                     decimalValue: $decimalPlaceholder,
                     booleanValue: $state.useAppleHealth,
@@ -25,18 +25,20 @@ extension AppleHealthKit {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Connect to Apple Health"
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: "Connect to Apple Health",
-                    miniHint: "Allows Trio to read from and write to Apple Health.",
-                    verboseHint: NSLocalizedString(
-                        "This allows Trio to read from and write to Apple Health. You must also give permissions in iOS Settings > Health > Data Access. If you enter a glucose value into Apple Health, open Trio to confirm it shows up.",
-                        comment: "Suspend Zeros IOB"
-                    ),
+                    miniHint: "Allow Trio to read from and write to Apple Health.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text("This allows Trio to read from and write to Apple Health.")
+                        Text("Warning: You must also give permissions in iOS System Settings for the Health app.").bold()
+                    },
                     headerText: "Apple Health Integration"
                 )
 
@@ -47,25 +49,28 @@ extension AppleHealthKit {
                                 Image(systemName: "exclamationmark.circle.fill")
                                 Text("Give Apple Health Write Permissions")
                             }.padding(.bottom)
-                            Text("""
-                            1. Open the Settings app on your iOS device.
-                            2. Scroll down and select "Health."
-                            3. Tap on "Data Access & Devices."
-                            4. Find and select "Trio" from the list of apps.
-                            5. Ensure that the "Write Data" option is enabled for the desired health metrics.
-                            """).font(.footnote)
+                            VStack(alignment: .leading, spacing: 5) {
+                                Text("1. Open the Settings app on your iOS device.")
+                                Text(
+                                    "2. Scroll down or type \"Health\" in the settings search bar and select the \"Health\" app."
+                                )
+                                Text("3. Tap on \"Data Access & Devices\".")
+                                Text("4. Find and select \"Trio\" from the list of apps.")
+                                Text("5. Ensure that the \"Write Data\" option is enabled for the desired health metrics.")
+                            }.font(.footnote)
                         }
                         .padding(.vertical)
                         .foregroundColor(Color.secondary)
                     }.listRowBackground(Color.chart)
                 }
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 1 - 1
FreeAPS/Sources/Modules/Home/HomeProvider.swift

@@ -36,7 +36,7 @@ extension Home {
         func pumpSettings() -> PumpSettings {
             storage.retrieve(OpenAPS.Settings.settings, as: PumpSettings.self)
                 ?? PumpSettings(from: OpenAPS.defaults(for: OpenAPS.Settings.settings))
-                ?? PumpSettings(insulinActionCurve: 6, maxBolus: 10, maxBasal: 2)
+                ?? PumpSettings(insulinActionCurve: 10, maxBolus: 10, maxBasal: 2)
         }
 
         func pumpReservoir() -> Decimal? {

+ 3 - 3
FreeAPS/Sources/Modules/Home/HomeStateModel.swift

@@ -59,7 +59,7 @@ extension Home {
         var highGlucose: Decimal = 180
         var currentGlucoseTarget: Decimal = 100
         var glucoseColorScheme: GlucoseColorScheme = .staticColor
-        var overrideUnit: Bool = false
+        var hbA1cDisplayUnit: HbA1cDisplayUnit = .percent
         var displayXgridLines: Bool = false
         var displayYgridLines: Bool = false
         var thresholdLines: Bool = false
@@ -357,7 +357,7 @@ extension Home {
             maxValue = settingsManager.preferences.autosensMax
             lowGlucose = settingsManager.settings.low
             highGlucose = settingsManager.settings.high
-            overrideUnit = settingsManager.settings.overrideHbA1cUnit
+            hbA1cDisplayUnit = settingsManager.settings.hbA1cDisplayUnit
             displayXgridLines = settingsManager.settings.xGridLines
             displayYgridLines = settingsManager.settings.yGridLines
             thresholdLines = settingsManager.settings.rulerMarks
@@ -574,7 +574,7 @@ extension Home.StateModel:
         Task {
             await getCurrentGlucoseTarget()
         }
-        overrideUnit = settingsManager.settings.overrideHbA1cUnit
+        hbA1cDisplayUnit = settingsManager.settings.hbA1cDisplayUnit
         glucoseColorScheme = settingsManager.settings.glucoseColorScheme
         displayXgridLines = settingsManager.settings.xGridLines
         displayYgridLines = settingsManager.settings.yGridLines

+ 20 - 9
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -938,22 +938,30 @@ extension Home {
             List {
                 DefinitionRow(
                     term: "IOB (Insulin on Board)",
-                    definition: "Forecasts BG based on the amount of insulin still active in the body.",
+                    definition: Text(
+                        "Forecasts future glucose readings based on the amount of insulin still active in the body."
+                    ),
                     color: .insulin
                 )
                 DefinitionRow(
                     term: "ZT (Zero-Temp)",
-                    definition: "Forecasts the worst-case blood glucose (BG) scenario if no carbs are absorbed and insulin delivery is stopped until BG starts rising.",
+                    definition: Text(
+                        "Forecasts the worst-case future glucose reading scenario if no carbs are absorbed and insulin delivery is stopped until glucose starts rising."
+                    ),
                     color: .zt
                 )
                 DefinitionRow(
                     term: "COB (Carbs on Board)",
-                    definition: "Forecasts BG changes by considering the amount of carbohydrates still being absorbed in the body.",
+                    definition: Text(
+                        "Forecasts future glucose reading changes by considering the amount of carbohydrates still being absorbed in the body."
+                    ),
                     color: .loopYellow
                 )
                 DefinitionRow(
                     term: "UAM (Unannounced Meal)",
-                    definition: "Forecasts BG levels and insulin dosing needs for unexpected meals or other causes of BG rises without prior notice.",
+                    definition: Text(
+                        "Forecasts future glucose levels and insulin dosing needs for unexpected meals or other causes of glucose reading increases without prior notice."
+                    ),
                     color: .uam
                 )
             }
@@ -965,11 +973,14 @@ extension Home {
             List {
                 DefinitionRow(
                     term: "Cone of Uncertainty",
-                    definition: """
-                    For simplicity reasons, oref's various forecast curves are displayed as a "Cone of Uncertainty" that depicts a possible, forecasted range of future glucose fluctuation based on the current data and the algorithm's result.
-
-                    To modify the forecast display type, go to Trio Settings > Features > User Interface > Forecast Display Type.
-                    """,
+                    definition: VStack {
+                        Text(
+                            "For simplicity reasons, oref's various forecast curves are displayed as a \"Cone of Uncertainty\" that depicts a possible, forecasted range of future glucose fluctuation based on the current data and the algothim's result."
+                        )
+                        Text(
+                            "Note: To modify the forecast display type, go to Trio Settings > Features > User Interface > Forecast Display Type."
+                        )
+                    },
                     color: Color.blue.opacity(0.5)
                 )
             }

+ 48 - 8
FreeAPS/Sources/Modules/LiveActivitySettings/View/LiveActivitySettingsRootView.swift

@@ -9,7 +9,7 @@ extension LiveActivitySettings {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -52,15 +52,32 @@ extension LiveActivitySettings {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
+                                selectedVerboseHint = $0.map { AnyView($0) }
                                 hintLabel = "Enable Live Activity"
                             }
                         ),
                         units: state.units,
                         type: .boolean,
                         label: "Enable Live Activity",
-                        miniHint: "Live Activities display Trio's glucose readings, and other current data on the iPhone Lock Screen and in the Dynamic Island",
-                        verboseHint: "With Live Activities, you can let Trio display most current data, e.g. glucose reading from CGM, insulin on board, carbohydrates on board, or even a glucose trend chart, on the iPhone Lock Screen and in the Dynamic Island. It allows you to refer to live information at a glance and perform quick actions in your diabetes management.",
+                        miniHint: "Display customizable data on Lock Screen and Dynamic Island.",
+                        verboseHint: VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: OFF").bold()
+                            VStack(alignment: .leading, spacing: 10) {
+                                Text(
+                                    "With Live Activities enabled, Trio displays your choice of the following current data on your iPhone's Lock Screen and in the Dynamic Island:"
+                                )
+                                VStack(alignment: .leading) {
+                                    Text("• Current Glucose Reading")
+                                    Text("• IOB: Insulin On Board")
+                                    Text("• COB: Carbohydrates On Board")
+                                    Text("• Last Updated: Time of Last Loop Cycle")
+                                    Text("• Glucose Trend Chart")
+                                }.font(.footnote)
+                                Text(
+                                    "It allows you to refer to live information at a glance and perform quick actions in your diabetes management."
+                                )
+                            }
+                        },
                         headerText: "Display Live Data From Trio"
                     )
 
@@ -76,9 +93,9 @@ extension LiveActivitySettings {
                                     }
                                 }.padding(.top)
 
-                                HStack(alignment: .top) {
+                                HStack(alignment: .center) {
                                     Text(
-                                        "Trio Live Activities can be simplistic or detailed in their information display. See hint for more details."
+                                        "Select simple or detailed style. See hint for more details."
                                     )
                                     .font(.footnote)
                                     .foregroundColor(.secondary)
@@ -88,7 +105,29 @@ extension LiveActivitySettings {
                                         action: {
                                             hintLabel = "Lock Screen Widget Style"
                                             selectedVerboseHint =
-                                                "Trio's simple lock screen widget only display current glucose reading, trend arrow, delta and the timestamp of the current reading.\n\nThe detailed Lock Screen widget offers users a glucose chart, glucose trend arrow, glucose delta, current insulin and carbohydrates on board, and an icon as an indicator for running overrides."
+                                                AnyView(
+                                                    VStack(alignment: .leading, spacing: 10) {
+                                                        Text("Default: Simple").bold()
+                                                        VStack(alignment: .leading, spacing: 10) {
+                                                            Text("Simple:").bold()
+                                                            Text(
+                                                                "Trio's Simple Lock Screen Widget displays current glucose reading, trend arrow, delta and the timestamp of the current reading."
+                                                            )
+                                                        }
+                                                        VStack(alignment: .leading, spacing: 10) {
+                                                            Text("Detailed:").bold()
+                                                            Text(
+                                                                "The Detailed Lock Screen Widget offers users a glucose chart as well as the ability to customize the information provided in the Detailed Widget using the following options:"
+                                                            )
+                                                        }
+                                                        VStack(alignment: .leading) {
+                                                            Text("• Current Glucose Reading")
+                                                            Text("• IOB: Insulin On Board")
+                                                            Text("• COB: Carbohydrates On Board")
+                                                            Text("• Last Updated: Time of Last Loop Cycle")
+                                                        }.font(.footnote)
+                                                    }
+                                                )
                                             shouldDisplayHint.toggle()
                                         },
                                         label: {
@@ -115,6 +154,7 @@ extension LiveActivitySettings {
                     }
                 }
             }
+            .listSectionSpacing(sectionSpacing)
             .onReceive(resolver.resolve(LiveActivityBridge.self)!.$systemEnabled, perform: {
                 self.systemLiveActivitySetting = $0
             })
@@ -123,7 +163,7 @@ extension LiveActivitySettings {
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 121 - 30
FreeAPS/Sources/Modules/MealSettings/View/MealSettingsRootView.swift

@@ -9,7 +9,7 @@ extension MealSettings {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -41,7 +41,7 @@ extension MealSettings {
         }
 
         var body: some View {
-            Form {
+            List {
                 Section(
                     header: Text("Limits per Entry"),
                     content: {
@@ -146,9 +146,9 @@ extension MealSettings {
                                 }
                             }
 
-                            HStack(alignment: .top) {
+                            HStack(alignment: .center) {
                                 Text(
-                                    "Set limits for entering meals in treatment view."
+                                    "Set limits for each type of macro per meal entry."
                                 )
                                 .lineLimit(nil)
                                 .font(.footnote)
@@ -158,7 +158,17 @@ extension MealSettings {
                                 Button(
                                     action: {
                                         hintLabel = "Limits per Entry"
-                                        selectedVerboseHint = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr."
+                                        selectedVerboseHint =
+                                            AnyView(
+                                                VStack(alignment: .leading, spacing: 5) {
+                                                    Text("Max Carbs:").bold()
+                                                    Text("Enter the largest carbohydrate value allowed per meal entry")
+                                                    Text("Max Fat:").bold()
+                                                    Text("Enter the largest fat value allowed per meal entry")
+                                                    Text("Max Protein:").bold()
+                                                    Text("Enter the largest protein value allowed per meal entry")
+                                                }
+                                            )
                                         shouldDisplayHint.toggle()
                                     },
                                     label: {
@@ -179,18 +189,51 @@ extension MealSettings {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
-                            hintLabel = "Display and Allow Fat and Protein Entries"
+                            selectedVerboseHint = $0.map { AnyView($0) }
+                            hintLabel = "Enable Fat and Protein Entries"
                         }
                     ),
                     units: state.units,
                     type: .boolean,
-                    label: "Display and Allow Fat and Protein Entries",
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: "Allows fat and protein to be converted into future carb equivalents using the Warsaw formula of kilocalories divided by 10.\n\nDefaults: Spread Duration: 8 h, Spread Interval: 30 min, FPU Factor: 0.5, Delay 60 min.",
+                    label: "Enable Fat and Protein Entries",
+                    miniHint: "Add fat and protein macros to meal entries.",
+                    verboseHint: VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        VStack(spacing: 10) {
+                            Text(
+                                "Enabling this setting allows you to log fat and protein, which are then converted into future carb equivalents using the Warsaw Method."
+                            )
+                            VStack(alignment: .leading, spacing: 5) {
+                                Text("Warsaw Method:").bold()
+                                Text(
+                                    "The Warsaw Method helps account for the delayed glucose spikes caused by fat and protein in meals. It uses Fat-Protein Units (FPU) to calculate the carb effect from fat and protein. The system spreads insulin delivery over several hours to mimic natural insulin release, helping to manage post-meal glucose spikes."
+                                )
+                            }
+                            VStack(alignment: .center, spacing: 5) {
+                                Text("Fat Conversion").bold()
+                                Text("𝑭 = fat(g) × 90%")
+                            }
+                            VStack(alignment: .center, spacing: 5) {
+                                Text("Protein Conversion").bold()
+                                Text("𝑷 = protein(g) × 40%")
+                            }
+                            VStack(alignment: .center, spacing: 5) {
+                                Text("FPU Conversion").bold()
+                                Text("𝑭 + 𝑷 = g CHO")
+                            }
+                            VStack(alignment: .leading, spacing: 5) {
+                                Text(
+                                    "You can personalize the conversion calculation by adjusting the following settings that will appear when this option is enabled:"
+                                )
+                                Text("• Fat and Protein Delay")
+                                Text("• Maximum Duration")
+                                Text("• Spread Interval")
+                                Text("• Fat and Protein Percentage")
+                            }
+                        }
+                    },
                     headerText: "Fat and Protein"
                 )
-
                 if state.useFPUconversion {
                     SettingInputSection(
                         decimalValue: $state.delay,
@@ -199,15 +242,24 @@ extension MealSettings {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
+                                selectedVerboseHint = $0.map { AnyView($0) }
                                 hintLabel = "Fat and Protein Delay"
                             }
                         ),
                         units: state.units,
                         type: .decimal("delay"),
                         label: "Fat and Protein Delay",
-                        miniHint: "Delay is time from now until the first future carb entry.",
-                        verboseHint: "X-Axis Interval Step… bla bla bla"
+                        miniHint: "Delay between fat & protein entry and first FPU entry.",
+                        verboseHint:
+                        VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: 60 min").bold()
+                            Text(
+                                "The Fat and Protein Delay setting defines the time between when you log fat and protein and when the system starts delivering insulin for the Fat-Protein Unit Carb Equivalents (FPUs)."
+                            )
+                            Text(
+                                "This delay accounts for the slower absorption of fat and protein, as calculated by the Warsaw Method, ensuring insulin delivery is properly timed to manage glucose spikes caused by high-fat, high-protein meals."
+                            )
+                        }
                     )
 
                     SettingInputSection(
@@ -217,15 +269,27 @@ extension MealSettings {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
-                                hintLabel = "Maximum Duration (hours)"
+                                selectedVerboseHint = $0.map { AnyView($0) }
+                                hintLabel = "Maximum Duration"
                             }
                         ),
                         units: state.units,
                         type: .decimal("timeCap"),
-                        label: "Maximum Duration (hours)",
-                        miniHint: "Carb spread over a maximum number of hours (5-12).",
-                        verboseHint: "This spreads the carb equivilants over a maximum duration setting that can be configured from 5-12 hours."
+                        label: "Maximum Duration",
+                        miniHint: "Set the maximum timeframe to extend FPUs.",
+                        verboseHint:
+                        VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: 8 hours").bold()
+                            Text(
+                                "This sets the maximum length of time that Fat and Protein Carb Equivalents (FPUs) will be extended over from a single Fat and/or Protein bolus calcultor entry."
+                            )
+                            Text(
+                                "It is one factor used in combination with the Fat and Protein Delay, Spread Interval, and Fat and Protein Factor to create the FPU entries."
+                            )
+                            Text("Increasing this setting may result in more FPU entries with smaller carb values.")
+                            Text("Decreasing this setting may result in fewer FPU entries with larger carb values.")
+                            Text("Note: Accepted range for this setting is 5 - 12 hours.")
+                        }
                     )
 
                     SettingInputSection(
@@ -235,15 +299,25 @@ extension MealSettings {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
-                                hintLabel = "Spread Interval (minutes)"
+                                selectedVerboseHint = $0.map { AnyView($0) }
+                                hintLabel = "Spread Interval"
                             }
                         ),
                         units: state.units,
                         type: .decimal("minuteInterval"),
-                        label: "Spread Interval (minutes)",
-                        miniHint: "Interval in minutes is how many minutes are between entries.",
-                        verboseHint: "Interval in minutes is how many minutes are between entries. The shorter the interval, the smoother the result. 10, 15, 20, 30, or 60 are reasonable choices."
+                        label: "Spread Interval",
+                        miniHint: "Time interval between FPUs.",
+                        verboseHint:
+                        VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: 30 minutes").bold()
+                            Text(
+                                "This determines how many minutes will be between individual Fat-Protein Unit Carb Equivalent (FPU) entries from a single Fat and/or Protein bolus calculator entry."
+                            )
+                            Text("The shorter the interval, the smoother the correlating dosing result.")
+                            Text("Increasing this setting may result in fewer FPU entries with larger carb values.")
+                            Text("Decreasing this setting may result in more FPU entries with smaller carb values.")
+                            Text("Accepted range for this setting is 5 - 60 minutes.")
+                        }
                     )
 
                     SettingInputSection(
@@ -253,24 +327,41 @@ extension MealSettings {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
-                                hintLabel = "Fat and Protein Factor"
+                                selectedVerboseHint = $0.map { AnyView($0) }
+                                hintLabel = "Fat and Protein Percentage"
                             }
                         ),
                         units: state.units,
                         type: .decimal("individualAdjustmentFactor"),
-                        label: "Fat and Protein Factor",
-                        miniHint: "Influences how many carb equivalents are recorded for fat and protein.",
-                        verboseHint: "The Fat and Protein Factor influences how much effect the fat and protein has on the entries. 1.0 is full effect (original Warsaw Method) and 0.5 is half effect. Note that you may find that your normal carb ratio needs to increase to a larger number if you begin adding fat and protein entries. For this reason, it is best to start with a factor of about 0.5 to ease into it."
+                        label: "Fat and Protein Percentage",
+                        miniHint: "Adjust the Warsaw Method FPU Conversion rate.",
+                        verboseHint: VStack(alignment: .leading, spacing: 10) {
+                            Text("Default: 50%").bold()
+                            VStack(spacing: 10) {
+                                Text("This setting changes how much effect the fat and protein entry has on FPUs.")
+                                VStack(alignment: .center, spacing: 5) {
+                                    Text("50% is half effect:").bold()
+                                    Text("(Fat × 45%) + (Protein × 20%)")
+                                    Text("100% is full effect:").bold()
+                                    Text("(Fat × 90%) + (Protein × 40%)")
+                                    Text("200% is double effect:").bold()
+                                    Text("(Fat × 180%) + (Protein x 80%)")
+                                }
+                                Text(
+                                    "Tip: You may find that your normal carb ratio needs to increase to a larger number when you begin adding fat and protein entries. For this reason, it is best to start with a factor of about 50%."
+                                )
+                            }
+                        }
                     )
                 }
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 1 - 1
FreeAPS/Sources/Modules/NightscoutConfig/NightscoutConfigProvider.swift

@@ -16,7 +16,7 @@ extension NightscoutConfig {
         func getPumpSettings() -> PumpSettings {
             storage.retrieve(OpenAPS.Settings.settings, as: PumpSettings.self)
                 ?? PumpSettings(from: OpenAPS.defaults(for: OpenAPS.Settings.settings))
-                ?? PumpSettings(insulinActionCurve: 6.0, maxBolus: 10, maxBasal: 2)
+                ?? PumpSettings(insulinActionCurve: 10.0, maxBolus: 10, maxBasal: 2)
         }
 
         func savePumpSettings(settings: PumpSettings) -> AnyPublisher<Void, Error> {

+ 36 - 14
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConfigRootView.swift

@@ -12,7 +12,7 @@ extension NightscoutConfig {
         @State var importedHasRun = false
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -22,7 +22,7 @@ extension NightscoutConfig {
 
         var body: some View {
             ZStack {
-                Form {
+                List {
                     Section(
                         header: Text("Nightscout Integration"),
                         content: {
@@ -50,15 +50,18 @@ extension NightscoutConfig {
                             Button {
                                 importAlert = Alert(
                                     title: Text("Import Therapy Settings?"),
-                                    message: Text(
-                                        "Are you sure you want to import profile settings from Nightscout?\n\nThis will overwrite the following Trio therapy settings: Basal Rates, Insulin Sensitivities, Carb Ratios, Target Glucose, and Duration of Insulin Action."
-                                    ),
+                                    message: Text("Are you sure you want to import profile settings from Nightscout?\n\n")
+                                        + Text("This will overwrite the following Trio therapy settings:\n")
+                                        + Text("• Basal Rates\n")
+                                        + Text("• Insulin Sensitivities\n")
+                                        + Text("• Carb Ratios\n")
+                                        + Text("• Glucose Targets\n")
+                                        + Text("• Duration of Insulin Action"),
                                     primaryButton: .default(
                                         Text("Yes, Import!"),
                                         action: {
                                             Task {
                                                 await state.importSettings()
-                                                // Check the import status and errors after the import process finishes
                                                 if state.importStatus == .failed, state.importErrors.isNotEmpty,
                                                    let errorMessage = state.importErrors.first
                                                 {
@@ -84,9 +87,9 @@ extension NightscoutConfig {
                                 .buttonStyle(.bordered)
                                 .disabled(state.url.isEmpty || state.connecting)
 
-                            HStack(alignment: .top) {
+                            HStack(alignment: .center) {
                                 Text(
-                                    "You can import therapy settings from Nightscout. See hint for more information which settings will be overwritten."
+                                    "Import therapy settings from Nightscout.\nSee hint for the list of settings available for import."
                                 )
                                 .font(.footnote)
                                 .foregroundColor(.secondary)
@@ -96,7 +99,20 @@ extension NightscoutConfig {
                                     action: {
                                         hintLabel = "Import Settings from Nightscout"
                                         selectedVerboseHint =
-                                            "This will overwrite the following Trio therapy settings: \n • Basal Rates \n • Insulin Sensitivities \n • Carb Ratios \n • Target Glucose \n • Duration of Insulin Action"
+                                            AnyView(
+                                                VStack(alignment: .leading, spacing: 10) {
+                                                    Text(
+                                                        "This will overwrite the following Trio therapy settings:"
+                                                    )
+                                                    VStack(alignment: .leading) {
+                                                        Text("• Basal Rates")
+                                                        Text("• Insulin Sensitivities")
+                                                        Text("• Carb Ratios")
+                                                        Text("• Glucose Targets")
+                                                        Text("• Duration of Insulin Action")
+                                                    }
+                                                }
+                                            )
                                         shouldDisplayHint.toggle()
                                     },
                                     label: {
@@ -124,9 +140,9 @@ extension NightscoutConfig {
                                     .buttonStyle(.bordered)
                                     .disabled(state.url.isEmpty || state.connecting || state.backfilling)
 
-                                HStack(alignment: .top) {
+                                HStack(alignment: .center) {
                                     Text(
-                                        "You can backfill missing glucose data from Nightscout."
+                                        "Backfill missing glucose data from Nightscout."
                                     )
                                     .font(.footnote)
                                     .foregroundColor(.secondary)
@@ -136,7 +152,11 @@ extension NightscoutConfig {
                                         action: {
                                             hintLabel = "Backfill Glucose from Nightscout"
                                             selectedVerboseHint =
-                                                "Explanation… limitation… etc."
+                                                AnyView(
+                                                    Text(
+                                                        "This will backfill 24 hours of glucose data from your connected Nightscout URL to Trio"
+                                                    )
+                                                )
                                             shouldDisplayHint.toggle()
                                         },
                                         label: {
@@ -149,7 +169,9 @@ extension NightscoutConfig {
                             }.padding(.vertical)
                         }
                     ).listRowBackground(Color.chart)
-                }.blur(radius: state.importStatus == .running ? 5 : 0)
+                }
+                .listSectionSpacing(sectionSpacing)
+                .blur(radius: state.importStatus == .running ? 5 : 0)
 
                 if state.importStatus == .running {
                     CustomProgressView(text: "Importing Profile...")
@@ -163,7 +185,7 @@ extension NightscoutConfig {
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 2 - 1
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutConnectView.swift

@@ -15,7 +15,7 @@ struct NightscoutConnectView: View {
     }
 
     var body: some View {
-        Form {
+        List {
             Section(
                 header: Text("Connect to Nightscout"),
                 content: {
@@ -90,6 +90,7 @@ struct NightscoutConnectView: View {
 //                }
 //            } header: { Text("Local glucose source") }.listRowBackground(Color.chart)
         }
+        .listSectionSpacing(sectionSpacing)
         .navigationTitle("Connect")
         .navigationBarTitleDisplayMode(.automatic)
         .scrollContentBackground(.hidden)

+ 24 - 9
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutFetchView.swift

@@ -6,7 +6,7 @@ struct NightscoutFetchView: View {
 
     @State private var shouldDisplayHint: Bool = false
     @State var hintDetent = PresentationDetent.large
-    @State var selectedVerboseHint: String?
+    @State var selectedVerboseHint: AnyView?
     @State var hintLabel: String?
     @State private var decimalPlaceholder: Decimal = 0.0
     @State private var booleanPlaceholder: Bool = false
@@ -15,7 +15,7 @@ struct NightscoutFetchView: View {
     @Environment(AppState.self) var appState
 
     var body: some View {
-        Form {
+        List {
             SettingInputSection(
                 decimalValue: $decimalPlaceholder,
                 booleanValue: $state.isDownloadEnabled,
@@ -23,15 +23,20 @@ struct NightscoutFetchView: View {
                 selectedVerboseHint: Binding(
                     get: { selectedVerboseHint },
                     set: {
-                        selectedVerboseHint = $0
+                        selectedVerboseHint = $0.map { AnyView($0) }
                         hintLabel = "Allow Fetching from Nightscout"
                     }
                 ),
                 units: state.units,
                 type: .boolean,
                 label: "Allow Fetching from Nightscout",
-                miniHint: "Enable fetching of selected data sets from Nightscout. See hint for more details.",
-                verboseHint: "The Fetch Treatments toggle enables fetching of carbs and temp targets entered in Careportal or by another uploading device than Trio from Nightscout.",
+                miniHint: "Enable fetching of selected data sets from Nightscout.",
+                verboseHint: VStack(alignment: .leading, spacing: 10) {
+                    Text("Default: OFF").bold()
+                    Text(
+                        "The Fetch Treatments toggle enables fetching of carbs and temp targets entered in Careportal or by another uploading device than Trio from Nightscout."
+                    )
+                },
                 headerText: "Remote & Fetch Capabilities"
             )
 
@@ -43,15 +48,24 @@ struct NightscoutFetchView: View {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Allow Remote Control of Trio"
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: "Allow Remote Control of Trio",
-                    miniHint: "Enables selected remote control capabilities via Nightscout. See hint for more details.",
-                    verboseHint: "When enabled you allow these remote functions through announcements from Nightscout: \n • Suspend/Resume Pump \n • Opening/Closing Loop \n  • Set Temp Basal \n • Enact Bolus"
+                    miniHint: "Enables selected remote control capabilities via Nightscout.",
+                    verboseHint: VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text("When enabled you allow the following remote functions through announcements from Nightscout:")
+                        VStack(alignment: .leading) {
+                            Text("• Suspend/Resume Pump")
+                            Text("• Opening/Closing Loop")
+                            Text("• Set Temp Basal")
+                            Text("• Enact Bolus")
+                        }
+                    }
                 )
             } else {
                 Section {
@@ -59,12 +73,13 @@ struct NightscoutFetchView: View {
                 }.listRowBackground(Color.tabBar)
             }
         }
+        .listSectionSpacing(sectionSpacing)
         .sheet(isPresented: $shouldDisplayHint) {
             SettingInputHintView(
                 hintDetent: $hintDetent,
                 shouldDisplayHint: $shouldDisplayHint,
                 hintLabel: hintLabel ?? "",
-                hintText: selectedVerboseHint ?? "",
+                hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                 sheetTitle: "Help"
             )
         }

+ 26 - 9
FreeAPS/Sources/Modules/NightscoutConfig/View/NightscoutUploadView.swift

@@ -5,7 +5,7 @@ struct NightscoutUploadView: View {
 
     @State private var shouldDisplayHint: Bool = false
     @State var hintDetent = PresentationDetent.large
-    @State var selectedVerboseHint: String?
+    @State var selectedVerboseHint: AnyView?
     @State var hintLabel: String?
     @State private var decimalPlaceholder: Decimal = 0.0
     @State private var booleanPlaceholder: Bool = false
@@ -14,7 +14,7 @@ struct NightscoutUploadView: View {
     @Environment(AppState.self) var appState
 
     var body: some View {
-        Form {
+        List {
             SettingInputSection(
                 decimalValue: $decimalPlaceholder,
                 booleanValue: $state.isUploadEnabled,
@@ -22,7 +22,7 @@ struct NightscoutUploadView: View {
                 selectedVerboseHint: Binding(
                     get: { selectedVerboseHint },
                     set: {
-                        selectedVerboseHint = $0
+                        selectedVerboseHint = $0.map { AnyView($0) }
                         hintLabel = "Allow Uploading to Nightscout"
                         shouldDisplayHint = true
                     }
@@ -30,8 +30,21 @@ struct NightscoutUploadView: View {
                 units: state.units,
                 type: .boolean,
                 label: "Allow Uploading to Nightscout",
-                miniHint: "Enables upload of selected data sets to Nightscout. See hint for more details.",
-                verboseHint: "The Upload Treatments toggle enables uploading of carbs, temp targets, device status, preferences and settings."
+                miniHint: "Enable uploading of selected data sets to Nightscout.",
+                verboseHint:
+                VStack(alignment: .leading, spacing: 10) {
+                    Text("Default: OFF").bold()
+                    Text(
+                        "The Upload Treatments toggle enables uploading of the following data sets to your connected Nightscout URL:"
+                    )
+                    VStack(alignment: .leading, spacing: 5) {
+                        Text("• Carbs")
+                        Text("• Temp Targets")
+                        Text("• Device Status")
+                        Text("• Preferences")
+                        Text("• Settings")
+                    }
+                }
             )
 
             if state.changeUploadGlucose {
@@ -42,7 +55,7 @@ struct NightscoutUploadView: View {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Upload Glucose"
                             shouldDisplayHint = true
                         }
@@ -50,17 +63,21 @@ struct NightscoutUploadView: View {
                     units: state.units,
                     type: .boolean,
                     label: "Upload Glucose",
-                    miniHint: "Enables uploading of CGM readings to Nightscout.",
-                    verboseHint: "Write stuff here."
+                    miniHint: "Enable uploading of CGM readings to Nightscout.",
+                    verboseHint: VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text("Enabling this setting allows CGM readings from Trio to be used in Nightscout.")
+                    }
                 )
             }
         }
+        .listSectionSpacing(sectionSpacing)
         .sheet(isPresented: $shouldDisplayHint) {
             SettingInputHintView(
                 hintDetent: $hintDetent,
                 shouldDisplayHint: $shouldDisplayHint,
                 hintLabel: hintLabel ?? "",
-                hintText: selectedVerboseHint ?? "",
+                hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                 sheetTitle: "Help"
             )
         }

+ 12 - 5
FreeAPS/Sources/Modules/NightscoutConfig/View/ProfileImport/ReviewInsulinActionView.swift

@@ -10,7 +10,7 @@ struct ReviewInsulinActionView: BaseView {
 
     @State private var shouldDisplayHint: Bool = false
     @State private var hintDetent = PresentationDetent.large
-    @State private var selectedVerboseHint: String?
+    @State private var selectedVerboseHint: AnyView?
     @State private var hintLabel: String?
     @State private var decimalPlaceholder: Decimal = 0.0
     @State private var booleanPlaceholder: Bool = false
@@ -27,15 +27,22 @@ struct ReviewInsulinActionView: BaseView {
                 selectedVerboseHint: Binding(
                     get: { selectedVerboseHint },
                     set: {
-                        selectedVerboseHint = $0
+                        selectedVerboseHint = $0.map { AnyView($0) }
                         hintLabel = "Duration of Insulin Action"
                     }
                 ),
                 units: state.units,
                 type: .decimal("dia"),
                 label: "Duration of Insulin Action",
-                miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                verboseHint: "Duration of Insulin Action… bla bla bla",
+                miniHint: "Number of hours insulin is active in your body.",
+                verboseHint:
+                VStack(alignment: .leading, spacing: 10) {
+                    Text("Default: 10 hours").bold()
+                    Text("Number of hours insulin will contribute to IOB after dosing.")
+                    Text(
+                        "Tip: It is better to use a Custom Peak Time than to adjust Duration of Insulin Action (DIA)."
+                    )
+                },
                 headerText: "Review imported DIA"
             )
         }
@@ -44,7 +51,7 @@ struct ReviewInsulinActionView: BaseView {
                 hintDetent: $hintDetent,
                 shouldDisplayHint: $shouldDisplayHint,
                 hintLabel: hintLabel ?? "",
-                hintText: selectedVerboseHint ?? "",
+                hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                 sheetTitle: "Help"
             )
         }

+ 1 - 1
FreeAPS/Sources/Modules/PumpConfig/PumpConfigProvider.swift

@@ -22,7 +22,7 @@ extension PumpConfig {
         func pumpSettings() -> PumpSettings {
             storage.retrieve(OpenAPS.Settings.settings, as: PumpSettings.self)
                 ?? PumpSettings(from: OpenAPS.defaults(for: OpenAPS.Settings.settings))
-                ?? PumpSettings(insulinActionCurve: 6, maxBolus: 10, maxBasal: 2)
+                ?? PumpSettings(insulinActionCurve: 10, maxBolus: 10, maxBasal: 2)
         }
 
         var alertNotAck: AnyPublisher<Bool, Never> {

+ 20 - 5
FreeAPS/Sources/Modules/PumpConfig/View/PumpConfigRootView.swift

@@ -9,7 +9,7 @@ extension PumpConfig {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -47,9 +47,9 @@ extension PumpConfig {
                                         .frame(maxWidth: .infinity, alignment: .center)
                                         .buttonStyle(.bordered)
 
-                                    HStack(alignment: .top) {
+                                    HStack(alignment: .center) {
                                         Text(
-                                            "Pair a compatible pump with Trio. See details for available devices."
+                                            "Pair your insulin pump with Trio. See hint for compatible devices."
                                         )
                                         .font(.footnote)
                                         .foregroundColor(.secondary)
@@ -59,7 +59,22 @@ extension PumpConfig {
                                             action: {
                                                 hintLabel = "Pump Pairing to Trio"
                                                 selectedVerboseHint =
-                                                    "Explanation… limitation… etc."
+                                                    AnyView(
+                                                        VStack(alignment: .leading, spacing: 10) {
+                                                            Text(
+                                                                "Current Pump Models Supported:"
+                                                            )
+                                                            VStack(alignment: .leading) {
+                                                                Text("• Medtronic")
+                                                                Text("• Omnipod Eros")
+                                                                Text("• Omnipod Dash")
+                                                                Text("• Pump Simulator")
+                                                            }
+                                                            Text(
+                                                                "Note: If using a pump simulator, you will not have continuous readings from the CGM in Trio. Using a pump simulator is only advisable for becoming familiar with the app user interface. It will not give you insight on how the algorithm will respond."
+                                                            )
+                                                        }
+                                                    )
                                                 shouldDisplayHint.toggle()
                                             },
                                             label: {
@@ -86,7 +101,7 @@ extension PumpConfig {
                         hintDetent: $hintDetent,
                         shouldDisplayHint: $shouldDisplayHint,
                         hintLabel: hintLabel ?? "",
-                        hintText: selectedVerboseHint ?? "",
+                        hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                         sheetTitle: "Help"
                     )
                 }

+ 15 - 6
FreeAPS/Sources/Modules/RemoteControlConfig/View/RemoteControlConfig.swift

@@ -11,7 +11,7 @@ extension RemoteControlConfig {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var isCopied: Bool = false
@@ -20,7 +20,7 @@ extension RemoteControlConfig {
         @Environment(AppState.self) var appState
 
         var body: some View {
-            Form {
+            List {
                 SettingInputSection(
                     decimalValue: $decimalPlaceholder,
                     booleanValue: $state.isTrioRemoteControlEnabled,
@@ -28,15 +28,23 @@ extension RemoteControlConfig {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Enable Remote Command"
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: "Enable Remote Control",
-                    miniHint: "Remote Control allow Trio to receive instructions, such as boluses and temp targets, from LoopFollow.",
-                    verboseHint: "When Remote Control is enabled, you can send boluses, overrides, temporary targets, carbs, and other commands to Trio via push notifications. To ensure security, these commands are protected by a shared secret, which must be entered in LoopFollow.",
+                    miniHint: "Allow Trio to receive commands from Loop Follow remotely.",
+                    verboseHint: VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "When Remote Control is enabled, you can send boluses, overrides, temporary targets, carbs, and other commands to Trio via push notifications."
+                        )
+                        Text(
+                            "To ensure security, these commands are protected by a shared secret, which must be entered in the Loop Follow app."
+                        )
+                    },
                     headerText: "Trio Remote Control"
                 )
 
@@ -79,12 +87,13 @@ extension RemoteControlConfig {
                     }
                 ).listRowBackground(Color.chart)
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

Разница между файлами не показана из-за своего большого размера
+ 189 - 78
FreeAPS/Sources/Modules/SMBSettings/View/SMBSettingsRootView.swift


+ 10 - 8
FreeAPS/Sources/Modules/Settings/SettingItems.swift

@@ -73,7 +73,7 @@ enum SettingItems {
         SettingItem(title: "ISF", view: .isfEditor, path: ["Therapy Settings"]),
         SettingItem(title: "Carb Ratios", view: .crEditor, path: ["Therapy Settings"]),
         SettingItem(title: "CR", view: .crEditor, path: ["Therapy Settings"]),
-        SettingItem(title: "Target Glucose", view: .targetsEditor, path: ["Therapy Settings"])
+        SettingItem(title: "Glucose Targets", view: .targetsEditor, path: ["Therapy Settings"])
     ]
 
     static let algorithmItems = [
@@ -97,7 +97,7 @@ enum SettingItems {
             path: ["Algorithm", "Super Micro Bolus (SMB)"]
         ),
         SettingItem(
-            title: "Dynamic Sensitivity",
+            title: "Dynamic Settings",
             view: .dynamicISF,
             searchContents: [
                 "Activate Dynamic Sensitivity (ISF)",
@@ -136,7 +136,7 @@ enum SettingItems {
                 "Unsuspend If No Temp",
                 "Suspend Zeros IOB",
                 "Min 5m Carbimpact",
-                "Autotune ISF Adjustment Fractio",
+                // "Autotune ISF Adjustment Fraction",
                 "Remaining Carbs Fraction",
                 "Remaining Carbs Cap",
                 "Noisy CGM Target Multiplier"
@@ -191,26 +191,28 @@ enum SettingItems {
             view: .userInterfaceSettings,
             searchContents: [
                 "Show X-Axis Grid Lines",
-                "Show Y-Axis Grid Line",
+                "Show Y-Axis Grid Lines",
                 "Show Low and High Thresholds",
                 "Low Threshold",
                 "High Threshold",
                 "X-Axis Interval Step",
                 "Total Insulin Display Type",
-                "Total Daily Dose",
-                "Total Insulin in Scope",
+                "Total Daily Dose (TDD)",
+                "Total Insulin in Scope (TINS)",
                 "Override HbA1c Unit",
                 "Standing / Laying TIR Chart",
                 "Show Carbs Required Badge",
                 "Carbs Required Threshold",
                 "Forecast Display Type",
+                "Cone",
+                "Lines",
                 "Trio Color Scheme",
                 "Glucose Color Scheme"
             ],
             path: ["Features", "User Interface"]
         ),
-        SettingItem(title: "App Icons", view: .iconConfig),
-        SettingItem(title: "Autotune", view: .autotuneConfig)
+        SettingItem(title: "App Icons", view: .iconConfig)
+        // SettingItem(title: "Autotune", view: .autotuneConfig)
     ]
 
     static let notificationItems = [

+ 46 - 39
FreeAPS/Sources/Modules/Settings/View/SettingsRootView.swift

@@ -14,7 +14,7 @@ extension Settings {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -28,7 +28,7 @@ extension Settings {
         }
 
         var body: some View {
-            Form {
+            List {
                 if searchText.isEmpty {
                     let buildDetails = BuildDetails.default
 
@@ -76,15 +76,22 @@ extension Settings {
                         selectedVerboseHint: Binding(
                             get: { selectedVerboseHint },
                             set: {
-                                selectedVerboseHint = $0
+                                selectedVerboseHint = $0.map { AnyView($0) }
                                 hintLabel = "Closed Loop"
                             }
                         ),
                         units: state.units,
                         type: .boolean,
                         label: "Closed Loop",
-                        miniHint: "Enables automated insulin delivery. Requires active CGM sensor session and connected pump.",
-                        verboseHint: "Running Trio in closed loop mode requires an active CGM sensor session and a connected pump. This enables automated insulin delivery.\n\nBefore enabling, dial in your settings (basal / insulin sensitivity / carb ratio), and familiarize yourself with the app.",
+                        miniHint: "Enable automated insulin delivery.",
+                        verboseHint: VStack(alignment: .leading, spacing: 10) {
+                            Text(
+                                "Running Trio in closed loop mode requires an active CGM sensor session and a connected pump. This enables automated insulin delivery."
+                            )
+                            Text(
+                                "Before enabling, dial in your settings (basal / insulin sensitivity / carb ratio), and familiarize yourself with the app."
+                            )
+                        },
                         headerText: "Automated Insulin Delivery"
                     )
 
@@ -281,42 +288,42 @@ extension Settings {
 //                        }
 //                    }
 //                }.listRowBackground(Color.chart)
-
-            }.scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
-                .sheet(isPresented: $shouldDisplayHint) {
-                    SettingInputHintView(
-                        hintDetent: $hintDetent,
-                        shouldDisplayHint: $shouldDisplayHint,
-                        hintLabel: hintLabel ?? "",
-                        hintText: selectedVerboseHint ?? "",
-                        sheetTitle: "Help"
-                    )
-                }
-                .sheet(isPresented: $showShareSheet) {
-                    ShareSheet(activityItems: state.logItems())
-                }
-                .onAppear(perform: configureView)
-                .navigationTitle("Settings")
-                .navigationBarTitleDisplayMode(.automatic)
-                .toolbar {
-                    ToolbarItem(placement: .topBarTrailing) {
-                        Button(
-                            action: {
-                                if let url = URL(string: "https://triodocs.org/") {
-                                    UIApplication.shared.open(url)
-                                }
-                            },
-                            label: {
-                                HStack {
-                                    Text("Trio Docs")
-                                    Image(systemName: "questionmark.circle")
-                                }
+            }
+            .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
+            .sheet(isPresented: $shouldDisplayHint) {
+                SettingInputHintView(
+                    hintDetent: $hintDetent,
+                    shouldDisplayHint: $shouldDisplayHint,
+                    hintLabel: hintLabel ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
+                    sheetTitle: "Help"
+                )
+            }
+            .sheet(isPresented: $showShareSheet) {
+                ShareSheet(activityItems: state.logItems())
+            }
+            .onAppear(perform: configureView)
+            .navigationTitle("Settings")
+            .navigationBarTitleDisplayMode(.automatic)
+            .toolbar {
+                ToolbarItem(placement: .topBarTrailing) {
+                    Button(
+                        action: {
+                            if let url = URL(string: "https://triodocs.org/") {
+                                UIApplication.shared.open(url)
                             }
-                        )
-                    }
+                        },
+                        label: {
+                            HStack {
+                                Text("Trio Docs")
+                                Image(systemName: "questionmark.circle")
+                            }
+                        }
+                    )
                 }
-                .searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .always))
-                .screenNavigation(self)
+            }
+            .searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .always))
+            .screenNavigation(self)
         }
     }
 }

+ 1 - 1
FreeAPS/Sources/Modules/Settings/View/Subviews/AlgorithmSettings.swift

@@ -23,7 +23,7 @@ struct AlgorithmSettings: BaseView {
                 content: {
                     Text("Autosens").navigationLink(to: .autosensSettings, from: self)
                     Text("Super Micro Bolus (SMB)").navigationLink(to: .smbSettings, from: self)
-                    Text("Dynamic Sensitivity").navigationLink(to: .dynamicISF, from: self)
+                    Text("Dynamic Settings").navigationLink(to: .dynamicISF, from: self)
                     Text("Target Behavior").navigationLink(to: .targetBehavior, from: self)
                     Text("Additionals").navigationLink(to: .algorithmAdvancedSettings, from: self)
                 }

+ 6 - 6
FreeAPS/Sources/Modules/Settings/View/Subviews/FeatureSettingsView.swift

@@ -38,12 +38,12 @@ struct FeatureSettingsView: BaseView {
             )
             .listRowBackground(Color.chart)
 
-            Section(
-                header: Text("Data-Driven Settings Tuning"),
-                content: {
-                    Text("Autotune").navigationLink(to: .autotuneConfig, from: self)
-                }
-            )
+            // Section(
+            // header: Text("Data-Driven Settings Tuning"),
+            // content: {
+            // Text("Autotune").navigationLink(to: .autotuneConfig, from: self)
+            // }
+            // )
             .listRowBackground(Color.chart)
         }
         .scrollContentBackground(.hidden)

+ 25 - 12
FreeAPS/Sources/Modules/Settings/View/Subviews/NotificationsView.swift

@@ -17,15 +17,21 @@ struct NotificationsView: BaseView {
     @State var showAlert = false
     @State private var shouldDisplayHint: Bool = false
     @State var hintDetent = PresentationDetent.large
-    @State var selectedVerboseHint: String? =
-        "Notifications give you important Trio information without requiring you to open the app.\n\nKeep these turned ON in your phone’s settings to ensure you receive Trio Notifications, Critical Alerts, and Time Sensitive Notifications."
+    @State var selectedVerboseHint: AnyView? = AnyView(
+        VStack(alignment: .leading, spacing: 10) {
+            Text("Notifications give you important Trio information without requiring you to open the app.")
+            Text(
+                "Keep these turned ON in your phone’s settings to ensure you receive Trio Notifications, Critical Alerts, and Time Sensitive Notifications."
+            )
+        }
+    )
     @State var hintLabel: String? = "Manage iOS Preferences"
 
     @Environment(\.colorScheme) var colorScheme
     @Environment(AppState.self) var appState
 
     var body: some View {
-        Form {
+        List {
             Section(
                 header: Text("Manage iOS Preferences"),
                 content: {
@@ -37,18 +43,24 @@ struct NotificationsView: BaseView {
                 VStack {
                     notificationsEnabledStatus
                     HStack(alignment: .top) {
-                        Text(
-                            "Notifications give you important Trio information without requiring you to open the app."
-                        )
-                        .font(.footnote)
-                        .foregroundColor(.secondary)
-                        .lineLimit(nil)
+                        Text("Notifications give you important Trio information without requiring you to open the app.")
+                            .font(.footnote)
+                            .foregroundColor(.secondary)
+                            .lineLimit(nil)
                         Spacer()
                         Button(
                             action: {
                                 hintLabel = "Manage iOS Preferences"
-                                selectedVerboseHint =
-                                    "Notifications give you important Trio information without requiring you to open the app.\n\nKeep these turned ON in your phone’s settings to ensure you receive Trio Notifications, Critical Alerts, and Time Sensitive Notifications."
+                                selectedVerboseHint = AnyView(
+                                    VStack(alignment: .leading, spacing: 10) {
+                                        Text(
+                                            "Notifications give you important Trio information without requiring you to open the app."
+                                        )
+                                        Text(
+                                            "Keep these turned ON in your phone’s settings to ensure you receive Trio Notifications, Critical Alerts, and Time Sensitive Notifications."
+                                        )
+                                    }
+                                )
                                 shouldDisplayHint.toggle()
                             },
                             label: {
@@ -75,6 +87,7 @@ struct NotificationsView: BaseView {
                 }
             ).listRowBackground(Color.chart)
         }
+        .listSectionSpacing(sectionSpacing)
         .onReceive(
             resolver.resolve(AlertPermissionsChecker.self)!.$notificationsDisabled,
             perform: {
@@ -95,7 +108,7 @@ struct NotificationsView: BaseView {
                 hintDetent: $hintDetent,
                 shouldDisplayHint: $shouldDisplayHint,
                 hintLabel: hintLabel ?? "",
-                hintText: selectedVerboseHint ?? "",
+                hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                 sheetTitle: "Help"
             )
         }

+ 1 - 1
FreeAPS/Sources/Modules/Settings/View/Subviews/TherapySettingsView.swift

@@ -32,7 +32,7 @@ struct TherapySettingsView: BaseView {
                     Text("Basal Rates").navigationLink(to: .basalProfileEditor, from: self)
                     Text("Insulin Sensitivities").navigationLink(to: .isfEditor, from: self)
                     Text("Carb Ratios").navigationLink(to: .crEditor, from: self)
-                    Text("Target Glucose").navigationLink(to: .targetsEditor, from: self)
+                    Text("Glucose Targets").navigationLink(to: .targetsEditor, from: self)
                 }
             )
             .listRowBackground(Color.chart)

+ 4 - 2
FreeAPS/Sources/Modules/Settings/View/TidepoolStartView.swift

@@ -52,7 +52,7 @@ struct TidepoolStartView: BaseView {
                             }
                         }
 
-                        HStack(alignment: .top) {
+                        HStack(alignment: .center) {
                             Text("You can connect Trio to seamlessly upload and manage your diabetes data on Tidepool.")
                                 .font(.footnote)
                                 .foregroundColor(.secondary)
@@ -98,7 +98,9 @@ struct TidepoolStartView: BaseView {
                 hintDetent: $hintDetent,
                 shouldDisplayHint: $shouldDisplayHint,
                 hintLabel: "Connect to Tidepool",
-                hintText: "When connected, uploading of carbs, bolus, basal and glucose from Trio to your Tidepool account is enabled.\n\nUse your Tidepool credentials to login. If you dont already have a Tidepool account, you can sign up for one on the login page.",
+                hintText: Text(
+                    "When connected, uploading of carbs, bolus, basal and glucose from Trio to your Tidepool account is enabled.\n\nUse your Tidepool credentials to login. If you dont already have a Tidepool account, you can sign up for one on the login page."
+                ),
                 sheetTitle: "Help"
             )
         }

+ 15 - 6
FreeAPS/Sources/Modules/ShortcutsConfig/View/ShortcutsConfigView.swift

@@ -11,7 +11,7 @@ extension ShortcutsConfig {
 
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -20,7 +20,7 @@ extension ShortcutsConfig {
         @Environment(AppState.self) var appState
 
         var body: some View {
-            Form {
+            List {
                 Section(
                     header: Text("Shortcuts Integration"),
                     content: {
@@ -47,23 +47,32 @@ extension ShortcutsConfig {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = "Allow Bolusing with Shortcuts"
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: "Allow Bolusing with Shortcuts",
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: "Allow Bolusing with Shortcuts… bla bla bla"
+                    miniHint: "Automate boluses using the iOS Shortcuts App.",
+                    verboseHint: VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        VStack(alignment: .leading, spacing: 10) {
+                            Text("Enabling this setting allows the iOS Shortcuts App to send bolus commands to Trio.")
+                            Text(
+                                "Disabling this setting will still allow other commands, like Temp Targets, Add Carbs, and Start/End Overrides"
+                            )
+                        }
+                    }
                 )
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 4 - 4
FreeAPS/Sources/Modules/Stat/StatStateModel.swift

@@ -9,8 +9,8 @@ extension Stat {
         @ObservationIgnored @Injected() var settings: SettingsManager!
         var highLimit: Decimal = 10 / 0.0555
         var lowLimit: Decimal = 4 / 0.0555
-        var overrideUnit: Bool = false
-        var layingChart: Bool = false
+        var hbA1cDisplayUnit: HbA1cDisplayUnit = .percent
+        var timeInRangeChartStyle: TimeInRangeChartStyle = .vertical
         var units: GlucoseUnits = .mgdL
         var glucoseFromPersistence: [GlucoseStored] = []
 
@@ -34,8 +34,8 @@ extension Stat {
             highLimit = settingsManager.settings.high
             lowLimit = settingsManager.settings.low
             units = settingsManager.settings.units
-            overrideUnit = settingsManager.settings.overrideHbA1cUnit
-            layingChart = settingsManager.settings.oneDimensionalGraph
+            hbA1cDisplayUnit = settingsManager.settings.hbA1cDisplayUnit
+            timeInRangeChartStyle = settingsManager.settings.timeInRangeChartStyle
         }
 
         func setupGlucoseArray(for duration: Duration) {

+ 7 - 7
FreeAPS/Sources/Modules/Stat/View/ChartsView.swift

@@ -7,8 +7,8 @@ struct ChartsView: View {
     let highLimit: Decimal
     let lowLimit: Decimal
     let units: GlucoseUnits
-    let overrideUnit: Bool
-    let standing: Bool
+    let hbA1cDisplayUnit: HbA1cDisplayUnit
+    let timeInRangeChartStyle: TimeInRangeChartStyle
 
     let glucose: [GlucoseStored]
 
@@ -21,7 +21,7 @@ struct ChartsView: View {
     var body: some View {
         glucoseChart
         Rectangle().fill(.cyan.opacity(0.2)).frame(maxHeight: 3)
-        if standing {
+        if timeInRangeChartStyle == .horizontal {
             VStack {
                 tirChartLaying
                 Rectangle().fill(.cyan.opacity(0.2)).frame(maxHeight: 3)
@@ -39,15 +39,15 @@ struct ChartsView: View {
         highLimit: Decimal,
         lowLimit: Decimal,
         units: GlucoseUnits,
-        overrideUnit: Bool,
-        standing: Bool,
+        hbA1cDisplayUnit: HbA1cDisplayUnit,
+        timeInRangeChartStyle: TimeInRangeChartStyle,
         glucose: [GlucoseStored]
     ) {
         self.highLimit = highLimit
         self.lowLimit = lowLimit
         self.units = units
-        self.overrideUnit = overrideUnit
-        self.standing = standing
+        self.hbA1cDisplayUnit = hbA1cDisplayUnit
+        self.timeInRangeChartStyle = timeInRangeChartStyle
         self.glucose = glucose
     }
 

+ 15 - 15
FreeAPS/Sources/Modules/Stat/View/StatRootView.swift

@@ -29,7 +29,7 @@ extension Stat {
                         highLimit: state.highLimit,
                         lowLimit: state.lowLimit,
                         units: state.units,
-                        overrideUnit: state.overrideUnit
+                        hbA1cDisplayUnit: state.hbA1cDisplayUnit
                     )
                 case .Day:
                     StatsView(
@@ -37,7 +37,7 @@ extension Stat {
                         highLimit: state.highLimit,
                         lowLimit: state.lowLimit,
                         units: state.units,
-                        overrideUnit: state.overrideUnit
+                        hbA1cDisplayUnit: state.hbA1cDisplayUnit
                     )
                 case .Week:
                     StatsView(
@@ -45,7 +45,7 @@ extension Stat {
                         highLimit: state.highLimit,
                         lowLimit: state.lowLimit,
                         units: state.units,
-                        overrideUnit: state.overrideUnit
+                        hbA1cDisplayUnit: state.hbA1cDisplayUnit
                     )
                 case .Month:
                     StatsView(
@@ -53,7 +53,7 @@ extension Stat {
                         highLimit: state.highLimit,
                         lowLimit: state.lowLimit,
                         units: state.units,
-                        overrideUnit: state.overrideUnit
+                        hbA1cDisplayUnit: state.hbA1cDisplayUnit
                     )
                 case .Total:
                     StatsView(
@@ -61,7 +61,7 @@ extension Stat {
                         highLimit: state.highLimit,
                         lowLimit: state.lowLimit,
                         units: state.units,
-                        overrideUnit: state.overrideUnit
+                        hbA1cDisplayUnit: state.hbA1cDisplayUnit
                     )
                 }
             }
@@ -74,8 +74,8 @@ extension Stat {
                     highLimit: state.highLimit,
                     lowLimit: state.lowLimit,
                     units: state.units,
-                    overrideUnit: state.overrideUnit,
-                    standing: state.layingChart,
+                    hbA1cDisplayUnit: state.hbA1cDisplayUnit,
+                    timeInRangeChartStyle: state.timeInRangeChartStyle,
                     glucose: state.glucoseFromPersistence
                 )
             case .Day:
@@ -83,8 +83,8 @@ extension Stat {
                     highLimit: state.highLimit,
                     lowLimit: state.lowLimit,
                     units: state.units,
-                    overrideUnit: state.overrideUnit,
-                    standing: state.layingChart,
+                    hbA1cDisplayUnit: state.hbA1cDisplayUnit,
+                    timeInRangeChartStyle: state.timeInRangeChartStyle,
                     glucose: state.glucoseFromPersistence
                 )
             case .Week:
@@ -92,8 +92,8 @@ extension Stat {
                     highLimit: state.highLimit,
                     lowLimit: state.lowLimit,
                     units: state.units,
-                    overrideUnit: state.overrideUnit,
-                    standing: state.layingChart,
+                    hbA1cDisplayUnit: state.hbA1cDisplayUnit,
+                    timeInRangeChartStyle: state.timeInRangeChartStyle,
                     glucose: state.glucoseFromPersistence
                 )
             case .Month:
@@ -101,8 +101,8 @@ extension Stat {
                     highLimit: state.highLimit,
                     lowLimit: state.lowLimit,
                     units: state.units,
-                    overrideUnit: state.overrideUnit,
-                    standing: state.layingChart,
+                    hbA1cDisplayUnit: state.hbA1cDisplayUnit,
+                    timeInRangeChartStyle: state.timeInRangeChartStyle,
                     glucose: state.glucoseFromPersistence
                 )
             case .Total:
@@ -110,8 +110,8 @@ extension Stat {
                     highLimit: state.highLimit,
                     lowLimit: state.lowLimit,
                     units: state.units,
-                    overrideUnit: state.overrideUnit,
-                    standing: state.layingChart,
+                    hbA1cDisplayUnit: state.hbA1cDisplayUnit,
+                    timeInRangeChartStyle: state.timeInRangeChartStyle,
                     glucose: state.glucoseFromPersistence
                 )
             }

+ 15 - 7
FreeAPS/Sources/Modules/Stat/View/StatsView.swift

@@ -11,7 +11,7 @@ struct StatsView: View {
     var highLimit: Decimal
     var lowLimit: Decimal
     var units: GlucoseUnits
-    var overrideUnit: Bool
+    var hbA1cDisplayUnit: HbA1cDisplayUnit
 
     private let conversionFactor = 0.0555
 
@@ -30,7 +30,7 @@ struct StatsView: View {
         highLimit: Decimal,
         lowLimit: Decimal,
         units: GlucoseUnits,
-        overrideUnit: Bool
+        hbA1cDisplayUnit: HbA1cDisplayUnit
     ) {
         _fetchRequest = FetchRequest<LoopStatRecord>(
             sortDescriptors: [NSSortDescriptor(key: "start", ascending: false)],
@@ -45,7 +45,7 @@ struct StatsView: View {
         self.highLimit = highLimit
         self.lowLimit = lowLimit
         self.units = units
-        self.overrideUnit = overrideUnit
+        self.hbA1cDisplayUnit = hbA1cDisplayUnit
     }
 
     var loops: some View {
@@ -127,8 +127,16 @@ struct StatsView: View {
 
     var hba1c: some View {
         HStack(spacing: 50) {
-            let useUnit: GlucoseUnits = (units == .mmolL && overrideUnit) ? .mgdL :
-                (units == .mgdL && overrideUnit || units == .mmolL) ? .mmolL : .mgdL
+            let useUnit: GlucoseUnits = {
+                if units == .mmolL && hbA1cDisplayUnit == .mmolMol {
+                    return .mgdL
+                } else if (units == .mgdL && hbA1cDisplayUnit == .mmolMol) || units == .mmolL {
+                    return .mmolL
+                } else {
+                    return .mgdL
+                }
+            }()
+
             let hba1cs = glucoseStats()
             // First date
             let previous = glucose.last?.date ?? Date()
@@ -144,7 +152,7 @@ struct StatsView: View {
                     + " %"
             )
             VStack(spacing: 5) {
-                Text("HbA1C").font(.subheadline).foregroundColor(headline)
+                Text("HbA1c").font(.subheadline).foregroundColor(headline)
                 Text(hba1cString)
             }
             VStack(spacing: 5) {
@@ -180,7 +188,7 @@ struct StatsView: View {
             let numberOfDays = (current - previous).timeInterval / 8.64E4
 
             VStack(spacing: 5) {
-                Text(numberOfDays < 1 ? "Readings" : "Readings / 24h").font(.subheadline)
+                Text(numberOfDays < 1 ? "Readings" : "Readings / 24 h").font(.subheadline)
                     .foregroundColor(.secondary)
                 Text(bgs.readings.formatted(.number.grouping(.never).rounded().precision(.fractionLength(0))))
             }

+ 71 - 40
FreeAPS/Sources/Modules/TargetBehavoir/View/TargetBehavoirRootView.swift

@@ -7,7 +7,7 @@ extension TargetBehavoir {
         @StateObject var state = StateModel()
         @State private var shouldDisplayHint: Bool = false
         @State var hintDetent = PresentationDetent.large
-        @State var selectedVerboseHint: String?
+        @State var selectedVerboseHint: AnyView?
         @State var hintLabel: String?
         @State private var decimalPlaceholder: Decimal = 0.0
         @State private var booleanPlaceholder: Bool = false
@@ -25,24 +25,31 @@ extension TargetBehavoir {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString(
-                                "High Temptarget Raises Sensitivity",
-                                comment: "High Temptarget Raises Sensitivity"
+                                "High Temp Target Raises Sensitivity",
+                                comment: "High Temp Target Raises Sensitivity"
                             )
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: NSLocalizedString(
-                        "High Temptarget Raises Sensitivity",
-                        comment: "High Temptarget Raises Sensitivity"
-                    ),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Defaults to false. When set to true, raises sensitivity (lower sensitivity ratio) for temp targets set to >= 111. Synonym for exercise_mode. The higher your temp target above 110 will result in more sensitive (lower) ratios, e.g., temp target of 120 results in sensitivity ratio of 0.75, while 140 results in 0.6 (with default halfBasalTarget of 160).",
-                        comment: "High Temptarget Raises Sensitivity"
+                        "High Temp Target Raises Sensitivity",
+                        comment: "High Temp Target Raises Sensitivity"
                     ),
+                    miniHint: "Increase sensitivity when glucose is above target if a manual Temp Target > \(state.units == .mgdL ? "110" : 110.formattedAsMmolL) \(state.units.rawValue) is set.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "When this feature is enabled, manually setting a temporary target above \(state.units == .mgdL ? "110" : 110.formattedAsMmolL) \(state.units.rawValue) will decrease the Autosens Ratio used for ISF and basal adjustments, resulting in less insulin delivered overall. This scales with the temporary target set; the higher the temp target, the lower the Autosens Ratio used."
+                        )
+                        Text(
+                            "If Half Basal Exercise Target is set to \(state.units == .mgdL ? "160" : 160.formattedAsMmolL) \(state.units.rawValue), a temp target of \(state.units == .mgdL ? "120" : 120.formattedAsMmolL) \(state.units.rawValue) uses an Autosens Ratio of 0.75. A temp target of \(state.units == .mgdL ? "140" : 140.formattedAsMmolL) \(state.units.rawValue) uses an Autosens Ratio of 0.6."
+                        )
+                        Text("Note: The effect of this can be adjusted with the Half Basal Exercise Target")
+                    },
                     headerText: "Algorithmic Target Settings"
                 )
 
@@ -53,24 +60,31 @@ extension TargetBehavoir {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString(
-                                "Low Temptarget Lowers Sensitivity",
-                                comment: "Low Temptarget Lowers Sensitivity"
+                                "Low Temp Target Lowers Sensitivity",
+                                comment: "Low Temp Target Lowers Sensitivity"
                             )
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: NSLocalizedString(
-                        "Low Temptarget Lowers Sensitivity",
-                        comment: "Low Temptarget Lowers Sensitivity"
+                        "Low Temp Target Lowers Sensitivity",
+                        comment: "Low Temp Target Lowers Sensitivity"
                     ),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Defaults to false. When set to true, can lower sensitivity (higher sensitivity ratio) for temptargets <= 99. The lower your temp target below 100 will result in less sensitive (higher) ratios, e.g., temp target of 95 results in sensitivity ratio of 1.09, while 85 results in 1.33 (with default halfBasalTarget of 160).",
-                        comment: "Low Temptarget Lowers Sensitivity"
-                    )
+                    miniHint: "Decrease sensitivity when glucose is below target if a manual Temp Target < \(state.units == .mgdL ? "100" : 100.formattedAsMmolL) \(state.units.rawValue) is set.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "When this feature is enabled, setting a temporary target below \(state.units == .mgdL ? "100" : 100.formattedAsMmolL) \(state.units.rawValue) will increase the Autosens Ratio used for ISF and basal adjustments, resulting in more insulin delivered overall. This scales with the temporary target set; the lower the Temp Target, the higher the Autosens Ratio used."
+                        )
+                        Text(
+                            "If Half Basal Exercise Target is \(state.units == .mgdL ? "160" : 160.formattedAsMmolL) \(state.units.rawValue), a Temp Target of \(state.units == .mgdL ? "95" : 95.formattedAsMmolL) \(state.units.rawValue) uses an Autosens Ratio of 1.09. A Temp Target of \(state.units == .mgdL ? "85" : 85.formattedAsMmolL) \(state.units.rawValue) uses an Autosens Ratio of 1.33."
+                        )
+                        Text("Note: The effect of this can be adjusted with the Half Basal Exercise Target")
+                    }
                 )
 
                 SettingInputSection(
@@ -80,18 +94,20 @@ extension TargetBehavoir {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Sensitivity Raises Target", comment: "Sensitivity Raises Target")
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: NSLocalizedString("Sensitivity Raises Target", comment: "Sensitivity Raises Target"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "When true, raises BG target when autosens detects sensitivity",
-                        comment: "Sensitivity Raises Target"
-                    )
+                    miniHint: "Raise target glucose if when Autosens Ratio is >1.",
+                    verboseHint: VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "Enabling this feature causes Trio to automatically raise the targeted glucose if it detects an increase in insulin sensitivity from your baseline."
+                        )
+                    }
                 )
 
                 SettingInputSection(
@@ -101,18 +117,20 @@ extension TargetBehavoir {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Resistance Lowers Target", comment: "Resistance Lowers Target")
                         }
                     ),
                     units: state.units,
                     type: .boolean,
                     label: NSLocalizedString("Resistance Lowers Target", comment: "Resistance Lowers Target"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Defaults to false. When true, will lower BG target when autosens detects resistance",
-                        comment: "Resistance Lowers Target"
-                    )
+                    miniHint: "Lower target glucose when Autosens Ratio is <1.",
+                    verboseHint: VStack(alignment: .leading, spacing: 10) {
+                        Text("Default: OFF").bold()
+                        Text(
+                            "Enabling this feature causes Trio to automatically reduce the targeted glucose if it detects a decrease in sensitivity (resistance) from your baseline."
+                        )
+                    }
                 )
 
                 SettingInputSection(
@@ -122,26 +140,39 @@ extension TargetBehavoir {
                     selectedVerboseHint: Binding(
                         get: { selectedVerboseHint },
                         set: {
-                            selectedVerboseHint = $0
+                            selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = NSLocalizedString("Half Basal Exercise Target", comment: "Half Basal Exercise Target")
                         }
                     ),
                     units: state.units,
                     type: .decimal("halfBasalExerciseTarget"),
                     label: NSLocalizedString("Half Basal Exercise Target", comment: "Half Basal Exercise Target"),
-                    miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                    verboseHint: NSLocalizedString(
-                        "Set to a number, e.g. 160, which means when temp target is 160 mg/dL, run 50% basal at this level (120 = 75%; 140 = 60%). This can be adjusted, to give you more control over your exercise modes.",
-                        comment: "Half Basal Exercise Target"
-                    )
+                    miniHint: "Scales down your basal rate to 50% at this value.",
+                    verboseHint:
+                    VStack(alignment: .leading, spacing: 10) {
+                        Text(
+                            "Default: \(state.units == .mgdL ? "160" : 160.formattedAsMmolL) \(state.units.rawValue)"
+                        )
+                        .bold()
+                        Text(
+                            "The Half Basal Exercise Target allows you to scale down your basal insulin during exercise or scale up your basal insulin when eating soon when a temporary glucose target is set."
+                        )
+                        Text(
+                            "For example, at a temp target of \(state.units == .mgdL ? "160" : 160.formattedAsMmolL) \(state.units.rawValue), your basal is reduced to 50%, but this scales depending on the target (e.g., 75% at \(state.units == .mgdL ? "120" : 120.formattedAsMmolL) \(state.units.rawValue), 60% at \(state.units == .mgdL ? "140" : 140.formattedAsMmolL) \(state.units.rawValue))."
+                        )
+                        Text(
+                            "Note: This setting is only utilized if the settings \"Low Temp Target Lowers Sensitivity\" OR \"High Temp Target Raises Sensitivity\" are enabled."
+                        )
+                    }
                 )
             }
+            .listSectionSpacing(sectionSpacing)
             .sheet(isPresented: $shouldDisplayHint) {
                 SettingInputHintView(
                     hintDetent: $hintDetent,
                     shouldDisplayHint: $shouldDisplayHint,
                     hintLabel: hintLabel ?? "",
-                    hintText: selectedVerboseHint ?? "",
+                    hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                     sheetTitle: "Help"
                 )
             }

+ 1 - 1
FreeAPS/Sources/Modules/TargetsEditor/View/TargetsEditorRootView.swift

@@ -69,7 +69,7 @@ extension TargetsEditor {
             .safeAreaInset(edge: .bottom, spacing: 30) { saveButton }
             .scrollContentBackground(.hidden).background(appState.trioBackgroundColor(for: colorScheme))
             .onAppear(perform: configureView)
-            .navigationTitle("Target Glucose")
+            .navigationTitle("Glucose Targets")
             .navigationBarTitleDisplayMode(.automatic)
             .toolbar(content: {
                 if state.items.isNotEmpty {

+ 1 - 1
FreeAPS/Sources/Modules/Treatments/TreatmentsProvider.swift

@@ -3,7 +3,7 @@ extension Treatments {
         func getPumpSettings() async -> PumpSettings {
             await storage.retrieveAsync(OpenAPS.Settings.settings, as: PumpSettings.self)
                 ?? PumpSettings(from: OpenAPS.defaults(for: OpenAPS.Settings.settings))
-                ?? PumpSettings(insulinActionCurve: 6, maxBolus: 10, maxBasal: 2)
+                ?? PumpSettings(insulinActionCurve: 10, maxBolus: 10, maxBasal: 2)
         }
 
         func getBasalProfile() async -> [BasalProfileEntry] {

+ 1 - 1
FreeAPS/Sources/Modules/Treatments/View/PopupView.swift

@@ -303,7 +303,7 @@ struct PopupView: View {
                     state.units.rawValue
             )
 
-            Text("15min Delta / ISF").font(.caption).foregroundColor(.secondary.opacity(colorScheme == .dark ? 0.65 : 0.8))
+            Text("15 min Delta / ISF").font(.caption).foregroundColor(.secondary.opacity(colorScheme == .dark ? 0.65 : 0.8))
                 .gridColumnAlignment(.leading)
                 .gridCellColumns(2).padding(.top, 5)
         }

+ 2 - 1
FreeAPS/Sources/Modules/Treatments/View/TreatmentsRootView.swift

@@ -293,7 +293,8 @@ extension Treatments {
                         }.listRowBackground(Color.chart)
 
                         treatmentButton
-                    }.listSectionSpacing(20)
+                    }
+                    .listSectionSpacing(sectionSpacing)
                 }
                 .blur(radius: state.waitForSuggestion ? 5 : 0)
 

+ 6 - 5
FreeAPS/Sources/Modules/UserInterfaceSettings/UserInterfaceSettingsStateModel.swift

@@ -2,19 +2,18 @@ import SwiftUI
 
 extension UserInterfaceSettings {
     final class StateModel: BaseStateModel<Provider> {
-        @Published var overrideHbA1cUnit = false
         @Published var low: Decimal = 70
         @Published var high: Decimal = 180
-        @Published var hours: Decimal = 6
         @Published var xGridLines = false
         @Published var yGridLines: Bool = false
-        @Published var oneDimensionalGraph = false
         @Published var rulerMarks: Bool = true
         @Published var forecastDisplayType: ForecastDisplayType = .cone
         @Published var totalInsulinDisplayType: TotalInsulinDisplayType = .totalDailyDose
         @Published var showCarbsRequiredBadge: Bool = true
         @Published var carbsRequiredThreshold: Decimal = 0
         @Published var glucoseColorScheme: GlucoseColorScheme = .staticColor
+        @Published var hbA1cDisplayUnit: HbA1cDisplayUnit = .percent
+        @Published var timeInRangeChartStyle: TimeInRangeChartStyle = .vertical
 
         var units: GlucoseUnits = .mgdL
 
@@ -22,11 +21,9 @@ extension UserInterfaceSettings {
             let units = settingsManager.settings.units
             self.units = units
 
-            subscribeSetting(\.overrideHbA1cUnit, on: $overrideHbA1cUnit) { overrideHbA1cUnit = $0 }
             subscribeSetting(\.xGridLines, on: $xGridLines) { xGridLines = $0 }
             subscribeSetting(\.yGridLines, on: $yGridLines) { yGridLines = $0 }
             subscribeSetting(\.rulerMarks, on: $rulerMarks) { rulerMarks = $0 }
-            subscribeSetting(\.oneDimensionalGraph, on: $oneDimensionalGraph) { oneDimensionalGraph = $0 }
 
             subscribeSetting(\.forecastDisplayType, on: $forecastDisplayType) { forecastDisplayType = $0 }
 
@@ -44,6 +41,10 @@ extension UserInterfaceSettings {
             ) { carbsRequiredThreshold = $0 }
 
             subscribeSetting(\.glucoseColorScheme, on: $glucoseColorScheme) { glucoseColorScheme = $0 }
+
+            subscribeSetting(\.hbA1cDisplayUnit, on: $hbA1cDisplayUnit) { hbA1cDisplayUnit = $0 }
+
+            subscribeSetting(\.timeInRangeChartStyle, on: $timeInRangeChartStyle) { timeInRangeChartStyle = $0 }
         }
     }
 }

Разница между файлами не показана из-за своего большого размера
+ 210 - 84
FreeAPS/Sources/Modules/UserInterfaceSettings/View/UserInterfaceSettingsRootView.swift


+ 23 - 12
FreeAPS/Sources/Modules/WatchConfig/View/WatchConfigAppleWatchView.swift

@@ -7,7 +7,7 @@ struct WatchConfigAppleWatchView: BaseView {
 
     @State private var shouldDisplayHint: Bool = false
     @State var hintDetent = PresentationDetent.large
-    @State var selectedVerboseHint: String?
+    @State var selectedVerboseHint: AnyView?
     @State var hintLabel: String?
     @State private var decimalPlaceholder: Decimal = 0.0
     @State private var booleanPlaceholder: Bool = false
@@ -21,7 +21,7 @@ struct WatchConfigAppleWatchView: BaseView {
     }
 
     var body: some View {
-        Form {
+        List {
             Section(
                 header: Text("Apple Watch Configuration"),
                 content: {
@@ -35,9 +35,9 @@ struct WatchConfigAppleWatchView: BaseView {
                             }
                         }.padding(.top)
 
-                        HStack(alignment: .top) {
+                        HStack(alignment: .center) {
                             Text(
-                                "Lorem ipsum dolor sit amet, consetetur sadipscing elitr."
+                                "Select the information to display."
                             )
                             .font(.footnote)
                             .foregroundColor(.secondary)
@@ -46,7 +46,15 @@ struct WatchConfigAppleWatchView: BaseView {
                             Button(
                                 action: {
                                     hintLabel = "Display on Watch"
-                                    selectedVerboseHint = "Display on Watch… bla bla bla"
+                                    selectedVerboseHint =
+                                        AnyView(VStack(alignment: .leading, spacing: 5) {
+                                            Text("Choose between the following:")
+                                            Text("• Heart Rate")
+                                            Text("• Glucose Target")
+                                            Text("• Steps")
+                                            Text("• ISF")
+                                            Text("• % Override")
+                                        })
                                     shouldDisplayHint.toggle()
                                 },
                                 label: {
@@ -67,15 +75,15 @@ struct WatchConfigAppleWatchView: BaseView {
                 selectedVerboseHint: Binding(
                     get: { selectedVerboseHint },
                     set: {
-                        selectedVerboseHint = $0
+                        selectedVerboseHint = $0.map { AnyView($0) }
                         hintLabel = "Show Protein and Fat"
                     }
                 ),
                 units: state.units,
                 type: .boolean,
                 label: "Show Protein and Fat",
-                miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                verboseHint: "Show Protein and Fat… bla bla bla"
+                miniHint: "Allow protein and fat entries on watch.",
+                verboseHint: Text("When enabled, protein and fat will show in the carb entry screen of the Apple Watch.")
             )
 
             SettingInputSection(
@@ -85,15 +93,17 @@ struct WatchConfigAppleWatchView: BaseView {
                 selectedVerboseHint: Binding(
                     get: { selectedVerboseHint },
                     set: {
-                        selectedVerboseHint = $0
+                        selectedVerboseHint = $0.map { AnyView($0) }
                         hintLabel = "Confirm Bolus Faster"
                     }
                 ),
                 units: state.units,
                 type: .boolean,
                 label: "Confirm Bolus Faster",
-                miniHint: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr.",
-                verboseHint: "Confirm Bolus Faster… bla bla bla"
+                miniHint: "Reduce the number of crown rotations required for bolus confirmation.",
+                verboseHint: Text(
+                    "Enabling this feature lowers the number of turns on the crown dial required when confirming a bolus."
+                )
             )
 
             Section(
@@ -109,12 +119,13 @@ struct WatchConfigAppleWatchView: BaseView {
                 }
             ).listRowBackground(Color.chart)
         }
+        .listSectionSpacing(sectionSpacing)
         .sheet(isPresented: $shouldDisplayHint) {
             SettingInputHintView(
                 hintDetent: $hintDetent,
                 shouldDisplayHint: $shouldDisplayHint,
                 hintLabel: hintLabel ?? "",
-                hintText: selectedVerboseHint ?? "",
+                hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                 sheetTitle: "Help"
             )
         }

+ 12 - 6
FreeAPS/Sources/Modules/WatchConfig/View/WatchConfigGarminView.swift

@@ -5,7 +5,7 @@ struct WatchConfigGarminView: View {
 
     @State private var shouldDisplayHint: Bool = false
     @State var hintDetent = PresentationDetent.large
-    @State var selectedVerboseHint: String?
+    @State var selectedVerboseHint: AnyView?
     @State var hintLabel: String?
     @State private var decimalPlaceholder: Decimal = 0.0
     @State private var booleanPlaceholder: Bool = false
@@ -19,7 +19,7 @@ struct WatchConfigGarminView: View {
     }
 
     var body: some View {
-        Form {
+        List {
             Section(
                 header: Text("Garmin Configuration"),
                 content:
@@ -33,9 +33,9 @@ struct WatchConfigGarminView: View {
                             .frame(maxWidth: .infinity, alignment: .center)
                             .buttonStyle(.bordered)
 
-                        HStack(alignment: .top) {
+                        HStack(alignment: .center) {
                             Text(
-                                "Lorem ipsum dolor sit amet, consetetur sadipscing elitr."
+                                "Add a Garmin Device to Trio."
                             )
                             .font(.footnote)
                             .foregroundColor(.secondary)
@@ -44,7 +44,12 @@ struct WatchConfigGarminView: View {
                             Button(
                                 action: {
                                     hintLabel = "Add Device"
-                                    selectedVerboseHint = "Add Garmin Device… bla bla bla"
+                                    selectedVerboseHint =
+                                        AnyView(
+                                            Text(
+                                                "Add Garmin Device to Trio. Please look at the docs to see which devices are supported."
+                                            )
+                                        )
                                     shouldDisplayHint.toggle()
                                 },
                                 label: {
@@ -69,12 +74,13 @@ struct WatchConfigGarminView: View {
                 }.listRowBackground(Color.chart)
             }
         }
+        .listSectionSpacing(sectionSpacing)
         .sheet(isPresented: $shouldDisplayHint) {
             SettingInputHintView(
                 hintDetent: $hintDetent,
                 shouldDisplayHint: $shouldDisplayHint,
                 hintLabel: hintLabel ?? "",
-                hintText: selectedVerboseHint ?? "",
+                hintText: selectedVerboseHint ?? AnyView(EmptyView()),
                 sheetTitle: "Help"
             )
         }

+ 1 - 1
FreeAPS/Sources/Modules/WatchConfig/View/WatchConfigRootView.swift

@@ -10,7 +10,7 @@ extension WatchConfig {
         @Environment(AppState.self) var appState
 
         var body: some View {
-            Form {
+            List {
                 Section(
                     header: Text("Smartwatch Configuration"),
                     content: {

+ 1 - 1
FreeAPS/Sources/Services/SettingsManager/SettingsManager.swift

@@ -72,7 +72,7 @@ final class BaseSettingsManager: SettingsManager, Injectable {
     var pumpSettings: PumpSettings {
         storage.retrieve(OpenAPS.Settings.settings, as: PumpSettings.self)
             ?? PumpSettings(from: OpenAPS.defaults(for: OpenAPS.Settings.settings))
-            ?? PumpSettings(insulinActionCurve: 6, maxBolus: 10, maxBasal: 2)
+            ?? PumpSettings(insulinActionCurve: 10, maxBolus: 10, maxBasal: 2)
     }
 
     func updateInsulinCurve(_ insulinType: InsulinType?) {

+ 1 - 1
FreeAPS/Sources/Shortcuts/State/ListStateIntent.swift

@@ -7,7 +7,7 @@ import Foundation
 
     // Description of the action in the Shortcuts app
     static var description = IntentDescription(
-        "Allow to list the last Blood Glucose, trends, IOB and COB available in Trio"
+        "Allow to list the last glucose reading, trends, IOB and COB available in Trio"
     )
 
     static var parameterSummary: some ParameterSummary {

+ 3 - 3
FreeAPS/Sources/Views/DefinitionRow.swift

@@ -1,9 +1,9 @@
 import Foundation
 import SwiftUI
 
-struct DefinitionRow: View {
+struct DefinitionRow<DefinitionView: View>: View {
     var term: String
-    var definition: String
+    var definition: DefinitionView
     var color: Color?
     var fontSize: Font?
 
@@ -15,7 +15,7 @@ struct DefinitionRow: View {
                 }
                 Text(term).font(fontSize ?? .subheadline).fontWeight(.semibold)
             }.padding(.bottom, 5)
-            Text(definition)
+            definition
                 .font(fontSize ?? .subheadline)
                 .foregroundColor(.secondary)
         }

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

@@ -1,10 +1,10 @@
 import SwiftUI
 
-struct SettingInputHintView: View {
+struct SettingInputHintView<HintView: View>: View {
     @Binding var hintDetent: PresentationDetent
     @Binding var shouldDisplayHint: Bool
     var hintLabel: String
-    var hintText: String
+    var hintText: HintView
     var sheetTitle: String
 
     @Environment(\.colorScheme) private var colorScheme

+ 0 - 0
FreeAPS/Sources/Views/SettingInputSection.swift


Некоторые файлы не были показаны из-за большого количества измененных файлов