feat(watch): add rest duration display in workout views

This commit is contained in:
2026-08-09 18:42:21 +02:00
parent a17ae0dea5
commit 098db881bb
3 changed files with 104 additions and 19 deletions
+59
View File
@@ -51,6 +51,65 @@
}, },
"%lldm total" : { "%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" : { "%lldx%lldm" : {
"localizations" : { "localizations" : {
@@ -165,6 +165,7 @@ struct WorkoutOverviewPage: View {
if let workout = workoutManager.selectedWorkout { if let workout = workoutManager.selectedWorkout {
ForEach(Array(workout.sets.enumerated()), id: \.offset) { i, set in ForEach(Array(workout.sets.enumerated()), id: \.offset) { i, set in
VStack(alignment: .leading, spacing: 2) {
HStack { HStack {
Circle() Circle()
.fill(i < workoutManager.currentSetIndex ? .green : .fill(i < workoutManager.currentSetIndex ? .green :
@@ -178,6 +179,18 @@ struct WorkoutOverviewPage: View {
.font(.caption2) .font(.caption2)
.foregroundColor(.secondary) .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)
}
}
}
} }
} }
} }
@@ -26,6 +26,7 @@ struct WorkoutDetailView: View {
Section("Sets") { Section("Sets") {
ForEach(Array(workout.sets.enumerated()), id: \.offset) { i, set in ForEach(Array(workout.sets.enumerated()), id: \.offset) { i, set in
VStack(alignment: .leading, spacing: 2) {
HStack { HStack {
Text("\(i + 1). \(set.stroke)") Text("\(i + 1). \(set.stroke)")
.font(.body) .font(.body)
@@ -34,6 +35,18 @@ struct WorkoutDetailView: View {
.font(.caption) .font(.caption)
.foregroundColor(.secondary) .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)
}
}
}
} }
} }