-
Notifications
You must be signed in to change notification settings - Fork 8
[LOOP 949] Unify carb entry + bolus flow #41
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
Conversation
|
This is great. It both prevents double entry of carbs, and also, by delaying storage of entered carbs, makes the possibility of background automatic dosing while the screen is up much more rare. Those are two big mitigations. Automatic dosing can still happen when a new bg comes in, but it sounds like that is already covered. A few UI notes:
The primary Loop forecast graph and this one should both be changed to include undelivered, but scheduled, insulin (i.e. pending insulin) effects. The dosing calculation should still only include delivered insulin. This keeps the forecast more consistent in the various contexts it can be shown. |
Done
Done
Done
Done
Done |
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.
A number of questions and nits, but nothing that would prevent approval. LGTM. 🚀
Note: I only reviewed the diff between CarbEntryViewController.swift and CarbEntryEditViewController.swift in LoopKit.
| var activeCarbohydratesDescription: String? = nil { | ||
| didSet { | ||
| activeCarbohydratesLabel?.text = activeCarbohydratesDescription | ||
| var maxBolus: Double = 25 |
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.
[nit] Shouldn't maximum bolus allowed be from settings?
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.
Perhaps optional until gathered from settings?
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.
Preferable to have some default maximum in case the value isn't set in settings.
| // This gets rid of the empty space at the top. | ||
| tableView.tableHeaderView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.bounds.size.width, height: 0.01)) | ||
|
|
||
| glucoseChart.glucoseDisplayRange = HKQuantity(unit: .milligramsPerDeciliter, doubleValue: 60)...HKQuantity(unit: .milligramsPerDeciliter, doubleValue: 200) |
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.
Is this just a minimum display range? Or is this fixed? What if the actual prediction goes below 60 or above 200?
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 range is a placeholder for when there is no data / data hasn't yet loaded. The actual range is determined dynamically in the chart implementation.
# Conflicts: # Loop/Managers/LoopDataManager.swift # Loop/View Controllers/CarbAbsorptionViewController.swift
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.
Looks great to me!
| @@ -0,0 +1,53 @@ | |||
| { | |||
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.
What role is this asset serving? I see you've added it as a background to buttons in several places.
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 was pulled over from LoopKit; it's the background shadow behind the selected absorption time emoji on the carb entry screen.
|
This needs to be synced with the latest dev updates. |
# Conflicts: # Loop/Base.lproj/Main.storyboard
Done. Also cherry-picked your commit from DIY and updated the text of the secondary continue button. |
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.
Just one string that needs to be localized.
| title = NSLocalizedString("carb-entry-title-add", value: "Add Carb Entry", comment: "The title of the view controller to create a new carb entry") | ||
| } | ||
|
|
||
| navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Next", style: .plain, target: self, action: #selector(continueButtonPressed)) |
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.
"Next" needs to be localized.
|
It looks like you may have reviewed an outdated commit; the string is localized. |
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!
|
We've been using this with my son via DIY Loop dev and have a few comments relating to the "Meal Bolus" screen on the UI that might improve it, making it even clearer for carers who might not be as familiar with it as a daily user.
Hope that is helpful and clear. Thanks. |
Note: The guts of CarbEntryViewController come right from LoopKit, with only a couple tweaks to navigation. Happy to make changes that come out of reviewing the other parts of this file, if deemed necessary.