Skip to content

feat: Add settings button and auto-next toggle to puzzle streak (#1296)#2615

Open
DejoeNithin wants to merge 2 commits intolichess-org:mainfrom
DejoeNithin:add_settings_in_puzzle_streak
Open

feat: Add settings button and auto-next toggle to puzzle streak (#1296)#2615
DejoeNithin wants to merge 2 commits intolichess-org:mainfrom
DejoeNithin:add_settings_in_puzzle_streak

Conversation

@DejoeNithin
Copy link
Copy Markdown
Contributor

closes #1296

Screenrecorder-2026-02-04-21-45-55-14.mp4

@DejoeNithin DejoeNithin force-pushed the add_settings_in_puzzle_streak branch from 87c7222 to 5820bd2 Compare February 4, 2026 16:39
@DejoeNithin
Copy link
Copy Markdown
Contributor Author

@tom-anders @veloce @ijm8710 @ghost can you check demo video ?

@DejoeNithin DejoeNithin force-pushed the add_settings_in_puzzle_streak branch from 5820bd2 to ea89961 Compare February 4, 2026 17:06
@DejoeNithin
Copy link
Copy Markdown
Contributor Author

@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 test/view/puzzle/streak_screen_test.dart:"StreakScreen Score is saved when exiting screen" to fail.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +164 to +167
final autoNext = ref.read(puzzlePreferencesProvider).autoNext;
if (autoNext) {
ref.read(puzzleStreakControllerProvider.notifier).next();
}
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +164 to +167
final autoNext = ref.read(puzzlePreferencesProvider).autoNext;
if (autoNext) {
ref.read(puzzleStreakControllerProvider.notifier).next();
}
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@veloce
Copy link
Copy Markdown
Contributor

veloce commented Feb 21, 2026

@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 test/view/puzzle/streak_screen_test.dart:"StreakScreen Score is saved when exiting screen" to fail.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the "immediately go to the next puzzle" toggle in puzzle streak

3 participants