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
+20 -7
View File
@@ -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)
}
}
}
}
}