Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wear: Display New IOB in Wizard Result if IOB is used in calculations #4484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
olorinmaia wants to merge 2 commits into nightscout:dev
base: dev
Choose a base branch
Loading
from olorinmaia:wear_newIob_bolusCalc

Conversation

@olorinmaia
Copy link
Contributor

@olorinmaia olorinmaia commented Jan 11, 2026

Inspired from: #4462

We often look at calculations on Wear to see current IOB to make sure when adding the calculated bolus from Bolus Wizard that the new IOB doesn't exceed a certain amount.

I've made this improvement to the Wizard Result in Wear. It will only show if IOB is used in the calculations.

Some screenshots.

IOB "positive"
Current IOB: 0,58
Calculated Bolus: 0,44
New IOB after Bolus: 0,98

Current IOB Result with new IOB
image image

IOB "negative"
Current IOB: -0,13
Calculated Bolus: 0,90
New IOB after Bolus: 0,77

Current IOB Result with new IOB
image image

When IOB is not used in calculations:
image

mcnelson reacted with heart emoji
Copy link

// New IOB = Total Insulin - Current IOB (because IOB is subtracted in wizard)
// Only calculate if IOB was actually used (totalIob is not NaN means it was included)
val newIob = if (!totalIob.isNaN()) {
totalInsulin - totalIob
Copy link

Choose a reason for hiding this comment

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

Tiny suggestion-- to an outsider like me, this looks weird. This is addition because totalIob is negative, correct? Maybe comments could be more specific?

Suggested change
totalInsulin - totalIob
totalInsulin - totalIob// totalIob is negative so this is addition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer

@mcnelson mcnelson mcnelson left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /