From ee364cc2e29533ed3f80cbd72627ea32e949f55d Mon Sep 17 00:00:00 2001 From: airkjw Date: Thu, 11 Jun 2026 23:11:13 +0900 Subject: [PATCH] fix: dismiss tutorial when the stage ends A finished stage ends the tutorial; otherwise the overlay would sit on top of the result card and leak into the next stage. Co-Authored-By: Claude Sonnet 4.6 --- lib/ui/screens/game_screen.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ui/screens/game_screen.dart b/lib/ui/screens/game_screen.dart index 24a058e..23daf71 100644 --- a/lib/ui/screens/game_screen.dart +++ b/lib/ui/screens/game_screen.dart @@ -147,6 +147,11 @@ class _GameScreenState extends ConsumerState } } if (prev?.phase != next.phase) { + // A finished stage ends the tutorial; otherwise the overlay would sit + // on top of the result card and leak into the next stage. + if (next.phase == GamePhase.won || next.phase == GamePhase.lost) { + ref.read(tutorialProvider.notifier).skip(); + } if (next.phase == GamePhase.won) { audio.play(Sfx.win); // recordResult keeps the best run, so re-entry is harmless.