Repository navigation
Automation: a new glucose condition starts at the editor's lowest value - #5593
Open
olorinmaia wants to merge 2 commits into
Open
olorinmaia wants to merge 2 commits into
olorinmaia wants to merge 2 commits into
Conversation
A new glucose or temp target condition started with the threshold 0.0. The editor shows 0.0 as an empty field and only clamps it when the field is focused, so a condition saved untouched compared the glucose against 0: "below" never fired and "above" always did, with nothing on the screen to show it. The Java InputBg started at the lowest allowed value (e6ae4f0); that line was lost when the class moved to dagger (a3b0c8c). Start at the lowest value of the units again (54 mg/dL or 3.0 mmol/L), so the editor shows the threshold that is used. Stored rules are read as stored. Rules already saved with 0 keep behaving as before; flagging those is left for a separate change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D2s3Q2DrsGAkKcHZPfBx4N
maxValue, step and decimalFormat were private and only written. The editor takes its range, step and format from the constants and the units.
This branch has not been deployed
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.
Problem
A new "Glucose" or "Temporary target value" condition started with the threshold 0.0, which the editor shows as an empty field. A condition saved without touching the field compared against 0: "below" never fired and "above" always fired, and nothing on the screen showed it.
Fix
InputBgstarts at the lowest value of the units again, 54 mg/dL or 3.0 mmol/L (the fix and its tests are by @sashasochka, cherry-picked from the branch in the issue)InputBgdrops three private fields that nothing readsStored rules are read as stored. Rules already saved with 0 keep their behaviour.
Tests
NewGlucoseConditionTest(new, 3 tests) andInputBgTestpass. On device (Z Flip 5,fullrelease, mmol/L): a new condition of each kind shows 3.0.Fixes #5570