Revert "iOS 27 compat: VMA test — rendre startKmh éditable au lieu de figé à 8"

This reverts commit 263a8f694f.
This commit is contained in:
Sylvain Bettinelli
2026-09-20 15:54:35 +00:00
parent 263a8f694f
commit e6cdc67451

View File

@@ -30,11 +30,9 @@ struct VmaTestView: View {
@StateObject private var workout = WorkoutManager.shared @StateObject private var workout = WorkoutManager.shared
@Environment(\.dismiss) private var dismiss @Environment(\.dismiss) private var dismiss
// Paramètres du protocole à paliers. // Paramètres du protocole à paliers. Départ volontairement bas : la marche
// ⚠️ startKmh n'a plus de défaut : l'utilisateur doit saisir la vitesse // rapide est à 6 km/h, un départ à 8 laisse une vraie marge de montée.
// de sa bande sonore réelle. Le web a retiré le défaut 8 km/h le 2026-08-25 private let startKmh = 8.0
// parce qu'il ne correspond à aucun protocole publié (VAMEVAL/Léger 1988
// démarrent à 8,5) et sous-estime la VMA de 0,5 km/h.
private let stepKmh = 0.5 private let stepKmh = 0.5
private let stageSeconds = 60.0 private let stageSeconds = 60.0
@@ -42,8 +40,6 @@ struct VmaTestView: View {
@State private var started = false @State private var started = false
@State private var finished = false @State private var finished = false
@State private var stageIndex = 0 // 0 = premier palier en cours @State private var stageIndex = 0 // 0 = premier palier en cours
@State private var startKmh = 0.0 // Saisi par l'utilisateur, jamais un défaut
@State private var startKmhText = "" // Liaison TextField
@State private var maxHr = 0.0 @State private var maxHr = 0.0
@State private var sent = false @State private var sent = false
@State private var sendError: String? @State private var sendError: String?
@@ -91,24 +87,9 @@ struct VmaTestView: View {
.font(.caption2) .font(.caption2)
.foregroundStyle(.secondary) .foregroundStyle(.secondary)
// Champ de saisie vitesse de départ, visible seulement pour le protocole à paliers
if proto == .stages {
VStack(alignment: .leading, spacing: 6) {
Text("Vitesse de départ (km/h)")
.font(.caption2)
.foregroundStyle(.secondary)
TextField("ex. 8,5", text: $startKmhText)
.keyboardType(.decimalPad)
.onChange(of: startKmhText) { newValue in
startKmh = Double(newValue) ?? 0.0
}
}
}
Button("Démarrer") { start() } Button("Démarrer") { start() }
.buttonStyle(.borderedProminent) .buttonStyle(.borderedProminent)
.tint(.orange) .tint(.orange)
.disabled(proto == .stages && startKmh <= 0)
} }
.padding(.horizontal, 4) .padding(.horizontal, 4)
} }