Add machine comfort settings and tighten the document schemas
Machine-based exercises now carry ordered name/value comfort settings (seat height, back-rest position, ...) on both ExerciseDocument and, as a plan-time snapshot, WorkoutLogDocument — the optional array doubles as the machine flag. Editable from the exercise editor's new Machine section and from the workout row's settings sheet, whose mid-workout edits write back to the originating split (workout saved first, so seed clone-on-edit repointing can't clobber the log edit). Schema tightening rides the same rev: splits bump to v2 (weight-reminder fields and the unused exercise category removed), workouts to v3 (the derived `completed` flag removed; status is the single source). Starter seeds regenerated at v2 with unchanged ULIDs; SwiftData cache schema bumped to rebuild. SCHEMA.md documents the shapes. Claude-Session: https://claude.ai/code/session_01LEoff8bXGBS83tK1c55Mf7
This commit is contained in:
@@ -20,8 +20,12 @@ struct WeightProgressionChartView: View {
|
||||
init(exerciseName: String) {
|
||||
self.exerciseName = exerciseName
|
||||
let name = exerciseName
|
||||
// `completed` is derived (status == .completed); the predicate compares the
|
||||
// stored `statusRaw` column directly, since #Predicate can't call a computed
|
||||
// property. Capture the raw value in a local so the macro can embed it.
|
||||
let completedRaw = WorkoutStatus.completed.rawValue
|
||||
_logs = Query(
|
||||
filter: #Predicate<WorkoutLog> { $0.exerciseName == name && $0.completed },
|
||||
filter: #Predicate<WorkoutLog> { $0.exerciseName == name && $0.statusRaw == completedRaw },
|
||||
sort: \WorkoutLog.date,
|
||||
order: .forward
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user