Skip to content

Add meal reminders for future carb entries - #2666

Open
damonbayer wants to merge 3 commits into
LoopKit:next-devfrom
damonbayer:dmb/meal-reminder-toggle
Open

damonbayer wants to merge 3 commits into
LoopKit:next-devfrom
damonbayer:dmb/meal-reminder-toggle

Conversation

@damonbayer

@damonbayer damonbayer commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

When someone logs carbs for a future meal and boluses in advance, it can be easy to lose track of when they planned to eat. This adds an opt-in ⏰ Remind Me switch to each carb entry so they can request a reminder for that meal.

  • The switch stays below the time picker so the form keeps the same layout as the time changes. It starts off for new entries and is enabled only for future times.
  • Saving with the switch on schedules a Time Sensitive Time to Eat notification for the entry time, with or without a bolus. The notification sound follows Loop’s alert mute setting, including changes made after scheduling.
  • Reopening a future entry shows whether a reminder is pending. Save Reminder applies a reminder-only change directly from the carb entry screen and leaves the stored carb entry untouched. Pending reminders follow edits and are canceled if the entry is deleted or moved to the present or past.
  • If scheduling fails, Loop shows an error before delivering any requested bolus. Retrying uses the carb entry that was already saved. Users can also skip the reminder and confirm the bolus again.
  • The future carb entry limit increases from one hour to four hours for both manual and remote entries.

Addresses #2650. Zulip design discussion.

Screenshots

Carb entry on an iPhone 18 Pro simulator (iOS 27.2) with a 45 g demo meal.

Past (disabled) Present (disabled) Future (enabled)
Past entry with the reminder switch disabled Present entry with the reminder switch disabled Future entry with the reminder switch enabled and off

Future entry with the reminder switched on

Validation

  • 138 focused tests passed on an iPhone 18 Pro simulator (iOS 27.2), covering retry after a saved carb edit, reminder-only updates, the future-time boundary, notification scheduling and cancellation, alert muting, and the four-hour carb entry limit.
  • On the simulator, moving a future entry back to the present or past disabled the switch and cleared the selection.

@damonbayer
damonbayer force-pushed the dmb/meal-reminder-toggle branch from 98d46aa to 594ccd7 Compare November 7, 2026 23:59
@damonbayer damonbayer changed the title Show Remind Me toggle for future carb entries Keep Remind Me visible on the carb entry screen Nov 7, 2026
@damonbayer damonbayer changed the title Keep Remind Me visible on the carb entry screen Add meal reminders for future carb entries Nov 8, 2026
@damonbayer

damonbayer commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

I had an agent implement this mostly to evaluate / mock up the user experience. I have no idea if the technical details about managing the reminders are appropriate.

@marionbarker

Copy link
Copy Markdown
Contributor

Test

✅ successful test

  • reminder was pretty subtle, but that may be my settings
  • I got a notification on my watch as well as locked phone

Configuration

Start with LoopWorkspace next-dev commit 9a35873

  • apply the patch from PR 2666 to the Loop submodule
  • build onto test phone SE 3rd gen iOS 27.2
  • build onto personal iPhone 15 pro iOS 27.2

Test Details

  • ✅ successful entry of carbs 4 hours in future
  • ✅ successful entry of carbs in past, the reminder slider is inactive as expected
  • ✅ successful entry of carbs 15 min in future and enable the reminder
    • ✅ got the reminder as expected at 11:15 (Time sensitive: Time to Eat)
      • Note - this reminder appeared, as expected, after the test in the next row
  • ✅ successful edit of carbs 4 hours in future to a time 2 min from now and able to enable reminder slider
    • locked the phone
    • ✅ got the reminder as expected at 11:10 (Time sensitive: Time to Eat)
  • ✅ 11:18 enter carbs in future with reminder enabled (for 11:33)
    • edit the future carbs, slider shows reminder is enabled
    • modify the time for the carbs to be in the past (11:18)
    • slider automatically changes to disabled and cannot be modified

The reminder row is always present, but timer can only be enabled for carbs in the future.

@marionbarker

Copy link
Copy Markdown
Contributor

Code Review

I picked up a few comments from a Claude review:

  • Localization: new user-facing strings were not added to the string catalog in this PR. They should be added to this PR.
  • Watch and remote entries cannot request a reminder. This is expected scope; just noting it.

Passing this one on for @damonbayer to decide if it's a concern:

  • Authorization check is strict. authorize requires alertSetting == .enabled. A user who has turned banners off but still allows Lock Screen or Notification Center would get "Unable to Set Meal Reminder" even though the notification could be shown.

@damonbayer

damonbayer commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author
  • reminder was pretty subtle, but that may be my settings

@marionbarker Do you think it should be more prominent? I think most of the time you are eating, you would not want a loud notification to come from your phone. Especially if you were already eating.

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.

2 participants