feat(exécution): clarifie Durée et Temps réalisé, renomme Durée par défaut (s)

Sépare la notion de Durée (paramètre configuré) de Temps réalisé (résultat
mesuré au chronomètre), renomme le champ « Temps par défaut (s) » en
« Durée par défaut (s) » dans la bibliothèque d'exercices, et limite
l'exécution à un seul chrono visible à la fois. Le mode Score chrono est
conservé tel quel comme mode du score.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-28 09:37:44 +02:00
parent 6d86700348
commit e3c7ca0dab
11 changed files with 316 additions and 56 deletions

View File

@ -3559,13 +3559,22 @@ final class WatchSessionProjectionProjector {
final expectedPassages = _expectedPassages(snapshot);
final projectedAtEpochMs = _epochMs(now);
final scoreStopwatchTimer = scoreStopwatch == null
? null
: _scoreStopwatchTimerProjection(scoreStopwatch, now);
final setTimerProjection = setTimer == null
? null
: _setTimerProjection(setTimer, now);
final hideScoreStopwatchTimer = _shouldHideScoreStopwatchForSetTimer(
snapshot: snapshot,
setTimerProjection: setTimerProjection,
);
final timers = <WatchTimerProjection>[
if (activeRest != null) _restTimerProjection(activeRest, now),
if (currentStep != null && currentStep.type == ExerciseStepType.time)
_stepTimerProjection(stepState, currentStep, now),
if (scoreStopwatch != null)
?_scoreStopwatchTimerProjection(scoreStopwatch, now),
if (setTimer != null) ?_setTimerProjection(setTimer, now),
?setTimerProjection,
if (!hideScoreStopwatchTimer) ?scoreStopwatchTimer,
];
final dominantTimer = timers.isEmpty ? null : timers.first;
final secondaryTimers = dominantTimer == null
@ -3846,6 +3855,16 @@ WatchTimerProjection? _setTimerProjection(
);
}
bool _shouldHideScoreStopwatchForSetTimer({
required _ResolvedExerciseSnapshot snapshot,
required WatchTimerProjection? setTimerProjection,
}) {
return snapshot.timeEnabled &&
snapshot.scoreEnabled &&
snapshot.scoreInputModeSnapshot == ScoreInputMode.stopwatch &&
setTimerProjection != null;
}
ExerciseStep? _initialStep(_ResolvedExerciseSnapshot snapshot) {
return snapshot.steps.isEmpty ? null : snapshot.steps.first;
}