Preview the next exercise and count into each set during rests

The run flow's between-exercise rest now previews the next exercise — its
figure and a large "Coming up" name — and the hands-free narration gains a
per-second count-in ("<Exercise>, in 1, 2, 3, GO!") spoken before every set,
plus a "Coming up" announcement as a between-exercise rest begins. A new
Settings > Narration picker chooses the count-in cues, the setup/form read,
or both.

Also fixes spoken cues going silent after the first exercise in a flow split:
the stop-on-teardown moved from the per-exercise view (rebuilt on every
hand-off) to the run host, which stays mounted for the whole run. The audio
session now holds its duck across the per-second count so background music
doesn't pulse between words.

Claude-Session: https://claude.ai/code/session_01BQcEWmAPA78338QuEwRkAh
This commit is contained in:
2026-07-10 09:38:45 -04:00
parent bce2bf7539
commit 8b20d7ad08
7 changed files with 208 additions and 35 deletions
+29
View File
@@ -112,6 +112,35 @@ enum SpeechSettings {
}
}
/// What the automatic workout narration says while a flow-mode split runs, chosen in
/// Settings (only meaningful when "Speak Exercise Cues" is on). Stored as its raw string
/// under `spokenCueStyle`, read by both the Settings picker and the run flow.
enum SpokenCueStyle: String, CaseIterable, Identifiable {
/// "Coming up, <exercise>" during the rest, then "in 1, 2, 3, GO!" before each set.
case cues
/// Reads each exercise's setup & form script aloud when it starts (the original behavior).
case instructions
/// Both the concise coming-up/countdown cues plus the setup & form read.
case both
var id: String { rawValue }
/// Picker label.
var displayName: String {
switch self {
case .cues: "Coming Up & Countdown"
case .instructions: "Setup & Form Read"
case .both: "Both"
}
}
/// Whether this style speaks the concise "coming up" / "1, 2, 3, GO!" cues.
var speaksCues: Bool { self == .cues || self == .both }
/// Whether this style reads each exercise's setup & form script on start.
var readsInstructions: Bool { self == .instructions || self == .both }
}
private extension AVSpeechSynthesisVoiceQuality {
/// Orders the quality tiers for "best available" selection and picker sorting.
var rank: Int {