feat: Add settings button and auto-next toggle to puzzle streak (#1296)#2615
feat: Add settings button and auto-next toggle to puzzle streak (#1296)#2615DejoeNithin wants to merge 2 commits intolichess-org:mainfrom
Conversation
87c7222 to
5820bd2
Compare
|
@tom-anders @veloce @ijm8710 @ghost can you check demo video ? |
5820bd2 to
ea89961
Compare
|
@veloce @tom-anders streak score only increments after clicking "Next Puzzle" when autoNext is off, but the test expects it to go up immediately when solved. Which should it be? This is causing the test |
There was a problem hiding this comment.
Pull request overview
This pull request adds a settings button and auto-next toggle to the puzzle streak feature, matching functionality available on the Lichess website. The PR allows users to choose whether to immediately advance to the next puzzle after winning, or to pause and analyze the puzzle before continuing.
Changes:
- Added a settings button to the streak screen app bar that opens a bottom sheet with puzzle preferences
- Implemented auto-next toggle that controls whether the streak automatically advances to the next puzzle after a win
- Refactored the scaffold structure to consistently show the settings button across different loading states
- Modified the bottom bar to show review mode buttons (share, analysis, previous/next, continue) when auto-next is disabled and a puzzle is won
- Added "smart auto-advance" feature: when enabling auto-next while a puzzle is already won, it immediately advances to the next puzzle
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| final autoNext = ref.read(puzzlePreferencesProvider).autoNext; | ||
| if (autoNext) { | ||
| ref.read(puzzleStreakControllerProvider.notifier).next(); | ||
| } |
There was a problem hiding this comment.
The comment in puzzle_preferences.dart states that autoNext has "no effect on puzzle streaks, which always show next puzzle." However, this PR now makes autoNext affect puzzle streaks. The comment in puzzle_preferences.dart (lines 51-53) should be updated to reflect this new behavior, indicating that autoNext now applies to puzzle streaks as well.
| final autoNext = ref.read(puzzlePreferencesProvider).autoNext; | ||
| if (autoNext) { | ||
| ref.read(puzzleStreakControllerProvider.notifier).next(); | ||
| } |
There was a problem hiding this comment.
The existing test at line 73-74 expects the next puzzle to load automatically after winning, but with this change, the default behavior is now autoNext = false. This test will fail because it expects auto-next behavior but the default is now to NOT automatically advance. The test needs to be updated to either set autoNext = true in the test setup, or manually trigger the next puzzle.
We should maintain the logic that the score is updated on the next screen I think, visually at least. Because, of course, if you exit the screen before tapping "next" the good score should be saved. |
closes #1296
Screenrecorder-2026-02-04-21-45-55-14.mp4