Skip to content

Watch: centered glucose page, working chart scrubbing, and overrides - #789

Merged
bjorkert merged 4 commits into
loopandlearn:feature/apple-watchfrom
achkars-org:feature/watch-chart-overrides
Oct 23, 2026
Merged

bjorkert merged 4 commits into
loopandlearn:feature/apple-watchfrom
achkars-org:feature/watch-chart-overrides

Conversation

@MtlPhil

@MtlPhil MtlPhil commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

Glucose page

  • The BG digits and delta are centered. The trend arrow hangs off the number's trailing edge instead of pushing the digits left.
  • IOB and COB share one line under the delta, with syringe and fork-and-knife icons, instead of IOB in the top toolbar and COB below.
  • The running override shows as a green line with its name and insulin-needs percentage.

Chart page

  • Fix: the Digital Crown now scrubs after tapping the chart. Focus was requested in the same update that made the page focusable, so it was dropped and the crown kept paging.
  • A crown button in the toolbar makes scrubbing discoverable and toggles it. It turns green while active.
  • While scrubbing, a row under the chart shows the time, a range-colored dot with the BG, and any carbs and boluses within the marker's five-minute crown step. It sits below the chart, clear of the toolbar buttons.
  • Overrides draw as a thin green band along the top of the chart. A line under the chart shows the running override's name and percentage, or the one at the marker while scrubbing.

Phone → watch

  • WatchState gains an optional overrides list (start, end, name, percent) covering the last 24 hours, built from overrideGraphData. When the Nightscout entry carries no insulin-needs factor (Trio's may not), the percentage comes from the preset with the same name. The field is optional, so the watch's own Nightscout fetch and older cached state still decode.

Notes

  • The insulin on the scrub row includes SMBs, matching the bolus markers on the chart.
  • If a preset was edited after an override started, the fallback percentage reflects the preset's current value.

…n the chart page

The trend arrow no longer shifts the BG digits or the delta off center, and
IOB and COB share one line under the delta with syringe and fork-and-knife icons.

On the chart page, crown focus is now requested after the page becomes
focusable, so the crown scrubs instead of paging. A crown button in the
toolbar shows the feature and toggles it.
The readout moves below the chart so it no longer collides with the toolbar
buttons, and shows a range-colored dot with the BG plus any carbs and boluses
that fall within the marker's five-minute crown step.
…on the glucose page

The phone now sends the override periods of the last 24 hours with their
name and insulin needs, taking the percentage from the matching preset when
Nightscout does not carry it. The chart draws them as a thin green band along
the top, and the glucose page shows the running override's name and
percentage under IOB and COB.
The line shows the running override, or the one at the marker while
scrubbing, and shares its view with the glucose page.
@bjorkert
bjorkert merged commit 657000a into loopandlearn:feature/apple-watch Oct 23, 2026
1 check passed
marionbarker pushed a commit that referenced this pull request Oct 26, 2026
* Add an Apple Watch app fed by the phone, with remote commands for Loop and Trio

The phone sends glucose, chart data and remote settings to the watch over WatchConnectivity; the watch holds no credentials. Commands from the watch are validated and sent by the phone through the existing Loop APNS and Trio Remote Control paths, gated by a new Remote setting. Includes WidgetKit complications, watch targets in fastlane and tests for the watch protocol.

* Put the watch Remote page before Info, allow watch commands by default, and limit complication reloads to new readings

Remote tiles are disabled while the iPhone is out of reach.

* Make the watch app glanceable: one large BG, actions in the bottom toolbar, quick picks

The glucose page shows BG with trend and delta, IOB and age in the top bar, a two-hour sparkline, and Override, Meal or Bolus, and Temp Target in the bottom toolbar. The full chart has its own page. Bolus offers the AID's recommendation and the phone's Quick-Pick boluses before a custom amount; Meal shows Quick-Pick meals and carbs, with fat, protein, bolus and time under More. A successful send shows Sent, notes that Loop or Trio confirms with a notification, and returns to the glucose page.

* Point browser builders to the docs when the watch identifiers are not set up

* Keep watch Info values clear of the page indicator and widen the Meal buttons

* Check that the watch identifiers exist before match, since its read-only failure does not name the missing profile

* Mirror the phone's info table on the watch: same rows, order and coloring

* Share the APNs, JWT, TRC encryption and Loop payload code between the phone and the watch

* Send credentials to the watch when they change, and share command validation between the phone and the watch

* Let the watch fetch from Nightscout or Dexcom and send commands directly while the phone is out of reach

* Show the phone's statistics on the watch and mark data fetched by the watch itself

* Scrub the watch chart with the Digital Crown and pick the time span from the toolbar

* Test watch command validation, signing key choice, devicestatus parsing and Loop override payloads

* Schedule the watch background refresh once the app is running

* Deliver credentials to the watch by message as well as by transfer, and send directly when the phone is unreachable before delivery

* Convert Nightscout dates on the watch and give up waiting for the phone after 30 seconds

* Leave out watch chart hour labels too close to the edges to fit

* Show only the reading age on the watch glucose page, keep the toolbar buttons the same size, and let Trio meals carry a bolus as on the phone

The crown symbol for setting an amount follows the wrist the watch is worn on.

* Let the crown scroll the watch meal screen until a field is tapped

* Show Other Amount on the watch bolus list as plain text

* Fit the watch statistics page on one screen on every watch size and wrap the waiting-for-iPhone title

* Watch: centered glucose page, working chart scrubbing, and overrides (#789)

* Center the watch BG with IOB and COB icons, and fix crown scrubbing on the chart page

The trend arrow no longer shifts the BG digits or the delta off center, and
IOB and COB share one line under the delta with syringe and fork-and-knife icons.

On the chart page, crown focus is now requested after the page becomes
focusable, so the crown scrubs instead of paging. A crown button in the
toolbar shows the feature and toggles it.

* Show BG, carbs and insulin under the watch chart while scrubbing

The readout moves below the chart so it no longer collides with the toolbar
buttons, and shows a range-colored dot with the BG plus any carbs and boluses
that fall within the marker's five-minute crown step.

* Show overrides on the watch: a band on the chart and the running one on the glucose page

The phone now sends the override periods of the last 24 hours with their
name and insulin needs, taking the percentage from the matching preset when
Nightscout does not carry it. The chart draws them as a thin green band along
the top, and the glucose page shows the running override's name and
percentage under IOB and COB.

* Show the override's name and percentage under the watch chart

The line shows the running override, or the one at the marker while
scrubbing, and shares its view with the glucose page.

* Give the crown back to page navigation when watch chart scrubbing ends

* Scrub the watch chart on a screen of its own so the crown pages again after going back

* Open watch chart scrubbing by tapping the chart

* Step watch amounts one detent at a time and add − and + buttons

The crown moves the amount by whole steps, insulin fields use low crown sensitivity, and the buttons nudge the value by one step.

* Keep the watch − button clear of the screen edge and enlarge the nudge buttons

---------

Co-authored-by: Phil A <76601115+MtlPhil@users.noreply.github.com>
@MtlPhil
MtlPhil deleted the feature/watch-chart-overrides branch November 3, 2026 14:22
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