diff --git a/.ideai/sprints/abc4f969-b169-45f7-988c-daeeab762201/sprint.md b/.ideai/sprints/abc4f969-b169-45f7-988c-daeeab762201/sprint.md new file mode 100644 index 0000000..403050e --- /dev/null +++ b/.ideai/sprints/abc4f969-b169-45f7-988c-daeeab762201/sprint.md @@ -0,0 +1,11 @@ +--- +id: "abc4f969-b169-45f7-988c-daeeab762201" +order: 1 +name: "Bug resolution" +status: "planned" +createdBy: {"kind":"user"} +updatedBy: {"kind":"user"} +createdAt: 1784329015766 +updatedAt: 1784329015766 +version: 1 +--- diff --git a/.ideai/sprints/index.json b/.ideai/sprints/index.json index 5fb5e1b..c12a843 100644 --- a/.ideai/sprints/index.json +++ b/.ideai/sprints/index.json @@ -1,4 +1,14 @@ { "version": 1, - "sprints": [] + "sprints": [ + { + "id": "abc4f969-b169-45f7-988c-daeeab762201", + "path": "abc4f969-b169-45f7-988c-daeeab762201", + "order": 1, + "name": "Bug resolution", + "status": "planned", + "updatedAt": 1784329015766, + "version": 1 + } + ] } \ No newline at end of file diff --git a/.ideai/tickets/24/carnet.md b/.ideai/tickets/24/carnet.md index 5550653..fbc952e 100644 --- a/.ideai/tickets/24/carnet.md +++ b/.ideai/tickets/24/carnet.md @@ -1,6 +1,6 @@ --- issueRef: "#24" -version: 3 +version: 5 updatedBy: {"kind":"user"} -updatedAt: 1784328229518 +updatedAt: 1784329025027 --- diff --git a/.ideai/tickets/24/issue.md b/.ideai/tickets/24/issue.md index 1268ae7..0817701 100644 --- a/.ideai/tickets/24/issue.md +++ b/.ideai/tickets/24/issue.md @@ -1,16 +1,16 @@ --- id: "3dbea39a-1466-47d9-b12a-95a601ec287d" number: 24 -title: "Popup \"Exercie ajouté\" qui ne s'enlève pas quand on ajoute un exercice" +title: "[Bug] Popup \"Exercie ajouté\" qui ne s'enlève pas quand on ajoute un exercice" status: "open" priority: "high" -sprint: null +sprint: "abc4f969-b169-45f7-988c-daeeab762201" links: [] agentRefs: [{"agentId":"57695b92-24d0-4876-837c-76116e70a6ae","role":"assigned"}] createdBy: {"kind":"user"} updatedBy: {"kind":"user"} createdAt: 1784328185359 -updatedAt: 1784328229518 -version: 3 +updatedAt: 1784329025027 +version: 5 --- Quand j'ajoute un exercice, la popup "Exercie ajouté" s'affiche mais ne s'enleve pas. Il faudrait qu'elle s'enleve au bout que 3 sec par exemple ou si on appuie sur Personnlaiser \ No newline at end of file diff --git a/.ideai/tickets/29/carnet.md b/.ideai/tickets/29/carnet.md index b479c87..e3fa684 100644 --- a/.ideai/tickets/29/carnet.md +++ b/.ideai/tickets/29/carnet.md @@ -1,6 +1,6 @@ --- issueRef: "#29" -version: 3 +version: 5 updatedBy: {"kind":"user"} -updatedAt: 1784328670579 +updatedAt: 1784329025027 --- diff --git a/.ideai/tickets/29/issue.md b/.ideai/tickets/29/issue.md index a5a85b8..30355a4 100644 --- a/.ideai/tickets/29/issue.md +++ b/.ideai/tickets/29/issue.md @@ -1,16 +1,16 @@ --- id: "89da284b-871c-4e5b-9bfa-ab16f386ba8f" number: 29 -title: "[Bug] Serie qu'on ne peut pas temriner" +title: "[Bug] Serie qu'on ne peut pas terminer" status: "open" priority: "critical" -sprint: null +sprint: "abc4f969-b169-45f7-988c-daeeab762201" links: [] agentRefs: [] createdBy: {"kind":"user"} updatedBy: {"kind":"user"} createdAt: 1784328426827 -updatedAt: 1784328670579 -version: 3 +updatedAt: 1784329025027 +version: 5 --- Dans un programme j'ai un exercice qui se compose de 3 series, une mesure a suivre de temps, de répétition et un score. J'ai mis le temps cible à 30, le nombre de répétition à 5. Une fois dans ma séance, je suis sur la série 2/3, temps indiqué à 30 s, j'ai mis Répétitions sur 3 et score sur 5, mais quand je clique sur temriner la série, rien ne se passe \ No newline at end of file diff --git a/.ideai/tickets/31/carnet.md b/.ideai/tickets/31/carnet.md index 1650265..ad6dc0c 100644 --- a/.ideai/tickets/31/carnet.md +++ b/.ideai/tickets/31/carnet.md @@ -1,6 +1,13 @@ --- issueRef: "#31" -version: 1 +version: 6 updatedBy: {"kind":"user"} -updatedAt: 1784328786412 +updatedAt: 1784329025027 --- +Décision UX : la flèche de retour doit ouvrir le même état Pause que le bouton "Pause" actuel (pas de "Quitter et sauvegarder" direct, pas de désactivation). + +Comportement attendu : +- Tap flèche retour (AppBar leading explicite, pas la flèche Material implicite) pendant état active ou rest : appelle la même logique que _pause (arrête/suspend le repos si nécessaire, persiste la séance en pause, affiche l'écran Pause). +- Tap retour système Android (PopScope/WillPopScope) : même comportement, pas seulement la flèche AppBar. +- Depuis l'écran Pause : choix explicite Reprendre / Quitter et sauvegarder / Abandonner la séance (inchangé). +- Tooltip/accessibility label : "Mettre en pause". Ne pas utiliser le libellé "Retour". \ No newline at end of file diff --git a/.ideai/tickets/31/issue.md b/.ideai/tickets/31/issue.md index bbbaf10..7a3b301 100644 --- a/.ideai/tickets/31/issue.md +++ b/.ideai/tickets/31/issue.md @@ -2,14 +2,15 @@ id: "2f55c804-65e7-465a-9296-f66dd6db684a" number: 31 title: "[Bug] Fleche retour non fonctionnelle dans une seance en cours" -status: "open" +status: "inProgress" priority: "high" -sprint: null +sprint: "abc4f969-b169-45f7-988c-daeeab762201" links: [] -agentRefs: [] +agentRefs: [{"agentId":"9933c93a-b8a1-4164-a3bb-7063fdad747d","role":"assigned"}] createdBy: {"kind":"user"} updatedBy: {"kind":"user"} createdAt: 1784328786412 -updatedAt: 1784328786412 -version: 1 +updatedAt: 1784329025027 +version: 6 --- +Je suis dans une séance, et le bouton de retour en haut à gauche ne fonctionne pas, je dois faire pause et abandonner ou quitter et sauvegarder pour sortir. Demander à UX l'action que doit produire cette fleche de retour \ No newline at end of file diff --git a/.ideai/tickets/32/carnet.md b/.ideai/tickets/32/carnet.md new file mode 100644 index 0000000..4f0e5ed --- /dev/null +++ b/.ideai/tickets/32/carnet.md @@ -0,0 +1,6 @@ +--- +issueRef: "#32" +version: 4 +updatedBy: {"kind":"user"} +updatedAt: 1784329025027 +--- diff --git a/.ideai/tickets/32/issue.md b/.ideai/tickets/32/issue.md new file mode 100644 index 0000000..b17fca5 --- /dev/null +++ b/.ideai/tickets/32/issue.md @@ -0,0 +1,16 @@ +--- +id: "a3fe5103-8b5c-4cce-80af-f1dd08b76794" +number: 32 +title: "[Bug] Reprendre séance en cours pas toujours affiché" +status: "open" +priority: "medium" +sprint: "abc4f969-b169-45f7-988c-daeeab762201" +links: [] +agentRefs: [{"agentId":"57695b92-24d0-4876-837c-76116e70a6ae","role":"assigned"}] +createdBy: {"kind":"user"} +updatedBy: {"kind":"user"} +createdAt: 1784328903547 +updatedAt: 1784329025027 +version: 4 +--- +Si je quitte une seance en cours, pour voir le bandeau de reprise de seance s'afficher je dois quitter totalement l'application et la relancer. J'aimerais qu'il y soit automatiquement quand une séance et en cours et que je ne suis pas dans ma séance \ No newline at end of file diff --git a/.ideai/tickets/33/carnet.md b/.ideai/tickets/33/carnet.md new file mode 100644 index 0000000..aafa58e --- /dev/null +++ b/.ideai/tickets/33/carnet.md @@ -0,0 +1,6 @@ +--- +issueRef: "#33" +version: 1 +updatedBy: {"kind":"user"} +updatedAt: 1784329082771 +--- diff --git a/.ideai/tickets/33/issue.md b/.ideai/tickets/33/issue.md new file mode 100644 index 0000000..0f86f42 --- /dev/null +++ b/.ideai/tickets/33/issue.md @@ -0,0 +1,15 @@ +--- +id: "a588ff04-9e55-4492-ac76-5298ba94e5c7" +number: 33 +title: "[Bug] Impossible de lancer une seance" +status: "open" +priority: "critical" +sprint: null +links: [] +agentRefs: [] +createdBy: {"kind":"user"} +updatedBy: {"kind":"user"} +createdAt: 1784329082771 +updatedAt: 1784329082771 +version: 1 +--- diff --git a/.ideai/tickets/counter.json b/.ideai/tickets/counter.json index 5981494..f1a21b0 100644 --- a/.ideai/tickets/counter.json +++ b/.ideai/tickets/counter.json @@ -1,3 +1,3 @@ { - "nextNumber": 32 + "nextNumber": 34 } \ No newline at end of file diff --git a/.ideai/tickets/index.json b/.ideai/tickets/index.json index 057ee58..27e1aa8 100644 --- a/.ideai/tickets/index.json +++ b/.ideai/tickets/index.json @@ -266,14 +266,14 @@ { "issueRef": "#24", "path": "24", - "title": "Popup \"Exercie ajouté\" qui ne s'enlève pas quand on ajoute un exercice", + "title": "[Bug] Popup \"Exercie ajouté\" qui ne s'enlève pas quand on ajoute un exercice", "status": "open", "priority": "high", - "sprint": null, + "sprint": "abc4f969-b169-45f7-988c-daeeab762201", "assignedAgentIds": [ "57695b92-24d0-4876-837c-76116e70a6ae" ], - "updatedAt": 1784328229518 + "updatedAt": 1784329025027 }, { "issueRef": "#25", @@ -326,12 +326,12 @@ { "issueRef": "#29", "path": "29", - "title": "[Bug] Serie qu'on ne peut pas temriner", + "title": "[Bug] Serie qu'on ne peut pas terminer", "status": "open", "priority": "critical", - "sprint": null, + "sprint": "abc4f969-b169-45f7-988c-daeeab762201", "assignedAgentIds": [], - "updatedAt": 1784328670579 + "updatedAt": 1784329025027 }, { "issueRef": "#30", @@ -347,11 +347,35 @@ "issueRef": "#31", "path": "31", "title": "[Bug] Fleche retour non fonctionnelle dans une seance en cours", - "status": "open", + "status": "inProgress", "priority": "high", + "sprint": "abc4f969-b169-45f7-988c-daeeab762201", + "assignedAgentIds": [ + "9933c93a-b8a1-4164-a3bb-7063fdad747d" + ], + "updatedAt": 1784329025027 + }, + { + "issueRef": "#32", + "path": "32", + "title": "[Bug] Reprendre séance en cours pas toujours affiché", + "status": "open", + "priority": "medium", + "sprint": "abc4f969-b169-45f7-988c-daeeab762201", + "assignedAgentIds": [ + "57695b92-24d0-4876-837c-76116e70a6ae" + ], + "updatedAt": 1784329025027 + }, + { + "issueRef": "#33", + "path": "33", + "title": "[Bug] Impossible de lancer une seance", + "status": "open", + "priority": "critical", "sprint": null, "assignedAgentIds": [], - "updatedAt": 1784328786412 + "updatedAt": 1784329082771 } ] } \ No newline at end of file diff --git a/lib/presentation/workout_execution_screen.dart b/lib/presentation/workout_execution_screen.dart index 78d8f37..351bc73 100644 --- a/lib/presentation/workout_execution_screen.dart +++ b/lib/presentation/workout_execution_screen.dart @@ -78,8 +78,17 @@ final class _WorkoutExecutionScreenState extends State { Widget build(BuildContext context) { return PopScope( canPop: false, + onPopInvoked: _handleSystemBack, child: Scaffold( appBar: AppBar( + automaticallyImplyLeading: false, + leading: _canPauseFromNavigation + ? IconButton( + tooltip: 'Mettre en pause', + onPressed: () => unawaited(_pause()), + icon: const Icon(Icons.arrow_back), + ) + : null, title: Text(_plan.name), actions: [ IconButton( @@ -263,6 +272,16 @@ final class _WorkoutExecutionScreenState extends State { ); } + bool get _canPauseFromNavigation { + return _mode == WorkoutExecutionMode.active || + _mode == WorkoutExecutionMode.rest; + } + + void _handleSystemBack(bool didPop) { + if (didPop || !_canPauseFromNavigation) return; + unawaited(_pause()); + } + Future _pause() async { _restTicker?.cancel(); _session = await widget.activeUseCases.pause(_session.metadata.id); diff --git a/test/presentation/workout_execution_screen_test.dart b/test/presentation/workout_execution_screen_test.dart index 45b4f31..83e3910 100644 --- a/test/presentation/workout_execution_screen_test.dart +++ b/test/presentation/workout_execution_screen_test.dart @@ -218,6 +218,47 @@ void main() { expect(repository.results.single.actualTimeMs, greaterThan(0)); }); + testWidgets('la flèche de retour met la séance active en pause', ( + tester, + ) async { + final clock = _FakeClock(DateTime.utc(2026, 7, 17, 12)); + final repository = _FakeActiveSessionRepository(); + final session = ActiveWorkoutSession( + metadata: _metadata('session-1'), + sourceWorkoutTemplateId: 'template-1', + status: ActiveWorkoutStatus.running, + startedAt: DateTime.utc(2026, 7, 17, 12), + lastPersistedAt: DateTime.utc(2026, 7, 17, 12), + elapsedActiveMs: 0, + currentProgramIndex: 0, + currentExerciseIndex: 0, + currentSetIndex: 0, + resolvedTemplateSnapshotJson: _sessionSnapshot( + setsCount: 2, + restSeconds: 0, + ), + ); + repository.session = session; + + await tester.pumpWidget( + MaterialApp( + home: WorkoutExecutionScreen( + initialSession: session, + activeUseCases: _activeUseCases(repository, clock), + closeUseCase: _closeUseCase(repository, clock), + historyUseCases: _historyUseCases(clock), + workoutTemplateUseCases: _workoutTemplateUseCases(), + ), + ), + ); + + await tester.tap(find.byTooltip('Mettre en pause')); + await tester.pumpAndSettle(); + + expect(find.text('Reprendre'), findsOneWidget); + expect(repository.session?.status, ActiveWorkoutStatus.paused); + }); + testWidgets('le plan de séance affiche les états des séries', (tester) async { final clock = _FakeClock(DateTime.utc(2026, 7, 17, 12)); final repository = _FakeActiveSessionRepository();