feat: Support insulin concentrations (U-10 through U-500) in Trio#31
Draft
Sjoerd-Bo3 with Copilot wants to merge 4 commits into
Draft
feat: Support insulin concentrations (U-10 through U-500) in Trio#31Sjoerd-Bo3 with Copilot wants to merge 4 commits into
Sjoerd-Bo3 with Copilot wants to merge 4 commits into
Conversation
…translation layer - Create InsulinConcentration enum (U-10 through U-500) with factor computation - Create ConcentrationService protocol and BaseConcentrationService implementation - Register ConcentrationService in ServiceAssembly DI container - Update TrioSettings to use InsulinConcentration enum with legacy Decimal migration - Wire outbound translation in APSManager (enactBolus, enactTempBasal, performBolus, performBasal, roundBolus) - Wire inbound translation in PumpHistoryStorage (storePumpEvents for bolus and tempBasal) - Wire inbound translation in APSManager.fetchCurrentTempBasal - Wire reservoir translation in DeviceDataManager.didReadReservoirValue Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/f24a45f7-0802-4ac1-8f87-316116313265 Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
…prehensive unit tests - Add concentration toggle and picker to UnitsLimitsSettings view - Add safety notice for non-standard concentrations - Wire allowDilution and insulinConcentration state bindings - Add concentration-related search terms to settings items - Add InsulinConcentrationTests and ConcentrationServiceTests - Add MockConcentrationService for testing Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/f24a45f7-0802-4ac1-8f87-316116313265 Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/f24a45f7-0802-4ac1-8f87-316116313265 Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
… usage Agent-Logs-Url: https://github.com/Sjoerd-Bo3/Trio/sessions/f24a45f7-0802-4ac1-8f87-316116313265 Co-authored-by: Sjoerd-Bo3 <2100083+Sjoerd-Bo3@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Sjoerd-Bo3
April 7, 2026 06:57
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements insulin concentration support for non-standard insulin strengths (U-10 through U-500) in Trio. This allows users of concentrated (U-200, U-500) or diluted (U-10, U-25, U-50) insulin to use their real clinical values for all therapy settings, while Trio automatically translates commands at the pump boundary.
Architecture: "Concentration Translator" Pattern
Concentration Factor
Changes
New Files
InsulinConcentration.swiftfactorcomputationConcentrationService.swiftConcentrationServiceTests.swiftModified Files
APSManager.swiftPumpHistoryStorage.swiftDeviceDataManager.swiftTrioSettings.swiftinsulinConcentrationfrom rawDecimaltoInsulinConcentrationenum with legacy migrationServiceAssembly.swiftConcentrationServicein DI containerUnitsLimitsSettingsRootView.swiftUnitsLimitsSettingsStateModel.swiftSettingItems.swiftKey Design Decisions
allowDilutionmust be enabled before concentration can be changedDecimalformat forinsulinConcentrationgracefullyTesting
What's Untouched (by design)
determine-basal.js— algorithm sees real units, no changes needed