Skip to content

Conversation

bjorkert
Copy link
Contributor

@bjorkert bjorkert commented Oct 4, 2025

Trio Remote Control: Recommended Bolus on Bolus Screen

This PR adds a flow for using the Recommended Bolus in the Trio Remote Control bolus view.

What’s included

  • Shows a Recommended Bolus chip when a fresh recommendation is available.
  • Hides the chip if the value is negative/zero/tiny (<0.05U) or older than ~12 minutes.
  • Color cue for freshness:
    • Yellow when recently calculated.
    • Red warning if ~5–12 minutes old.
  • Tapping the chip:
    • Applies directly when fresh.
    • Prompts a caution dialog if older than ~5 minutes.

Why

Make it quick to use a safe, recent recommendation—and avoid nudging users toward stale or invalid values.

@bjorkert
Copy link
Contributor Author

bjorkert commented Oct 4, 2025

image

@State private var statusMessage: String? = nil

private let pushNotificationManager = PushNotificationManager()
private let minDeliverableU: Double = 0.05 // hides negative/zero/tiny recs
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be renamed to minDeliverableUnit for improved readability

@dnzxy
Copy link
Collaborator

dnzxy commented Oct 4, 2025

It does not really make sense to display a bolus value that the pump cannot administer (0.96 U in your example for what I presume is a pod user on Trio). The overall bolus seems to have 3 decimals; bolus dosages are usually rounded up to 2 decimals in allowed increments.

Where is this recommended value coming from on the Trio side?

@bjorkert
Copy link
Contributor Author

bjorkert commented Oct 4, 2025

LoopFollow currently does not know what pump is used, and therefore not what increments used. I plan to introduce a setting for it. I believe it can be fetched from Loop.

@bjorkert bjorkert marked this pull request as draft October 6, 2025 16:14
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