-
Notifications
You must be signed in to change notification settings - Fork 16
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
WEB-3399 - Override/Underride Precision #456
base: develop
Are you sure you want to change the base?
Conversation
|
||
if (!amountRecommended) return false; | ||
|
||
return self.isDifferentBeyondPrecision(amountRecommended, amountProgrammed, 2) && amountProgrammed < amountRecommended; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is stolen from https://github.com/tidepool-org/viz/blob/develop/src/utils/bolus.js#L335-L372
My feeling from looking at the codebase is that we intentionally don't import Viz into Tideline to decrease coupling, which is why I didn't just import Viz.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, previously this chart would compare recommended
with delivered
but I have switched it to compare recommended
with programmed
, which makes more sense logically in my head? Alternatively, I can make both Viz and Tideline compare recommended
with delivered
. Let me know which makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd probably be good to throw in a unit test for each of these to help ensure that the behavior is maintained going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krystophv my bad on this one, seems like you're constantly catching me on the testing. I had looked previously and didn't see any test.js
files and I kind of assumed we had dropped off on testing for this repo 😓 but it turns out I was looking for the wrong convention. My bad!
Added tests here: b1a32ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, with the different conventions in different repos, you can't know till you know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
note: this will need a corresponding blip
PR to pull in an updated version of this dependency
WEB-3399
This PR aligns the tooltip with the chart, so that the both will be in agreement about whether a bolus event is an override/underride or if it is not. Per the ticket, I have changed the chart to not consider it an override if the discrepancy is < 0.01, which is how the tooltip works already.
The important note is that I've changed the comparison in the chart from
Recommended vs Delivered
toRecommended vs Programmed
, which is the comparison that the tooltip makes already. This makes more sense in my head than switching the tooltip to compareRecommended vs Delivered
, but let me know if it's not accurate.Before:
After: