Harden watch sync against schema mismatches and surface log-row settings

The watch now re-applies the phone's application context once activation
completes (real hardware activates asynchronously, so the eager launch
read sees an empty context), and a state push that fails to decode —
a phone/watch build running different document schemas — is logged and
skipped instead of pruning the cache against a bogus empty set. Workout
log rows offer the machine-settings editor for any machine-based library
exercise, not just logs that already carry settings.

Claude-Session: https://claude.ai/code/session_01LEoff8bXGBS83tK1c55Mf7
This commit is contained in:
2026-07-06 20:10:36 -04:00
parent 669ecf1259
commit 6521de8f17
3 changed files with 53 additions and 12 deletions
@@ -434,11 +434,14 @@ private struct WorkoutLogRow: View {
.foregroundStyle(.primary)
}
// Machine comfort settings shown for any machine-based log
// (`machineSettings != nil`), independent of load type. Tapping opens
// the editor sheet; `.plain` keeps the tap from firing the row's
// NavigationLink (same trick as the checkbox button).
if log.machineSettings != nil {
// Machine comfort settings shown when the log carries settings, or
// for any exercise the authored library identifies as machine-based
// (same rule as ExerciseView), so older logs offer the affordance
// before settings are first recorded. Tapping opens the editor sheet;
// `.plain` keeps the tap from firing the row's NavigationLink (same
// trick as the checkbox button).
if log.machineSettings != nil
|| ExerciseInfoLibrary.info(for: log.exerciseName)?.isMachineBased == true {
Button(action: onSettingsTap) {
Label("Settings", systemImage: "slider.horizontal.3")
.font(.footnote.weight(.medium))