Units selection#558
Conversation
- Introduced UnitSettingsStore to centralize unit and metric settings management. - Added new enums for glucose display units, time in range modes, glycemic metrics, and variability metrics. - Updated StatsData to calculate and store coefficient of variation. - Refactored Localizer to utilize UnitSettingsStore for unit conversions and formatting. - Enhanced Nightscout and Dexcom settings views to support unit configuration and onboarding. - Created UnitsConfigurationView for reusable unit and metric settings. - Updated AggregatedStatsView and SimpleStatsViewModel to reflect new unit settings. - Modified TIRView and its ViewModel to use UnitSettingsStore for thresholds and display. - Removed legacy storage references for unit settings in favor of the new centralized approach. - Added export functionality for new unit and metric settings in Nightscout settings.
…e hour and minute states, enhancing clarity and usability
|
hasConfiguredUnits is written to, but never used. Should it be removed? |
|
Graph lines ignore user's high/low settings (Graphs.swift) — graphRangeThresholds() hardcodes low = 70.0 and high = 140.0/180.0. Users who customized lowLine/highLine in Graph Settings will see those settings silently ignored for graph rendering and dot coloring. At the same time, BG coloring could be based on range? So the question is, should we force users to use TIR/TITR and remove the customized settings.. or should there be TIR/TITR/Custom where when you select custom can choose those values just like before (and keep them if they already had them..) |
# Conflicts: # LoopFollow/Stats/AggregatedStatsView.swift
|
Added a custom range, solved conflicts with dev. |
Accidentally committed utility script that belongs outside the project.
Use @State for glucoseUnit, lowValue, and highValue so SwiftUI can track changes and re-render. Add .id(glucoseUnit) on BGPickers to force recreation when the unit changes, ensuring allValues and formatting update correctly.
# Conflicts: # LoopFollow/Application/Base.lproj/Main.storyboard # LoopFollow/Controllers/MainViewController+updateStats.swift # LoopFollow/Nightscout/NightscoutSettingsView.swift # LoopFollow/ViewControllers/MainViewController.swift
marionbarker
left a comment
There was a problem hiding this comment.
Cursory code review - relied on @bjorkert approval.
Approved by test.
Brings in all changes from loopandlearn/LoopFollow dev up to 6.1.0. Resolved conflicts by taking upstream throughout, except LogManager where both the watch and telemetry log categories are kept. Key changes from upstream: - Add iOS 17.2+ push-to-start for Live Activity renewal (loopandlearn#622) - Fix LA restart classification, foreground race, troubleshooting logs (loopandlearn#615) - Redact secrets from log output (loopandlearn#623) - Add anonymous telemetry (loopandlearn#626) - Add units selection (loopandlearn#558) - Fix stats inclusive date range (loopandlearn#629) - Deduplicate Nightscout treatment entries by id (loopandlearn#569) - Fix alarm sound session activation failures in background (loopandlearn#596) - Recognize Atlas DASH pod in Omnipod heartbeat scan (loopandlearn#633) - Default migrationStep to latest on fresh installs (loopandlearn#631) - Update to fastlane 2.233.1 (loopandlearn#632) https://claude.ai/code/session_01VK2furpEaEmysQvEd1h77f

Summary
This PR centralizes glucose unit and metric preferences, adds a reusable units onboarding flow, and updates stats and setup screens to use the new configuration model. It also documents commit message conventions in the README.
What changed