Skip to content

Add Apple Watch companion app - complications, full data views, remote commands - #642

Open
aug0211 wants to merge 9 commits into
loopandlearn:devfrom
aug0211:auggie-watch
Open

Add Apple Watch companion app - complications, full data views, remote commands#642
aug0211 wants to merge 9 commits into
loopandlearn:devfrom
aug0211:auggie-watch

Conversation

@aug0211

@aug0211aug0211 commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a watchOS companion target (LoopFollowWatch) providing glanceable BG, remote controls (bolus, meal, override, temp target), and Nightscout/Dexcom Share data fetching. Reliable command delivery via APNS time-sensitive alerts. Independent from phone - parents can now go phone free and manage for kiddos directly from Watch!

Note: tested for 6 weeks (and counting) as our daily driver across Apple Watches from our son (T1D), mom, and dad for all Trio commands (meals, FPU, boluses, overrides, temp targets, dosing decisions). Loop needs to be tested.

Motivation

Why this matters: parents of T1D kids managing care across iPhone + watch, gap in current LoopFollow for watchOS users, etc. Full remote visibility and control from watch, fully independent of phone. Parents are no longer tied to a phone to manage T1D for their children.

What's Included

  • Watch target with BG chart and complications
  • Double tap to zoom in, triple tap to zoom out, scroll forward and backward with crown
  • Top level stats update on main screen while scrolling through time
  • Remote control views (bolus, meal, override, temp target)
  • Easter eggs for celebrations randomly on remote commands - surprise and delight (my wife and son fight over who gets to send remote commands now!)
  • Stats view on watch for past 24 hr

Testing

  • Three in vivo Apple Watch devices, WatchOS 26, Nightscout, Trio
  • Apple Watch Series 10 + iPhone Air
  • Apple Watch Series 10 + iPhone 15 Pro
  • Apple Watch Ultra + iPhone 17 Pro

Photos

incoming-AE295971-88BD-4BB1-BA4F-2178E8DFDB14incoming-884BD748-8D0B-429F-B58C-5224850914ECincoming-1F9306E4-4027-4B1F-9C00-34D7AE0B23B5incoming-2CF8CBC4-42DE-4D7D-A6A8-4BC2B78BD04Eincoming-BF38DB69-452F-4E4A-9B5C-6FA4D4BC00E8incoming-14E2C32E-25CE-437B-A63C-A354AFD75452incoming-DFE7FB2E-AD96-4EA6-917E-DC30DA2986EDincoming-59A9253F-66B5-4393-A9B5-1C4194F9E619incoming-180393C7-8F7E-47E5-872E-70D396DF560Cincoming-F553893C-4182-4694-A0C7-3FD19D7D10DEincoming-0FF21A9F-2805-42AF-8EEB-0A90D3004DC3incoming-44348644-518E-49F6-B564-C63FFDB7BEC9incoming-5431889C-B541-49A3-873B-31328D003B90incoming-92EE8B33-D062-4F50-973E-881B1F4B2CADincoming-52E02158-2850-4B83-A4DB-498F77C165ABincoming-265FD586-5601-4173-86FC-11B1FCBFE519incoming-51FB9789-37FA-4DDB-8B00-BC2B3F48C7CAincoming-AF6DECD2-D84B-4A3D-994B-E2020BC2E34Eincoming-A264866E-09B9-4321-8CFA-EC9EC9C9DEBBincoming-93C2845D-F42E-45D4-849C-451F4C607A57incoming-DF3282EF-01B2-4CF9-AFAA-19B44A8F5381incoming-4932960F-5155-4692-B039-D5E633E9C0AFincoming-AFEF51F4-02F1-4ADB-B94C-256F599AB0BCincoming-D50616C6-5C7C-40C1-B956-60D03CD368C1incoming-FDD90003-686D-47A3-8D77-D8AC93C2595Dincoming-685F1960-79E5-4E66-B6BA-90887B0FCAC7

aug0211and others added 3 commits May 8, 2026 00:33
Watch app with BG chart, remote controls (bolus, meal, override, temp target), and Nightscout/Dexcom Share data fetching. APNS push uses alert type with time-sensitive delivery for reliable command delivery.
Isolated watch-only changes on top of latest upstream dev — no unrelated iOS feature modifications.
- Complications for rectangle, circle, also bolus/meal/override/temp deep link shortcuts
- Dynamic BG color integrated throughout experiences
- Stats view on watch
- LoopStatus view on watch
- Cleaned up crown rotation requirements
- Watch was reading top-level `token` from /api/v1/status.json but Nightscout nests it under `authorized.token`
- POST treatments now actually authorize
- Cached APNS JWTs for 55 min (with 403-invalidation) instead of re-signing P256 on every send
- Forwarded LF APNS creds over WCSession so Trio return-notifications land on the iPhone
@aug0211aug0211 changed the title Auggie watchAdd full Apple Watch companion app - complications, full data views, remote commandsMay 8, 2026
@aug0211aug0211 changed the title Add full Apple Watch companion app - complications, full data views, remote commandsAdd Apple Watch companion app - complications, full data views, remote commandsMay 8, 2026
aug0211 added 3 commits May 8, 2026 10:46
- Apply SwiftFormat auto-fixes to resolve CI lint failures
- Changes include indentation, file headers, spacing around operators, unused argument markers, brace wrapping, trailing commas, sort imports, and redundant self removal
- Covers ~25 files in LoopFollowWatch, LoopFollowWidgets, and LoopFollow/Watch.
- PhoneSessionManager.swift: added back in mealWithFatProtein, maxProtein, and maxFat to the buildConfig() dictionary so they're actually sent to the watch
- RemoteSettingsViewModel.swift: added PhoneSessionManager.shared.sendConfig() in $mealWithFatProtein so toggling it immediately pushes the new config to the watch
- BGFetcher.swift: add completion handler to fetchDeviceStatus so bolus screen can await fresh IOB/COB
- WatchBolusView.swift: fetch latest device status on appear with loading overlay to prevent stale COB double-counting
aug0211 added 3 commits May 8, 2026 19:52
Sign up for freeto 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

@aug0211