Repository navigation
Refactor/glucose range thresholds - #791
Merged
Merged
Conversation
…om a full-width list The 54/70/140/180/250 mg/dL cut-offs were repeated across the stats, GRI, the settings footer and the Live Activity. They now live in GlucoseThresholds in Shared, so the app, Live Activity and watch targets all see the same values. Each TimeInRangeDisplayMode carries its title and fixed thresholds, and the range settings, stats title and stats card toggle are built from allCases, so a new mode is its cut-offs plus one case. The segmented TIR/TITR/Custom picker and its footer are replaced by a row showing the selected mode's full name and cut-offs, which opens a list with one line per mode. Choosing Custom Range stays on the list and shows the Low and High pickers there. The onboarding statistics page gets a navigation stack so the list can open from it.
TING is the tight range with its lower cut-off moved down from 70 to 63 mg/dL, also known as Time in Normoglycemia. It is shown as Extended Tight Range, sits between Time in Tight Range and Custom Range in the range list and the stats card toggle, and its cut-offs live in GlucoseThresholds next to TIR and TITR. The settings search finds Range Mode for "ting" and "extended".
bjorkert
approved these changes
Oct 27, 2026
This was referenced Oct 27, 2026
bjorkert
added a commit
to bjorkert/LoopFollow
that referenced
this pull request
Oct 27, 2026
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
Time in range cut-offs are now defined in one place, the range mode is picked from a clearer full-width list, and a new mode is added: Extended Tight Range (TING, 63–140 mg/dL).
Why
switchstatements, the segmented picker, the settings footer and the stats card toggle.What changed
Cut-offs in one place
GlucoseThresholdsinShared/, so the app, Live Activity and watch targets all use the same values. It holds the very low/very high cut-offs and each mode's low/high.TIRCalculator,TIRView,GRICalculatorand the Live Activity background tint now read from it. GRI keeps the standard 70–180 range whichever mode is selected, as its definition requires.Range modes describe themselves
TimeInRangeDisplayModenow has atitle,fixedThresholdsandnext.effectiveThresholds(), the stats title and the stats card toggle use these instead of their ownswitchstatements.GlucoseThresholds, plus one case with a title and thresholds. The settings, stats, chart lines, header, watch and Live Activity pick it up from there.Range settings
Extended Tight Range (TING)