chore(wip): lot #165-169 validé QA + rework foreground #163 (KO - preuve device/toolchain insuffisante)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-28 17:59:43 +02:00
parent 917777e18b
commit bc533d6c45
32 changed files with 898 additions and 123 deletions

View File

@ -3670,6 +3670,9 @@ final class WatchCompanionCommandHandler implements WatchCommandIngress {
projection.primaryAction == WatchPrimaryAction.resumeSession,
WatchCommandType.startPreparedTimedStep =>
projection.primaryAction == WatchPrimaryAction.startPreparedTimedStep,
WatchCommandType.completeCurrentStep =>
projection.stepType == WatchStepType.reps &&
projection.stepTargetValue != null,
WatchCommandType.skipCurrentStep => projection.secondaryActions.contains(
WatchSecondaryAction.skipCurrentStep,
),
@ -3712,6 +3715,7 @@ final class WatchCompanionCommandHandler implements WatchCommandIngress {
WatchCommandType.startPreparedTimedStep => _startPreparedTimedStep(
session,
),
WatchCommandType.completeCurrentStep => _completeCurrentStep(session),
WatchCommandType.skipCurrentStep => _skipCurrentStep(session),
WatchCommandType.skipCurrentPassage => _skipCurrentPassage(session),
WatchCommandType.finishCurrentSet => _finishCurrentSet(
@ -3776,6 +3780,18 @@ final class WatchCompanionCommandHandler implements WatchCommandIngress {
return WatchCommandAck.accepted;
}
Future<WatchCommandAck> _completeCurrentStep(
ActiveWorkoutSession session,
) async {
await _stepUseCases.completeCurrentStep(
sessionId: session.metadata.id,
programIndex: session.currentProgramIndex,
exerciseIndex: session.currentExerciseIndex,
setIndex: session.currentSetIndex,
);
return WatchCommandAck.accepted;
}
Future<WatchCommandAck> _skipCurrentPassage(
ActiveWorkoutSession session,
) async {
@ -4151,6 +4167,12 @@ final class WatchSessionProjectionProjector {
: (stepState?.currentStepIndex ?? 0) + 1,
stepTotal: snapshot.steps.isEmpty ? null : snapshot.steps.length,
stepName: currentStep?.name,
stepType: switch (currentStep?.type) {
ExerciseStepType.time => WatchStepType.time,
ExerciseStepType.reps => WatchStepType.reps,
null => null,
},
stepTargetValue: currentStep?.defaultTargetValue,
dominantTimer: dominantTimer,
secondaryTimers: secondaryTimers,
primaryAction: _primaryAction(phase),
@ -4389,7 +4411,7 @@ List<WatchSecondaryAction> _secondaryActions({
];
}
String _statusLabel(
String? _statusLabel(
WatchSessionPhase phase,
WatchTimerProjection? dominantTimer,
) {
@ -4401,7 +4423,7 @@ String _statusLabel(
WatchSessionPhase.nextTimerReady => 'Chrono suivant prêt',
WatchSessionPhase.restRunning => 'Repos en cours',
WatchSessionPhase.restPaused => 'Repos en pause',
WatchSessionPhase.betweenSetsReady => 'Prêt pour la série suivante',
WatchSessionPhase.betweenSetsReady => null,
};
}
@ -4502,8 +4524,7 @@ bool _isNextTimerReady(
if (state == null ||
currentStep == null ||
state.status != ActiveExerciseStepProgressStatus.stoppedTimer ||
currentStep.type != ExerciseStepType.time ||
snapshot.autoStartNextTimedStepEffective) {
currentStep.type != ExerciseStepType.time) {
return false;
}
final previous = _previousStep(snapshot, state);