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

Merge branch 'dev' into fix-negative-iob-after-onboarding

Sam King 2 месяцев назад
Родитель
Сommit
aa996be0d3
32 измененных файлов с 248 добавлено и 155 удалено
  1. 1 1
      .github/workflows/add_identifiers.yml
  2. 2 2
      .github/workflows/build_trio.yml
  3. 2 2
      .github/workflows/create_certs.yml
  4. 4 4
      .github/workflows/unit_tests.yml
  5. 1 1
      .github/workflows/validate_secrets.yml
  6. 1 1
      CGMBLEKit
  7. 1 1
      Config.xcconfig
  8. 1 1
      DanaKit
  9. 1 1
      G7SensorKit
  10. 1 1
      LibreTransmitter
  11. 1 1
      LoopKit
  12. 1 1
      MinimedKit
  13. 1 1
      OmniBLE
  14. 1 1
      OmniKit
  15. 1 1
      RileyLinkKit
  16. 1 1
      TidepoolService
  17. 4 0
      Trio.xcodeproj/project.pbxproj
  18. 84 119
      Trio/Sources/Localizations/Main/Localizable.xcstrings
  19. 22 0
      Trio/Sources/Models/BolusDisplayThreshold.swift
  20. 1 0
      Trio/Sources/Models/TrioSettings.swift
  21. 3 0
      Trio/Sources/Modules/Home/HomeStateModel.swift
  22. 6 3
      Trio/Sources/Modules/Home/View/Chart/ChartElements/InsulinView.swift
  23. 2 1
      Trio/Sources/Modules/Home/View/Chart/MainChartView.swift
  24. 2 2
      Trio/Sources/Modules/Onboarding/View/OnboardingView+AlgorithmUtil.swift
  25. 4 4
      Trio/Sources/Modules/SMBSettings/View/SMBSettingsRootView.swift
  26. 4 3
      Trio/Sources/Modules/Settings/SettingItems.swift
  27. 1 1
      Trio/Sources/Modules/SettingsExport/SettingsExportStateModel.swift
  28. 2 0
      Trio/Sources/Modules/UserInterfaceSettings/UserInterfaceSettingsStateModel.swift
  29. 42 0
      Trio/Sources/Modules/UserInterfaceSettings/View/UserInterfaceSettingsRootView.swift
  30. 1 1
      dexcom-share-client-swift
  31. 36 0
      scripts/define_common_trio.sh
  32. 13 0
      scripts/update_submodules_trio.sh

+ 1 - 1
.github/workflows/add_identifiers.yml

@@ -12,7 +12,7 @@ jobs:
   identifiers:
     name: Add Identifiers
     needs: validate
-    runs-on: macos-15
+    runs-on: macos-26
     steps:
       # Checks-out the repo
       - name: Checkout Repo

+ 2 - 2
.github/workflows/build_trio.yml

@@ -165,7 +165,7 @@ jobs:
   build:
     name: Build
     needs: [check_certs, check_status]
-    runs-on: macos-15
+    runs-on: macos-26
     permissions:
       contents: write
     if:
@@ -175,7 +175,7 @@ jobs:
         (vars.SCHEDULED_SYNC != 'false' && needs.check_status.outputs.NEW_COMMITS == 'true' )
     steps:
       - name: Select Xcode version
-        run: "sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer"
+        run: "sudo xcode-select --switch /Applications/Xcode_26.2.app/Contents/Developer"
       
       - name: Checkout Repo for building
         uses: actions/checkout@v4

+ 2 - 2
.github/workflows/create_certs.yml

@@ -21,7 +21,7 @@ jobs:
   create_certs:
     name: Certificates
     needs: validate
-    runs-on: macos-15
+    runs-on: macos-26
     outputs:
       new_certificate_needed: ${{ steps.set_output.outputs.new_certificate_needed }}
 
@@ -90,7 +90,7 @@ jobs:
   nuke_certs:
       name: Nuke certificates
       needs: [validate, create_certs]
-      runs-on: macos-15
+      runs-on: macos-26
       if: ${{ (needs.create_certs.outputs.new_certificate_needed == 'true' && vars.ENABLE_NUKE_CERTS == 'true') || vars.FORCE_NUKE_CERTS == 'true' }}
       steps:
         - name: Output from step id 'check_certs'

+ 4 - 4
.github/workflows/unit_tests.yml

@@ -23,12 +23,12 @@ on:
 jobs:
   test:
     name: Run Unit Tests
-    runs-on: macos-15
+    runs-on: macos-26
     if: github.repository_owner == 'nightscout'
 
     steps:
       - name: Select Xcode version
-        run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer
+        run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer
 
       - name: Checkout code
         uses: actions/checkout@v4
@@ -64,7 +64,7 @@ jobs:
           time xcodebuild build-for-testing \
             -workspace Trio.xcworkspace \
             -scheme "Trio Tests" \
-            -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.5' \
+            -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' \
 
       - name: Check for uncommitted changes
         run: |
@@ -107,7 +107,7 @@ jobs:
           time xcodebuild test-without-building \
             -workspace Trio.xcworkspace \
             -scheme "Trio Tests" \
-            -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.5' \
+            -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' \
             $([ "$ENABLE_PARALLEL_TESTING" = "true" ] && echo "-parallel-testing-enabled YES") \
             2>&1 | tee xcodebuild.log
 

+ 1 - 1
.github/workflows/validate_secrets.yml

@@ -105,7 +105,7 @@ jobs:
   validate-fastlane-secrets:
     name: Fastlane
     needs: [validate-access-token]
-    runs-on: macos-15
+    runs-on: macos-26
     env:
       GH_PAT: ${{ secrets.GH_PAT }}
       GH_TOKEN: ${{ secrets.GH_PAT }}

+ 1 - 1
CGMBLEKit

@@ -1 +1 @@
-Subproject commit a442ea0a21078e82264176a89617d2f9a3a6f36d
+Subproject commit 134396b96170d410b18f9699b92409bc6d35aedb

+ 1 - 1
Config.xcconfig

@@ -19,7 +19,7 @@ TRIO_APP_GROUP_ID = group.org.nightscout.$(DEVELOPMENT_TEAM).trio.trio-app-group
 
 // The developers set the version numbers, please leave them alone
 APP_VERSION = 0.6.0
-APP_DEV_VERSION = 0.6.0.51
+APP_DEV_VERSION = 0.6.0.56
 APP_BUILD_NUMBER = 1
 COPYRIGHT_NOTICE =
 

+ 1 - 1
DanaKit

@@ -1 +1 @@
-Subproject commit bad8fad9ccf980f4a3384b2454a7cd41abe69464
+Subproject commit 3970b2aadc55044c851130567879fd0ae3ade6cc

+ 1 - 1
G7SensorKit

@@ -1 +1 @@
-Subproject commit ee064ddcc1c13e0050ee56d0eec38a6bdc0d3c76
+Subproject commit 0c093050084b63d7af0dc99307dba09239eb3180

+ 1 - 1
LibreTransmitter

@@ -1 +1 @@
-Subproject commit 38cc483f3d7716735ceee6e57b6ed4dd68eaf1d0
+Subproject commit 12dec3ce191afe761fd68a70172ef75638319e20

+ 1 - 1
LoopKit

@@ -1 +1 @@
-Subproject commit edd4e6037d263ef32dd8dd4c0d699c5429097373
+Subproject commit 9c09a6fea98e2638d76d610ba097c4fae14ca220

+ 1 - 1
MinimedKit

@@ -1 +1 @@
-Subproject commit d52c0f8f1fe615760794fdac233ba78657449870
+Subproject commit 942996e3f53c4875553c9827aeee1799a8dbf434

+ 1 - 1
OmniBLE

@@ -1 +1 @@
-Subproject commit ffec85de22d979e4bee6535c374ab72c692e101b
+Subproject commit 3782c584fe800116b6e60754e3be3cd818e033ee

+ 1 - 1
OmniKit

@@ -1 +1 @@
-Subproject commit 64731f0b31d61cae14d00528a9c2bf78ea6da9a6
+Subproject commit 1446be89bfab23ac021d3e22f03b34bda8ce30cf

+ 1 - 1
RileyLinkKit

@@ -1 +1 @@
-Subproject commit 83b211a442672612e1790c2f0d393aeb23600b5f
+Subproject commit 8dad76d15295e13e091be74f6f47dbca5f0eb022

+ 1 - 1
TidepoolService

@@ -1 +1 @@
-Subproject commit b4fb9a0672f6e4a7bfed619fc3193b03a8a2ab79
+Subproject commit a10f9d3ba097daae85de61d4a5bca063f34d64dc

+ 4 - 0
Trio.xcodeproj/project.pbxproj

@@ -260,6 +260,7 @@
 		3BD9687F2D8DDD8800899469 /* CryptoSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD9687E2D8DDD8800899469 /* CryptoSwift */; };
 		3BF85FE32E427312000D7351 /* IOBService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BF85FE12E427312000D7351 /* IOBService.swift */; };
 		3E28F2AB2EB5337F00FB9EEB /* ConnectIQ in Frameworks */ = {isa = PBXBuildFile; productRef = 3E28F2AA2EB5337F00FB9EEB /* ConnectIQ */; };
+		3E62C7822F54CC1B00433237 /* BolusDisplayThreshold.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E62C7812F54CC1600433237 /* BolusDisplayThreshold.swift */; };
 		45252C95D220E796FDB3B022 /* ConfigEditorDataFlow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F8A87AA037BD079BA3528BA /* ConfigEditorDataFlow.swift */; };
 		45717281F743594AA9D87191 /* ConfigEditorRootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 920DDB21E5D0EB813197500D /* ConfigEditorRootView.swift */; };
 		491D6FBD2D56741C00C49F67 /* TempTargetStored+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 491D6FBC2D56741C00C49F67 /* TempTargetStored+CoreDataProperties.swift */; };
@@ -1090,6 +1091,7 @@
 		3BDEA2DC60EDE0A3CA54DC73 /* TargetsEditorProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TargetsEditorProvider.swift; sourceTree = "<group>"; };
 		3BF768BD6264FF7D71D66767 /* NightscoutConfigProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NightscoutConfigProvider.swift; sourceTree = "<group>"; };
 		3BF85FE12E427312000D7351 /* IOBService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IOBService.swift; sourceTree = "<group>"; };
+		3E62C7812F54CC1600433237 /* BolusDisplayThreshold.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BolusDisplayThreshold.swift; sourceTree = "<group>"; };
 		3F60E97100041040446F44E7 /* PumpConfigStateModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PumpConfigStateModel.swift; sourceTree = "<group>"; };
 		3F8A87AA037BD079BA3528BA /* ConfigEditorDataFlow.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ConfigEditorDataFlow.swift; sourceTree = "<group>"; };
 		42369F66CF91F30624C0B3A6 /* BasalProfileEditorProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = BasalProfileEditorProvider.swift; sourceTree = "<group>"; };
@@ -2369,6 +2371,7 @@
 		388E5A5925B6F0250019842D /* Models */ = {
 			isa = PBXGroup;
 			children = (
+				3E62C7812F54CC1600433237 /* BolusDisplayThreshold.swift */,
 				DD3D60302F0377350021A33B /* ExportSetting.swift */,
 				DDFF204F2DB2C11900AB8A96 /* WatchStateSnapshot.swift */,
 				DDEBB05B2D89E9050032305D /* TimeInRangeType.swift */,
@@ -4360,6 +4363,7 @@
 				CEE9A6592BBB418300EB5194 /* CalibrationsDataFlow.swift in Sources */,
 				3811DE3525C9D49500A708ED /* HomeRootView.swift in Sources */,
 				38E98A2925F52C9300C0CED0 /* Error+Extensions.swift in Sources */,
+				3E62C7822F54CC1B00433237 /* BolusDisplayThreshold.swift in Sources */,
 				38EA05DA261F6E7C0064E39B /* SimpleLogReporter.swift in Sources */,
 				3811DE6125C9D4D500A708ED /* ViewModifiers.swift in Sources */,
 				3811DEAC25C9D88300A708ED /* NightscoutManager.swift in Sources */,

+ 84 - 119
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -10179,6 +10179,7 @@
       }
     },
     "%lld h" : {
+      "extractionState" : "stale",
       "localizations" : {
         "bg" : {
           "stringUnit" : {
@@ -19986,6 +19987,18 @@
         }
       }
     },
+    "0.1 U and over" : {
+      "comment" : "Display name for the \"0.1 U and over\" option in the bolus display threshold settings.",
+      "isCommentAutoGenerated" : true
+    },
+    "0.5 U and over" : {
+      "comment" : "Display name for the \"0. 5U and over\" option in the bolus display threshold settings.",
+      "isCommentAutoGenerated" : true
+    },
+    "1 U and over" : {
+      "comment" : "Name for the \"1 U and over\" option in the bolus display threshold settings.",
+      "isCommentAutoGenerated" : true
+    },
     "1. Open the Settings app on your iOS device." : {
       "localizations" : {
         "bg" : {
@@ -55582,6 +55595,9 @@
         }
       }
     },
+    "Bolus Display Threshold" : {
+
+    },
     "Bolus Distribution" : {
       "localizations" : {
         "bg" : {
@@ -66527,6 +66543,9 @@
         }
       }
     },
+    "Choose to hide small bolus amounts. See hint for more details." : {
+
+    },
     "Choose Trio's appearance. See hint for more details." : {
       "localizations" : {
         "bg" : {
@@ -151864,6 +151883,65 @@
         }
       }
     },
+    "Max Allowed Glucose Rise for SMB" : {
+      "comment" : "Max Allowed Glucose Rise for SMB, formerly Max Delta-BG Threshold",
+      "localizations" : {
+        "da" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Maks tilladt glukose stigning for SMB"
+          }
+        },
+        "de" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Max Zulässiger Glukoseanstieg für SMB"
+          }
+        },
+        "fr" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Augmentation max de glucose autorisée pour SMB"
+          }
+        },
+        "nb-NO" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Maks tillatt blodsukkerstigning for SMB"
+          }
+        },
+        "nl" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Max toegestane glucosestijging voor SMB"
+          }
+        },
+        "pl" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Maks dozwolony wzrost glikemii dla SMB"
+          }
+        },
+        "sv" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Max tillåten glukosstigning för SMB"
+          }
+        },
+        "vi" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "Tối đa Mức tăng đường huyết cho phép với SMB"
+          }
+        },
+        "zh-Hant" : {
+          "stringUnit" : {
+            "state" : "translated",
+            "value" : "最大允許的 SMB 血糖上升量"
+          }
+        }
+      }
+    },
     "Max Basal Rate" : {
       "localizations" : {
         "bg" : {
@@ -155342,125 +155420,6 @@
         }
       }
     },
-    "Max. Allowed Glucose Rise for SMB" : {
-      "comment" : "Max. Allowed Glucose Rise for SMB, formerly Max Delta-BG Threshold",
-      "localizations" : {
-        "bg" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "da" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "Maks. tilladt glukose stigning for SMB"
-          }
-        },
-        "de" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "Max. Zulässiger Glukoseanstieg für SMB"
-          }
-        },
-        "es" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "fr" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "Augmentation max. de glucose autorisée pour SMB"
-          }
-        },
-        "he" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "it" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "ko" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "nb-NO" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "Maks. tillatt blodsukkerstigning for SMB"
-          }
-        },
-        "nl" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "Max. toegestane glucosestijging voor SMB"
-          }
-        },
-        "pl" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "Maks. dozwolony wzrost glikemii dla SMB"
-          }
-        },
-        "pt-PT" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "ro" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "ru" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "sv" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "Max. tillåten glukosstigning för SMB"
-          }
-        },
-        "tr" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "uk" : {
-          "stringUnit" : {
-            "state" : "new",
-            "value" : "Max. Allowed Glucose Rise for SMB"
-          }
-        },
-        "vi" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "Tối đa. Mức tăng đường huyết cho phép với SMB"
-          }
-        },
-        "zh-Hant" : {
-          "stringUnit" : {
-            "state" : "translated",
-            "value" : "最大允許的 SMB 血糖上升量"
-          }
-        }
-      }
-    },
     "Maximum allowed positive percent change in glucose level to permit SMBs. If the difference in glucose is greater than this, Trio will only adjust Temp Basal Rate and not deliver an SMB that loop cycle." : {
       "localizations" : {
         "bg" : {
@@ -208336,6 +208295,9 @@
         }
       }
     },
+    "Show All" : {
+
+    },
     "Show carbs required as a red icon on the main graph icon." : {
       "localizations" : {
         "bg" : {
@@ -238958,6 +238920,9 @@
         }
       }
     },
+    "This setting controls which bolus amount labels are shown on Trio’s main chart. Boluses appear as blue upside-down triangles, with a number showing the amount. Depending on the option you choose, only boluses at or above that amount will show a label. For example, if you choose ‘0.5 U and over’, only boluses of 0.5 U or more will show a label." : {
+
+    },
     "This setting defines the maximum amount of Carbs On Board (COB) at any given time for Trio to use in dosing calculations. If more carbs are entered than allowed by this limit, Trio will cap the current COB in calculations to Max COB and remain at max until all remaining carbs have shown to be absorbed." : {
       "localizations" : {
         "bg" : {

+ 22 - 0
Trio/Sources/Models/BolusDisplayThreshold.swift

@@ -0,0 +1,22 @@
+import Foundation
+
+enum BolusDisplayThreshold: Decimal, CaseIterable, Encodable, Identifiable {
+    public var id: Decimal { rawValue }
+    case oneUnit = 1
+    case halfUnit = 0.5
+    case pointOneUnit = 0.1
+    case allUnits = 0.01
+
+    var displayName: String {
+        switch self {
+        case .oneUnit:
+            return String(localized: "1 U and over")
+        case .halfUnit:
+            return String(localized: "0.5 U and over")
+        case .pointOneUnit:
+            return String(localized: "0.1 U and over")
+        case .allUnits:
+            return String(localized: "Show All")
+        }
+    }
+}

+ 1 - 0
Trio/Sources/Models/TrioSettings.swift

@@ -54,6 +54,7 @@ struct TrioSettings: JSON, Equatable {
     var xGridLines: Bool = true
     var yGridLines: Bool = true
     var rulerMarks: Bool = true
+    var bolusDisplayThreshold: BolusDisplayThreshold = .allUnits
     var forecastDisplayType: ForecastDisplayType = .cone
     var maxCarbs: Decimal = 250
     var maxFat: Decimal = 250

+ 3 - 0
Trio/Sources/Modules/Home/HomeStateModel.swift

@@ -76,6 +76,7 @@ extension Home {
         var displayXgridLines: Bool = false
         var displayYgridLines: Bool = false
         var thresholdLines: Bool = false
+        var bolusDisplayThreshold: BolusDisplayThreshold = .allUnits
         var hours: Int16 = 6
         var totalBolus: Decimal = 0
         var isLoopStatusPresented: Bool = false
@@ -404,6 +405,7 @@ extension Home {
             eA1cDisplayUnit = settingsManager.settings.eA1cDisplayUnit
             displayXgridLines = settingsManager.settings.xGridLines
             displayYgridLines = settingsManager.settings.yGridLines
+            bolusDisplayThreshold = settingsManager.settings.bolusDisplayThreshold
             thresholdLines = settingsManager.settings.rulerMarks
             showCarbsRequiredBadge = settingsManager.settings.showCarbsRequiredBadge
             forecastDisplayType = settingsManager.settings.forecastDisplayType
@@ -668,6 +670,7 @@ extension Home.StateModel:
         displayXgridLines = settingsManager.settings.xGridLines
         displayYgridLines = settingsManager.settings.yGridLines
         thresholdLines = settingsManager.settings.rulerMarks
+        bolusDisplayThreshold = settingsManager.settings.bolusDisplayThreshold
         showCarbsRequiredBadge = settingsManager.settings.showCarbsRequiredBadge
         forecastDisplayType = settingsManager.settings.forecastDisplayType
         cgmAvailable = (fetchGlucoseManager.cgmGlucoseSourceType != CGMType.none)

+ 6 - 3
Trio/Sources/Modules/Home/View/Chart/ChartElements/InsulinView.swift

@@ -6,6 +6,7 @@ struct InsulinView: ChartContent {
     let glucoseData: [GlucoseStored]
     let insulinData: [PumpEventStored]
     let units: GlucoseUnits
+    let bolusDisplayThreshold: BolusDisplayThreshold
 
     var body: some ChartContent {
         drawBoluses()
@@ -32,9 +33,11 @@ struct InsulinView: ChartContent {
                     Image(systemName: "arrowtriangle.down.fill").font(.system(size: size)).foregroundStyle(Color.insulin)
                 }
                 .annotation(position: .top) {
-                    Text(Formatter.bolusFormatter.string(from: amount) ?? "")
-                        .font(.caption2)
-                        .foregroundStyle(Color.primary)
+                    if amount as Decimal >= bolusDisplayThreshold.rawValue {
+                        Text(Formatter.bolusFormatter.string(from: amount) ?? "")
+                            .font(.caption2)
+                            .foregroundStyle(Color.primary)
+                    }
                 }
             }
         }

+ 2 - 1
Trio/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -149,7 +149,8 @@ extension MainChartView {
                 InsulinView(
                     glucoseData: state.glucoseFromPersistence,
                     insulinData: state.insulinFromPersistence,
-                    units: state.units
+                    units: state.units,
+                    bolusDisplayThreshold: state.bolusDisplayThreshold
                 )
 
                 CarbView(

+ 2 - 2
Trio/Sources/Modules/Onboarding/View/OnboardingView+AlgorithmUtil.swift

@@ -121,8 +121,8 @@ enum AlgorithmSettingsSubstep: Int, CaseIterable, Identifiable {
         case .maxSMBMinutes: return String(localized: "Max SMB Basal Minutes", comment: "Max SMB Basal Minutes")
         case .maxUAMMinutes: return String(localized: "Max UAM Basal Minutes", comment: "Max UAM Basal Minutes")
         case .maxDeltaGlucoseThreshold: return String(
-                localized: "Max. Allowed Glucose Rise for SMB",
-                comment: "Max. Allowed Glucose Rise for SMB, formerly Max Delta-BG Threshold"
+                localized: "Max Allowed Glucose Rise for SMB",
+                comment: "Max Allowed Glucose Rise for SMB, formerly Max Delta-BG Threshold"
             )
         case .highTempTargetRaisesSensitivity: return String(
                 localized: "High Temp Target Raises Sensitivity",

+ 4 - 4
Trio/Sources/Modules/SMBSettings/View/SMBSettingsRootView.swift

@@ -331,16 +331,16 @@ extension SMBSettings {
                         set: {
                             selectedVerboseHint = $0.map { AnyView($0) }
                             hintLabel = String(
-                                localized: "Max. Allowed Glucose Rise for SMB",
-                                comment: "Max. Allowed Glucose Rise for SMB, formerly Max Delta-BG Threshold"
+                                localized: "Max Allowed Glucose Rise for SMB",
+                                comment: "Max Allowed Glucose Rise for SMB, formerly Max Delta-BG Threshold"
                             )
                         }
                     ),
                     units: state.units,
                     type: .decimal("maxDeltaBGthreshold"),
                     label: String(
-                        localized: "Max. Allowed Glucose Rise for SMB",
-                        comment: "Max. Allowed Glucose Rise for SMB, formerly Max Delta-BG Threshold"
+                        localized: "Max Allowed Glucose Rise for SMB",
+                        comment: "Max Allowed Glucose Rise for SMB, formerly Max Delta-BG Threshold"
                     ),
                     miniHint: String(localized: "Disables SMBs if last two glucose values differ by more than this percent."),
                     verboseHint:

+ 4 - 3
Trio/Sources/Modules/Settings/SettingItems.swift

@@ -114,13 +114,13 @@ enum SettingItems {
                 "Enable SMB With COB",
                 "Enable SMB With Temporary Target",
                 "Enable SMB After Carbs",
-                "Enable SMB With High BG",
-                "High BG Target",
+                "Enable SMB With High Glucose",
+                "High Glucose Target",
                 "Allow SMB With High Temporary Target",
                 "Enable UAM",
                 "Max SMB Basal Minutes",
                 "Max UAM SMB Basal Minutes",
-                "Max Delta-BG Threshold SMB"
+                "Max Allowed Glucose Rise for SMB"
             ],
             path: ["Algorithm", "Super Micro Bolus (SMB)"]
         ),
@@ -230,6 +230,7 @@ enum SettingItems {
                 "Show Carbs Required Badge",
                 "Carbs Required Threshold",
                 "Forecast Display Type",
+                "Bolus Display Threshold",
                 "Cone",
                 "Lines",
                 "Dark Mode",

+ 1 - 1
Trio/Sources/Modules/SettingsExport/SettingsExportStateModel.swift

@@ -396,7 +396,7 @@ extension SettingsExport {
                 addSetting(
                     category: algorithmCategory,
                     subcategory: smbSubcategory,
-                    name: String(localized: "Max. Allowed Glucose Rise for SMB"),
+                    name: String(localized: "Max Allowed Glucose Rise for SMB"),
                     value: String(format: "%.0f", (preferences.maxDeltaBGthreshold as NSDecimalNumber).doubleValue * 100),
                     unit: "%"
                 )

+ 2 - 0
Trio/Sources/Modules/UserInterfaceSettings/UserInterfaceSettingsStateModel.swift

@@ -7,6 +7,7 @@ extension UserInterfaceSettings {
         @Published var xGridLines = false
         @Published var yGridLines: Bool = false
         @Published var rulerMarks: Bool = true
+        @Published var bolusDisplayThreshold: BolusDisplayThreshold = .allUnits
         @Published var forecastDisplayType: ForecastDisplayType = .cone
         @Published var showCarbsRequiredBadge: Bool = true
         @Published var carbsRequiredThreshold: Decimal = 0
@@ -23,6 +24,7 @@ extension UserInterfaceSettings {
             subscribeSetting(\.xGridLines, on: $xGridLines) { xGridLines = $0 }
             subscribeSetting(\.yGridLines, on: $yGridLines) { yGridLines = $0 }
             subscribeSetting(\.rulerMarks, on: $rulerMarks) { rulerMarks = $0 }
+            subscribeSetting(\.bolusDisplayThreshold, on: $bolusDisplayThreshold) { bolusDisplayThreshold = $0 }
 
             subscribeSetting(\.forecastDisplayType, on: $forecastDisplayType) { forecastDisplayType = $0 }
 

+ 42 - 0
Trio/Sources/Modules/UserInterfaceSettings/View/UserInterfaceSettingsRootView.swift

@@ -376,6 +376,48 @@ extension UserInterfaceSettings {
                     }.padding(.bottom)
                 }.listRowBackground(Color.chart)
 
+                Section {
+                    VStack {
+                        Picker(
+                            selection: $state.bolusDisplayThreshold,
+                            label: Text("Bolus Display Threshold")
+                        ) {
+                            ForEach(BolusDisplayThreshold.allCases) { selection in
+                                Text(selection.displayName).tag(selection)
+                            }
+                        }.padding(.top)
+
+                        HStack(alignment: .center) {
+                            Text(
+                                "Choose to hide small bolus amounts. See hint for more details."
+                            )
+                            .font(.footnote)
+                            .foregroundColor(.secondary)
+                            .lineLimit(nil)
+                            Spacer()
+                            Button(
+                                action: {
+                                    hintLabel = String(localized: "Bolus Display Threshold")
+                                    selectedVerboseHint =
+                                        AnyView(
+                                            VStack(alignment: .leading) {
+                                                Text(
+                                                    "This setting controls which bolus amount labels are shown on Trio’s main chart. Boluses appear as blue upside-down triangles, with a number showing the amount. Depending on the option you choose, only boluses at or above that amount will show a label. For example, if you choose ‘0.5 U and over’, only boluses of 0.5 U or more will show a label."
+                                                )
+                                            }
+                                        )
+                                    shouldDisplayHint.toggle()
+                                },
+                                label: {
+                                    HStack {
+                                        Image(systemName: "questionmark.circle")
+                                    }
+                                }
+                            ).buttonStyle(BorderlessButtonStyle())
+                        }.padding(.top)
+                    }.padding(.bottom)
+                }.listRowBackground(Color.chart)
+
                 Section(
                     header: Text("Trio Statistics"),
                     content: {

+ 1 - 1
dexcom-share-client-swift

@@ -1 +1 @@
-Subproject commit 82a9179d444b3e79d5e9cfe99bbe7f298c4e8b40
+Subproject commit 8c4f0edfe9356463c66a2e5dff9d00794291ebfd

+ 36 - 0
scripts/define_common_trio.sh

@@ -0,0 +1,36 @@
+#!/bin/zsh
+
+# copied from Loop where this definition was used by more than one script
+# initially we probably will not need that capability, but does no harm to keep it
+# define parameters and arrays used by more than one script
+#   These are always capitalized
+#      TRIO_PROJECTS
+
+# include this file in each script using
+#   source scripts/define_commont_trio.sh
+
+# define the TRIO_PROJECTS used by Trio where for Trio the .gitmodules points
+#   to the downstream fork of loopandlearn in all cases
+#
+# The only submodule that needs a special trio branch (at this time) is LoopKit
+#    put that repository first in the list
+#
+# The scrips in LoopWorkspace are used to update translations and make
+#   sure the loopandlearn branches are up to date
+# Even though MedtrumKit and EversenseKit are not yet part of dev
+#   it does no harm to update those repositories using this script
+TRIO_PROJECTS=( \
+    loopandlearn:LoopKit:trio \
+    loopandlearn:CGMBLEKit:dev \
+    loopandlearn:dexcom-share-client-swift:dev \
+    loopandlearn:G7SensorKit:main \
+    loopandlearn:LibreTransmitter:main \
+    loopandlearn:MinimedKit:main \
+    loopandlearn:OmniBLE:dev \
+    loopandlearn:OmniKit:main \
+    loopandlearn:RileyLinkKit:dev \
+    loopandlearn:TidepoolService:dev \
+    loopandlearn:DanaKit:dev \
+    loopandlearn:EversenseKit:dev \
+    loopandlearn:MedtrumKit:dev \
+)

+ 13 - 0
scripts/update_submodules_trio.sh

@@ -0,0 +1,13 @@
+#!/bin/zsh
+
+source scripts/define_common_trio.sh
+
+for project in ${TRIO_PROJECTS}; do
+  echo "Updating to $project"
+  IFS=":" read user dir branch <<< "$project"
+  echo "Updating to $branch on $user/$project"
+  cd $dir
+  git checkout $branch
+  git pull
+  cd -
+done