Repository navigation
Conversation
…fit the meal and bolus buttons The bolus screen opens on the amount instead of a list that, without Quick-Pick boluses or a recent recommendation, held only Other Amount. Loop / Trio's recommendation and the Quick-Pick boluses move behind a Presets button under Continue, shown only when there are any, with the Old Calculation Warning as before. While the recommendation is under 5 minutes old the amount starts there, with an icon line showing the amount and its age. It is filled in once, so coming back from the confirmation keeps what was set. The Max line is gone, since the crown and + stop at the maximum, and − and + click like a crown detent. The meal and bolus buttons use a compact capsule whose height scales with the watch, so the amount and two buttons fit without scrolling; the system buttons pushed Log off the bottom of the meal screen. On the meal screen, Time and Log are both centered, so they line up.
bjorkert
left a comment
There was a problem hiding this comment.
Thanks, opening straight on the amount is a nice improvement, and the meal buttons fitting on screen fixes a real problem. A few things before merging:
-
Pre-filling the recommendation is a change from the phone. On both phone bolus screens the recommendation is only applied when tapped, and a warning that new treatments may have occurred is always shown next to it. Here the amount is pre-filled automatically, so a recommendation can be sent with Continue and the crown without ever being chosen, and the confirmation only shows the amount. With the 5 minute limit and the crown confirmation I think this can be acceptable, but it's a deliberate difference from the phone and I'd like us to agree on it.
-
The age is captured once in
onAppearand never re-evaluated. If the screen stays open, or you go to the confirmation and back, the line still says "2 min ago" and the pre-filled amount stays, even after the recommendation is past 5 or 12 minutes. That skips the Old Calculation Warning the Presets path gives. Could the age be checked again on Continue, and if the amount still equals the seeded recommendation and it's now 5 minutes or older, show the same warning (or clear the amount)? -
When the recommendation is under 5 minutes old it shows both as the pre-filled amount and as a row under Presets. Maybe leave it out of Presets in that case.
-
The watch page in the docs (
docs/setup/apple-watch.md, currently in loopandlearn/loopfollowdocs#73) describes the old flow with Recommended, Quick-Pick and Other Amount in a list, along with thewatch-bolus.pngscreenshot. That needs updating to match if this goes in.
… from Presets while fresh
…rk recommended amounts on the confirmation
…f applying it" This reverts commit dda326a.
…tap, and catch up after the confirmation
|
Thanks for the review. I've pushed commits that address 1–3. 1. Pre-filling the recommendation Fair point, and I may have overthought the answer. I've gone back and forth a few times tonight. I'd like to keep the pre-fill, since it's what makes the watch bolus quick. But the watch now treats a pre-filled amount as "the recommendation" rather than just a number, and keeps it in line with the latest loop cycle:
Once the amount is changed by hand, it's no longer treated as the recommendation: it stays where the user put it, with no "Recommended" line and no check at send, the same as typing an amount on the phone. If you'd still rather match the phone exactly, the alternative is to start at 0 and show the recommendation as a one-tap button on the amount screen. Happy to go that way if you prefer. 2. Age only checked once The age on the amount screen now keeps counting and turns red at 5 minutes. If the amount is still the starting recommendation and it's now 5 minutes or older, Continue shows the same Old Calculation Warning as the Presets path. That also covers going to the confirmation and back. 3. Duplicate in Presets Presets no longer lists the recommendation while it's under 5 minutes old. From 5 to 12 minutes it's listed there with the warning. When there are no Quick-Picks, the Presets button only appears when there's something in it. 4. Docs I'll update the watch page and |
…low only untouched amounts while on top, clear an expired starting recommendation, and let compact buttons wrap A loop cycle without a recommendation no longer counts as 0 U. The Presets button appears once the recommendation is old enough to be listed there, and meal Quick-Picks are centered like the other buttons.
Watch bolus: review fixes for the recommendation handling and compact buttons
bjorkert
left a comment
There was a problem hiding this comment.
Thanks, looks good now. Please update the PR description to match the current flow before merging, and the docs in loopandlearn/loopfollowdocs#73.
Test❓ The issues I found are probably also in the dev branch.
ConfigurationUse my personal Loop phone and build this branch onto my personal LoopFollow. Had to eat some apple salad to test this - I hope you appreciate the sacrifice. First test was with feature/lfhub branchThis showed the following issue that needs to be fixed. (Not caused by this PR.) Entered carbs on phone, got rec bolus on watch, tweaked amount of carbs on phone and got update on watch. ❌ But then I tapped on watch, bolus icon again and it gave me the same bolus recommendation even though the first one went through - if I had accepted it, it would have been a double bolus. A few minutes later it updated to zero recommended. Or maybe it updated when I tapped on the home screen on the phone. This is effectively what is currently in LoopFollow dev Second test was with achkars-org:feature/watch-bolus-amountBackground refresh was set to Silent Tunes. |
After a bolus, the recommendation stays the same until Loop or Trio runs a new cycle and LoopFollow fetches it, which can take a few minutes. During that time the watch filled the old amount in again, so Continue and the crown would have given the bolus twice. The phone's bolus screens offered it too, with a tap. The phone now leaves out a recommendation when a manual bolus came after its loop cycle: from Nightscout, or sent from LoopFollow or the watch, alone or with a meal. The watch also ignores one from before insulin it sent itself, including when it sent directly. For Loop, the recommendation's time is now the cycle's own timestamp. The pump clock it used before also moves on failed cycles, which keep the old recommendation, so after a bolus that recommendation looked newer than the bolus.
|
Thanks Marion, for the testing and for the apple salad. Same recommendation after a bolus Good catch, and this PR made it worse. On dev the old recommendation needs a tap, but here it's the starting amount, so Continue and the crown would have sent it again. After a bolus, the recommendation stays the same until Loop runs a new cycle and LoopFollow fetches it, which can take a few minutes. Nothing told the watch that the recommendation was from before the bolus. Fixed in 7750548:
So right after a bolus, the bolus screen opens with nothing filled in, and the recommendation comes back after Loop's next cycle. Automatic boluses don't count, since the cycle that recommends a bolus can also give one. Notification goes to the phone That's how iOS handles notifications: they only show on the watch while the iPhone is locked. When the phone is unlocked or LoopFollow is open, Loop's confirmation shows on the phone. It isn't caused by this PR. Since the confirmation comes back to LoopFollow, the phone could pass the result on to the watch, so the Sent screen shows whether Loop delivered it. I'd do that in a separate PR, if that sounds useful. |
Suggested changes to the watch treatment screens after testing on Apple Watch. This includes Jonas's review fixes from achkars-org#6.
Bolus
Opens on the amount. The first screen used to be a list. Without Quick-Pick boluses or a recent recommendation, that list held only "Other Amount", so it was an extra tap to reach the crown. Now the bolus screen opens straight on the amount.
Starts at the recommendation. When Loop / Trio's recommendation is under 5 minutes old, the amount starts there, rounded down to the step. A line under the amount shows where it came from: a
wand.and.starsicon, then "1.25 U, 2 min ago". The age keeps counting while the screen is open and turns red at 5 minutes. VoiceOver reads "Recommended…". Going back from the confirmation keeps whatever amount was set.Follows newer loop cycles. When the bolus screen opens, the watch asks the phone for its latest state, on top of the updates the phone already sends. While the amount is still the recommendation and the amount screen is on top:
If the screen opened with nothing filled in, a fresh recommendation that comes in later is offered the same way, with a tap. A loop cycle without a recommendation counts as having none, not as 0 U. Going back from the confirmation catches up on any cycle that came in meanwhile.
Once the amount is changed by hand, it's no longer treated as the recommendation. It stays where the user put it, with no recommendation line and no check at send, the same as typing an amount on the phone.
Age checked at Continue. If the amount is still the starting recommendation and it's 5 minutes or older, Continue shows the same Old Calculation Warning as Presets. From 12 minutes, Continue shows "Recommendation Expired" and clears the amount, matching the cut-off on the phone.
Checked again before sending. The confirmation shows "Recommended, N min ago" under an amount that came from the recommendation, red from 5 minutes. When the crown confirms, the watch compares the amount with the latest recommendation it has. If a newer cycle lowered it, nothing is sent and a "Recommendation Lowered" alert offers Change to the new amount (which needs another turn of the crown), Send Anyway, or Cancel.
Not offered again after a bolus. After a bolus, the recommendation stays the same until Loop or Trio runs a new cycle and LoopFollow fetches it, which can take a few minutes. Until then, a recommendation from before the last bolus counts as none, so the watch doesn't fill in the same amount again. The watch ignores one from before insulin it sent itself, through the phone or directly. The phone leaves out one from before any manual bolus: in Nightscout, or sent from LoopFollow or the watch, alone or with a meal. Automatic boluses and SMBs don't count, since the cycle that recommends a bolus can also give one.
Presets behind a button. The Quick-Pick boluses and the recommendation moved to a Presets button under Continue. Under 5 minutes the recommendation is already the starting amount, so Presets lists it only from 5 to 12 minutes, with the Old Calculation Warning. The button only appears when there's something to show, and it appears by itself once the recommendation passes 5 minutes.
Max line removed. The "Max 2 U" line is gone. The crown and + already stop at the maximum.
Click on − and +. Pressing − or + plays a click, like a crown detent.
Meal
Phone
Both watch screens