Skip to content

Conversation

@mpangburn
Copy link

  • Provide a dynamic predicted glucose chart on the bolus screen.
  • Require explicit confirmation to add a carb entry without bolusing.
  • Require user acknowledgement if a bolus recommendation goes stale while on the bolus screen, e.g. when a new glucose value arrives.
  • Refactor to support computing glucose predictions without adding a potential carb entry or bolus to their respective stores.

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.

Screen Shot 2020-01-08 at 1 07 01 PM

Screen Shot 2020-01-08 at 1 07 25 PM

Screen Shot 2020-01-08 at 1 16 51 PM

@ps2
Copy link

ps2 commented Jan 10, 2020

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:

  • Title for bolus screen should be "Meal Bolus" when following carb entry.
  • "Carb & Bolus Forecast" title can be removed; it shows not just those two, but all effects.
  • The sub-graph description text can be removed, I think. The first time this UI is used, the user is going to see that the graph is live.
  • The active carbohydrates and active insulin can be removed as well. Those were added to give some context, but the graph gives a higher level view that includes these, and more.

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.

@mpangburn mpangburn changed the title Unify carb entry + bolus flow [LOOP 949] Unify carb entry + bolus flow Jan 15, 2020
@mpangburn
Copy link
Author

  • Title for bolus screen should be "Meal Bolus" when following carb entry.

Done

  • "Carb & Bolus Forecast" title can be removed; it shows not just those two, but all effects.

Done

  • The sub-graph description text can be removed, I think. The first time this UI is used, the user is going to see that the graph is live.

Done

  • The active carbohydrates and active insulin can be removed as well. Those were added to give some context, but the graph gives a higher level view that includes these, and more.

Done

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.

Done

Copy link

@darinkrauss darinkrauss left a 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

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?

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?

Copy link
Author

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)

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?

Copy link
Author

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
Copy link

@ps2 ps2 left a 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 @@
{
Copy link

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.

Copy link
Author

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.

@ps2
Copy link

ps2 commented Jan 28, 2020

This needs to be synced with the latest dev updates.

@mpangburn
Copy link
Author

This needs to be synced with the latest dev updates.

Done. Also cherry-picked your commit from DIY and updated the text of the secondary continue button.

Copy link

@ps2 ps2 left a 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))
Copy link

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.

@mpangburn
Copy link
Author

It looks like you may have reviewed an outdated commit; the string is localized.

Copy link

@ps2 ps2 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mpangburn mpangburn merged commit 065e01a into dev Jan 29, 2020
@andrew-dixon
Copy link

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.

  1. Change the "Cancel" on the top right to "Back" and send the user back to the carb entry screen. This makes it clear to the user that the carb entry hasn't been entered. If they want out of the process altogether, they can then click the "Cancel" button on the carb entry screen.
  2. When the bolus screen loads up the eye is immediately drawn to the "Save without Bolusing" button as it is high contrast and large. This has confused several of our caregivers into thinking Loop is suggesting no bolus. I would, therefore, recommend "greying out" this button, changing the text to "Deliver", and only making the button "active" once a bolus amount has been entered. If the entered amount is 0 (zero) then the text on the button could change to "Save without Bolusing" when it activates.

Hope that is helpful and clear. Thanks.

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.

5 participants