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:
@@ -10,7 +10,7 @@ import Testing
|
||||
struct ExerciseLibraryQueryTests {
|
||||
|
||||
private func makeContext() throws -> ModelContext {
|
||||
let schema = Schema([Split.self, Exercise.self, Workout.self, WorkoutLog.self])
|
||||
let schema = Schema([Routine.self, Exercise.self, Workout.self, WorkoutLog.self])
|
||||
// cloudKitDatabase: .none matches WorkoutsModelContainer — see SeedLibraryTests.
|
||||
let config = ModelConfiguration(schema: schema, isStoredInMemoryOnly: true, cloudKitDatabase: .none)
|
||||
let container = try ModelContainer(for: schema, configurations: [config])
|
||||
@@ -19,15 +19,16 @@ struct ExerciseLibraryQueryTests {
|
||||
|
||||
@Test func machineSettingsFetchFindsRecordedSettings() throws {
|
||||
let context = try makeContext()
|
||||
let split = Split(id: "S1", name: "Upper Body", color: "indigo",
|
||||
// PINNED: routine documents live under the on-disk "Splits/" directory.
|
||||
let routine = Routine(id: "S1", name: "Upper Body", color: "indigo",
|
||||
systemImage: "dumbbell.fill", order: 0,
|
||||
createdAt: .now, updatedAt: .now, jsonRelativePath: "Splits/S1.json")
|
||||
let exercise = Exercise(id: "E1", name: "Chest Press", order: 0, sets: 3, reps: 10,
|
||||
weight: 100, loadType: LoadType.weight.rawValue,
|
||||
durationTotalSeconds: 0,
|
||||
machineSettings: [MachineSetting(name: "Seat Height", value: "4")])
|
||||
exercise.split = split
|
||||
context.insert(split)
|
||||
exercise.routine = routine
|
||||
context.insert(routine)
|
||||
context.insert(exercise)
|
||||
try context.save()
|
||||
|
||||
@@ -37,12 +38,12 @@ struct ExerciseLibraryQueryTests {
|
||||
))
|
||||
#expect(fetched.count == 1)
|
||||
#expect(fetched.first?.machineSettings == [MachineSetting(name: "Seat Height", value: "4")])
|
||||
#expect(fetched.first?.split?.name == "Upper Body")
|
||||
#expect(fetched.first?.routine?.name == "Upper Body")
|
||||
}
|
||||
|
||||
@Test func weightedLogFetchGatesChart() throws {
|
||||
let context = try makeContext()
|
||||
let workout = Workout(id: "W1", splitID: nil, splitName: "Upper Body",
|
||||
let workout = Workout(id: "W1", routineID: nil, routineName: "Upper Body",
|
||||
start: .now, end: .now, statusRaw: WorkoutStatus.completed.rawValue,
|
||||
createdAt: .now, updatedAt: .now,
|
||||
jsonRelativePath: "Workouts/2026/07/W1.json")
|
||||
|
||||
Reference in New Issue
Block a user