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:
@@ -35,24 +35,6 @@ enum LoadType: Int, CaseIterable, Codable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
/// Which segment of a split an exercise belongs to — the split screen groups its
|
||||
/// exercise list by this. Persisted as its raw `Int` value; `main` is the default
|
||||
/// (and what older documents without the field decode to).
|
||||
enum ExerciseCategory: Int, CaseIterable, Codable, Sendable {
|
||||
case main = 0
|
||||
case warmup = 1
|
||||
|
||||
/// Order the categories appear on screen: warm-up first, then the main circuit.
|
||||
static let displayOrder: [ExerciseCategory] = [.warmup, .main]
|
||||
|
||||
var displayName: String {
|
||||
switch self {
|
||||
case .main: "Main Circuit"
|
||||
case .warmup: "Warm-up"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The kind of training a split represents — used to tag the Apple Health workout
|
||||
/// so it lands in the right category (and credits the rings correctly), and to pick
|
||||
/// a MET value when the phone has to estimate calories without watch sensor data.
|
||||
|
||||
Reference in New Issue
Block a user