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" : {
+25 -12
View File
@@ -165,18 +165,31 @@ 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
HStack { VStack(alignment: .leading, spacing: 2) {
Circle() HStack {
.fill(i < workoutManager.currentSetIndex ? .green : Circle()
i == workoutManager.currentSetIndex ? .cyan : .gray.opacity(0.4)) .fill(i < workoutManager.currentSetIndex ? .green :
.frame(width: 8, height: 8) i == workoutManager.currentSetIndex ? .cyan : .gray.opacity(0.4))
Text("\(i + 1). \(set.stroke)") .frame(width: 8, height: 8)
.font(.caption) Text("\(i + 1). \(set.stroke)")
.foregroundColor(i <= workoutManager.currentSetIndex ? .primary : .secondary) .font(.caption)
Spacer() .foregroundColor(i <= workoutManager.currentSetIndex ? .primary : .secondary)
Text("\(set.repCount)x\(set.distancePerRep)m") Spacer()
.font(.caption2) Text("\(set.repCount)x\(set.distancePerRep)m")
.foregroundColor(.secondary) .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)
}
}
} }
} }
} }
+20 -7
View File
@@ -26,13 +26,26 @@ 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
HStack { VStack(alignment: .leading, spacing: 2) {
Text("\(i + 1). \(set.stroke)") HStack {
.font(.body) Text("\(i + 1). \(set.stroke)")
Spacer() .font(.body)
Text("\(set.repCount)x\(set.distancePerRep)m") Spacer()
.font(.caption) Text("\(set.repCount)x\(set.distancePerRep)m")
.foregroundColor(.secondary) .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)
}
}
} }
} }
} }