Add color thresholds to the Info Display#693
Open
bjorkert wants to merge 2 commits into
Open
Conversation
Individual info rows (IOB, COB, battery, pump battery, TDD, rec bolus, carbs, and sensor/cannula/insulin ages) can now turn yellow or red when their value crosses user-set thresholds — a visual cue only, with no alarm. The concerning direction is fixed per metric (battery colors when low, ages when high) and in-range values read green. Replaces the parallel infoSort/infoVisible arrays with a single ordered [InfoDisplayItem] store (migrated via migrateStep10), and reworks the Info Display settings into drill-in rows that reorder and open a per-row detail at the same time.
Threshold entry now uses steppers with a per-type range and step, mirroring the alarm editors, so values that need decimals (IOB, rec. bolus, the ages) accept them. The old text fields re-parsed on every keystroke and swallowed the decimal separator, making fractional thresholds impossible to enter. Direction, unit, bounds and defaults move into a single InfoColorConfig per type, so isColorable is simply "has a config". The pump reservoir row is now colorable, low-is-concerning. Pumps that only report "50+" count as exactly 50, matching what the reservoir alarm already does with latestPumpVolume.
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 #691.
Info Display rows can now turn yellow or red when their value crosses a user-set threshold — a purely visual cue, no alarm. Supported rows: IOB, COB, battery, pump battery, TDD, rec bolus, carbs today, and sensor/cannula/insulin ages. The concerning direction is fixed per metric (battery colors when low, ages when high) and in-range values read green.
Under the hood the parallel
infoSort/infoVisiblearrays are replaced by a single ordered[InfoDisplayItem]store (one-time migration viamigrateStep10, plus a safety-net conversion insynchronizeInfoTypes). The Info Display settings screen is reworked into drill-in rows that stay reorderable while also opening a per-row detail (visibility + colors).