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:
2026-07-11 07:53:01 -04:00
parent 5c201289fb
commit 6e440317c4
97 changed files with 5354 additions and 1291 deletions
+17 -3
View File
@@ -13,9 +13,21 @@ import Foundation
/// supersede checks key on it, newer wins.
struct PendingWrite: Codable, Sendable {
enum Payload: Codable, Sendable {
case split(SplitDocument)
case routine(RoutineDocument)
case workout(WorkoutDocument)
case schedule(ScheduleDocument)
case delete(id: String, kind: String, livePath: String)
// PINNED KEY: the case was renamed `.split` `.routine`, but its persisted
// JSON key stays `"split"` so a `PendingWrites.json` sidecar written by a
// previous run still decodes. `workout` / `schedule` / `delete` keep their
// default keys.
enum CodingKeys: String, CodingKey {
case routine = "split"
case workout
case schedule
case delete
}
}
var payload: Payload
@@ -36,8 +48,9 @@ struct PendingWrite: Codable, Sendable {
var documentID: String {
switch payload {
case .split(let doc): doc.id
case .routine(let doc): doc.id
case .workout(let doc): doc.id
case .schedule(let doc): doc.id
case .delete(let id, _, _): id
}
}
@@ -45,8 +58,9 @@ struct PendingWrite: Codable, Sendable {
/// Where a successful write lands; nil for deletes (they only remove).
var targetPath: String? {
switch payload {
case .split(let doc): doc.relativePath
case .routine(let doc): doc.relativePath
case .workout(let doc): doc.relativePath
case .schedule(let doc): doc.relativePath
case .delete: nil
}
}