Skip to content

Quick-Pick Boluses and Meals for remote commands#603

Open
bjorkert wants to merge 3 commits intodevfrom
feature/quick-pick-remote-commands
Open

Quick-Pick Boluses and Meals for remote commands#603
bjorkert wants to merge 3 commits intodevfrom
feature/quick-pick-remote-commands

Conversation

@bjorkert
Copy link
Copy Markdown
Contributor

What this adds

Quick-Pick Boluses and Meals: contextual shortcut buttons that appear at the top of the bolus and meal entry screens in TRC (Trio Remote Commands) and Loop APNS remote views.

Instead of typing an amount each time, the most relevant recent entries appear as tap-to-fill buttons — saving a step for the caregiver sending remote commands.

How it works

Every successfully sent bolus or meal is stored locally on the device. When the remote command screen opens, the stored history is scored to surface the most relevant options for right now, considering:

  • Time of day — entries from similar times score higher
  • Day of week — weekday/weekend patterns are treated separately
  • Recency — older entries fade out gradually (half-life ~10 days)

Up to 5 results are shown. The section is hidden entirely until there is history to show.

Scope

View Quick-Pick section
TRC Bolus Quick-Pick Boluses
TRC Meal Quick-Pick Meals (carbs + optional fat/protein + optional bolus)
Loop APNS Bolus Quick-Pick Boluses
Loop APNS Carbs Quick-Pick Meals (carbs only)
  • Meal boluses sent via TRC are stored as part of the meal record, not as standalone boluses, so they don't pollute the bolus quick-picks
  • Loop APNS carbs-only entries are stored into the shared meal history and scored alongside TRC meal history
  • Fat/protein fields are only applied when the "Meal with fat/protein" setting is enabled
  • History is stored locally in UserDefaults (Nightscout cannot distinguish remote vs manual entries)

Info button

Each Quick-Pick section header includes an ⓘ button. Tapping it shows a brief, plain-language explanation of what the buttons are and how they are built — easily dismissed by swiping or tapping Done.

New files

  • Remote/QuickPickBoluses/QuickPickBolusesManager.swift — scoring logic + history management for boluses
  • Remote/QuickPickBoluses/RemoteBolusHistoryEntry.swift — local history model
  • Remote/QuickPickMeals/QuickPickMealsManager.swift — scoring logic + history management for meals
  • Remote/QuickPickMeals/RemoteMealHistoryEntry.swift — local history model
  • Helpers/Views/QuickPickSectionHeader.swift — reusable section header with info popover

Renames all files, classes, types, and UI labels introduced by the
quick-pick feature from "Common" to "Quick-Pick":

- CommonBoluses/ → QuickPickBoluses/
- CommonMeals/ → QuickPickMeals/
- CommonBolusesManager → QuickPickBolusesManager
- CommonMealsManager → QuickPickMealsManager
- CommonSectionHeader → QuickPickSectionHeader
- UI labels: "Common Boluses/Meals" → "Quick-Pick Boluses/Meals"
@bjorkert
Copy link
Copy Markdown
Contributor Author

bjorkert commented Apr 12, 2026

2AF6CAAE-6A55-4673-8F23-F64537AB2E2C_4_5005_c
0D00597C-704A-48AA-863D-278357F0C963_4_5005_c

@bjorkert
Copy link
Copy Markdown
Contributor Author

3D50391D-81C9-468D-A742-465871506664_4_5005_c
DA87E8EF-2699-4B79-9F1C-2957E2E8A80A_4_5005_c

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.

1 participant