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
49 lines
989 B
Swift
49 lines
989 B
Swift
//
|
|
// CheckboxStatus.swift
|
|
// Workouts
|
|
//
|
|
// Created by rzen on 7/20/25 at 11:07 AM.
|
|
//
|
|
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
enum CheckboxStatus {
|
|
case checked
|
|
case unchecked
|
|
case intermediate
|
|
case cancelled
|
|
|
|
var color: Color {
|
|
switch self {
|
|
case .checked: .accentColor
|
|
case .unchecked: .gray
|
|
case .intermediate: .accentColor
|
|
case .cancelled: .gray
|
|
}
|
|
}
|
|
|
|
var systemName: String {
|
|
switch self {
|
|
case .checked: "checkmark.circle.fill"
|
|
case .unchecked: "circle"
|
|
case .intermediate: "ellipsis.circle"
|
|
case .cancelled: "wrongwaysign"
|
|
}
|
|
}
|
|
}
|
|
|
|
// MARK: - WorkoutStatus Extension
|
|
|
|
extension WorkoutStatus {
|
|
var checkboxStatus: CheckboxStatus {
|
|
switch self {
|
|
case .notStarted: .unchecked
|
|
case .inProgress: .intermediate
|
|
case .completed: .checked
|
|
case .skipped: .cancelled
|
|
}
|
|
}
|
|
}
|