Restructure into a three-tab app with Progress, goals, and Meditation
The UX redesign's first landing (spec in UX-REDESIGN.md): ContentView becomes a Today / Progress / Settings TabView, "Routine" replaces "Split" in every user-facing string and view name (code-level types keep their names), and workout starting moves to shared WorkoutStarter / StartedWorkoutNavigator plumbing. - New Progress tab: weekly goal streaks, workout trends, per-exercise weight progression, achievements, and the full history list (WorkoutLogsView -> WorkoutHistoryView). - Goals: stable categories workouts roll up to, managed from Settings. - New Meditation exercise + starter routine; timed sits record to Apple Health as Mind & Body sessions. Claude-Session: https://claude.ai/code/session_012qw2itfzKyEJ1HpsFt8Ex4
This commit is contained in:
@@ -43,6 +43,18 @@ final class AppServices {
|
||||
let liveRunState = LiveRunState()
|
||||
self.liveRunState = liveRunState
|
||||
self.watchBridge = PhoneConnectivityBridge(container: container, syncEngine: syncEngine, liveRunState: liveRunState)
|
||||
// Launch the wrist session only when a run actually begins (the first
|
||||
// exercise leaves `.notStarted` on the phone) — creating a workout alone is
|
||||
// just a peek and must not start anything on the watch. Watch-originated
|
||||
// starts don't fire this hook; the watch already owns its session.
|
||||
syncEngine.onWorkoutBecameActive = { [weak self] doc in
|
||||
guard let self else { return }
|
||||
let routine = doc.routineID.flatMap { id in
|
||||
CacheMapper.fetchRoutine(id: syncEngine.currentRoutineID(for: id), in: container.mainContext)
|
||||
}
|
||||
let activityType = routine?.activityTypeEnum ?? .traditionalStrength
|
||||
self.workoutLauncher.launchWatchWorkout(activityType: activityType.hkActivityType)
|
||||
}
|
||||
#if DEBUG
|
||||
if ScreenshotSeed.isActive { ScreenshotSeed.populate(container.mainContext) }
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user