Add a Live Activity for the running workout

A new iOS widget extension shows the active exercise, its phase, and the
work/rest countdown on the lock screen and in the Dynamic Island, driven
by the run flow's live frames so locking the phone mid-set keeps the
timer. The activity is seeded on open, refreshed on every page settle,
dismissed when the flow is left, and cleared on next launch if stranded.
Unifies the build-info stamping across all targets via a YAML anchor.

Claude-Session: https://claude.ai/code/session_01HJDQQDA9QdP8zByg43H5v3
This commit is contained in:
2026-07-08 08:02:34 -04:00
parent e04eb83e70
commit df3eac9d5f
11 changed files with 569 additions and 18 deletions
+6
View File
@@ -14,6 +14,10 @@ final class AppServices {
let workoutLauncher = WorkoutLauncher()
let workoutHealthDeleter = WorkoutHealthDeleter()
/// Owns the active-workout Live Activity (lock screen + Dynamic Island). Driven by the run
/// flow's `LiveProgress` frames, so locking the phone mid-set doesn't lose the timer.
let liveActivity = WorkoutLiveActivityController()
/// Ephemeral live-run state fed by the watch, observed by the mirror UI. Not persisted.
let liveRunState: LiveRunState
@@ -37,6 +41,8 @@ final class AppServices {
if let bootstrapTask { await bootstrapTask.value; return }
let task = Task { @MainActor [weak self] in
guard let self else { return }
// Clear any Live Activity stranded by a previous launch (app killed mid-run).
await self.liveActivity.endStaleActivities()
await self.syncEngine.connect()
self.watchBridge.activate()
// Past the iCloud gate: request the workout-share scope so the user can still