Repository navigation
Home screen stats: TIR band and shared period (last 24 h or since midnight) - #774
Open
kristinkand wants to merge 8 commits into
Open
kristinkand wants to merge 8 commits into
kristinkand wants to merge 8 commits into
Conversation
The band now uses TIRCalculator, so each reading is counted once with the same 54 and 250 mg/dL cutoffs as the TIR chart in Stats. It also has a very high segment and uses the same colors as that chart. Every non-empty segment gets a minimum width so a single low reading stays visible, and the bar fills the full width of the band. The Stats Style setting is only in General.
…e midnight) Use the same period for statistics box and TIR band (last 24h or since midnight)
kristinkand
requested review from
bjorkert,
codebymini and
marionbarker
as code owners
October 10, 2026 16:12
Closed
Very low is below the lower of 54 mg/dL and the range's low bound, and very high is above the higher of 250 mg/dL and the range's high bound. In range in the TIR band and the Stats screen then matches the statistics box for any custom range.
TIR band: custom range bounds, threshold refresh, shared title Great catch! #57 fixed the double counting: since then, every reading lands in exactly one segment. #58 fixes which segment it lands in. With a custom low limit below 3.0 mmol/L, a reading between that limit and 3.0 is in your range, so it shouldn’t count as “very low”. Before #58, the band and the statistics box could therefore show different in-range percentages for such custom ranges. Now they match. This only matters with a custom range that reaches below 3.0 or above 13.9 mmol/L. With TIR, TITR or TING nothing changes, because those ranges never go past those limits.
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.
Closes #331
Supersedes #766 (includes its Time in Range band, rebased on the current dev, with the fixes from kristinkand#57)
With this PR the Time in Range band and the statistics box use the same time period. The user decides whether to show the statistics box or the band, and whether it covers the last 24 hours or today since midnight.
The choices are made under Settings > General > Statistics:
The range follows the Range Mode set under Settings > Units and Metrics.