Skip to content

Bug fix: carb dots overlapping SMB dots on the chart#650

Merged
marionbarker merged 1 commit into
loopandlearn:devfrom
aug0211:auggie-treatment-dot-spacing-fix
Jul 20, 2026
Merged

Bug fix: carb dots overlapping SMB dots on the chart#650
marionbarker merged 1 commit into
loopandlearn:devfrom
aug0211:auggie-treatment-dot-spacing-fix

Conversation

@aug0211

@aug0211 aug0211 commented May 9, 2026

Copy link
Copy Markdown
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 bjorkert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 marionbarker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by test using Trio URL.

Applied patch to dev v6.2.25. added carb, observed smb. the two labels are offset and readable.

@marionbarker
marionbarker merged commit b05f27c into loopandlearn:dev Jul 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants