Bug fix: carb dots overlapping SMB dots on the chart#650
Merged
marionbarker merged 1 commit intoJul 20, 2026
Conversation
aug0211
commented
May 9, 2026
Contributor
- Restores pre-PR Differentiate the display of Automated and Manual boluses #305 behavior; no other dot positioning changes
- Carb dots entered alongside an SMB were rendering at the same Y position as the SMB triangle, visually overlapping
- The carb-vs-bolus collision logic was supposed to lift the carb dot above the bolus to BG+70, but only checked for Boluses (not SMB)
- Regression comes from PR Differentiate the display of Automated and Manual boluses #305 (SMB display differentiated from boluses), which split SMBs into their own smbData array. - After the split, findNearestBolusbyTime in processNSCarbs no longer saw SMBs as "nearby treatments," so carb-near-SMB fell through to the default BG+20 offset: the same Y as the SMB itself.
- processNSCarbs now also looks up smbData.
- A carb within 300s of either a bolus OR SMB lifts to BG+70; otherwise BG+20.
- Restores pre-PR loopandlearn#305 behavior; no other dot positioning changes - Carb dots entered alongside an SMB were rendering at the same Y position as the SMB triangle, visually overlapping - The carb-vs-bolus collision logic was supposed to lift the carb dot above the bolus to BG+70, but only checked for Boluses (not SMB) - Regression comes from PR loopandlearn#305 (SMB display differentiated from boluses), which split SMBs into their own smbData array. - After the split, findNearestBolusbyTime in processNSCarbs no longer saw SMBs as "nearby treatments," so carb-near-SMB fell through to the default BG+20 offset: the same Y as the SMB itself. - processNSCarbs now also looks up smbData. - A carb within 300s of either a bolus OR SMB lifts to BG+70; otherwise BG+20.
bjorkert
approved these changes
Jul 19, 2026
bjorkert
left a comment
Member
There was a problem hiding this comment.
Verified on top of the Swift Charts migration: with a carb next to an SMB the carb now lifts to BG+70 as intended, carbs next to manual boluses still lift, and lone carbs stay at BG+20. Merges cleanly into current dev. Thanks for the fix and the clear regression analysis!
marionbarker
approved these changes
Jul 20, 2026
marionbarker
left a comment
Collaborator
There was a problem hiding this comment.
Approved by test using Trio URL.
Applied patch to dev v6.2.25. added carb, observed smb. the two labels are offset and readable.
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.