From 098db881bb64660b0ecd41f097448a3b7c16addc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB?= Date: Sun, 9 Aug 2026 18:42:21 +0200 Subject: [PATCH] feat(watch): add rest duration display in workout views --- targets/watch/Localizable.xcstrings | 59 +++++++++++++++++++++ targets/watch/Views/ActiveWorkoutView.swift | 37 ++++++++----- targets/watch/Views/WorkoutDetailView.swift | 27 +++++++--- 3 files changed, 104 insertions(+), 19 deletions(-) diff --git a/targets/watch/Localizable.xcstrings b/targets/watch/Localizable.xcstrings index f668f7b..4fb7f51 100644 --- a/targets/watch/Localizable.xcstrings +++ b/targets/watch/Localizable.xcstrings @@ -51,6 +51,65 @@ }, "%lldm total" : { + }, + "%ds rest" : { + "extractionState" : "manual", + "localizations" : { + "de" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds Pause" + } + }, + "dk" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds hvile" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds rest" + } + }, + "es" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds descanso" + } + }, + "fr" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds repos" + } + }, + "it" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds recupero" + } + }, + "nl" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds rust" + } + }, + "pl" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds odpoczynku" + } + }, + "pt" : { + "stringUnit" : { + "state" : "translated", + "value" : "%ds descanso" + } + } + } }, "%lldx%lldm" : { "localizations" : { diff --git a/targets/watch/Views/ActiveWorkoutView.swift b/targets/watch/Views/ActiveWorkoutView.swift index 4e8204f..4613578 100644 --- a/targets/watch/Views/ActiveWorkoutView.swift +++ b/targets/watch/Views/ActiveWorkoutView.swift @@ -165,18 +165,31 @@ struct WorkoutOverviewPage: View { if let workout = workoutManager.selectedWorkout { ForEach(Array(workout.sets.enumerated()), id: \.offset) { i, set in - HStack { - Circle() - .fill(i < workoutManager.currentSetIndex ? .green : - i == workoutManager.currentSetIndex ? .cyan : .gray.opacity(0.4)) - .frame(width: 8, height: 8) - Text("\(i + 1). \(set.stroke)") - .font(.caption) - .foregroundColor(i <= workoutManager.currentSetIndex ? .primary : .secondary) - Spacer() - Text("\(set.repCount)x\(set.distancePerRep)m") - .font(.caption2) - .foregroundColor(.secondary) + VStack(alignment: .leading, spacing: 2) { + HStack { + Circle() + .fill(i < workoutManager.currentSetIndex ? .green : + i == workoutManager.currentSetIndex ? .cyan : .gray.opacity(0.4)) + .frame(width: 8, height: 8) + Text("\(i + 1). \(set.stroke)") + .font(.caption) + .foregroundColor(i <= workoutManager.currentSetIndex ? .primary : .secondary) + Spacer() + Text("\(set.repCount)x\(set.distancePerRep)m") + .font(.caption2) + .foregroundColor(.secondary) + } + if set.restType != "none", set.restDuration > 0 { + HStack(spacing: 2) { + Spacer().frame(width: 14) + Image(systemName: "clock") + .font(.caption2) + .foregroundColor(.orange) + Text(String(format: "%ds rest", Int(set.restDuration))) + .font(.caption2) + .foregroundColor(.orange) + } + } } } } diff --git a/targets/watch/Views/WorkoutDetailView.swift b/targets/watch/Views/WorkoutDetailView.swift index c164542..3731b91 100644 --- a/targets/watch/Views/WorkoutDetailView.swift +++ b/targets/watch/Views/WorkoutDetailView.swift @@ -26,13 +26,26 @@ struct WorkoutDetailView: View { Section("Sets") { ForEach(Array(workout.sets.enumerated()), id: \.offset) { i, set in - HStack { - Text("\(i + 1). \(set.stroke)") - .font(.body) - Spacer() - Text("\(set.repCount)x\(set.distancePerRep)m") - .font(.caption) - .foregroundColor(.secondary) + VStack(alignment: .leading, spacing: 2) { + HStack { + Text("\(i + 1). \(set.stroke)") + .font(.body) + Spacer() + Text("\(set.repCount)x\(set.distancePerRep)m") + .font(.caption) + .foregroundColor(.secondary) + } + if set.restType != "none", set.restDuration > 0 { + HStack(spacing: 2) { + Spacer().frame(width: 14) + Image(systemName: "clock") + .font(.caption2) + .foregroundColor(.orange) + Text(String(format: "%ds rest", Int(set.restDuration))) + .font(.caption2) + .foregroundColor(.orange) + } + } } } }