Skip to content

implement puzzle navigation#2975

Merged
veloce merged 7 commits into
lichess-org:mainfrom
HaonRekcef:puzzle-nav
Apr 25, 2026
Merged

implement puzzle navigation#2975
veloce merged 7 commits into
lichess-org:mainfrom
HaonRekcef:puzzle-nav

Conversation

@HaonRekcef

@HaonRekcef HaonRekcef commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

closes: #2428
Implements the puzzle navigation feature, that has been requested a lot in the forums.
I tried to make the code as robust as possible against race conditions ( which could happen f.ex. if the user makes a wrong correct move and then immediately rewinds)

Video:

Screen_recording_20260413_211127.mp4

Implements a test aswell

onLongPressCancel: _onPressEnd,
onLongPressUp: _onPressEnd,
child: widget.child,
return MergeSemantics(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Needed to pass the accessibility test. Merges the semantics of the children.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds in-game move history navigation for puzzles (previous/next) and updates UI/controller logic to support safe navigation during play.

Changes:

  • Enable Previous/Next navigation controls in puzzle bottom bar during play.
  • Adjust board interactivity and hint/solution availability when the user is navigating history.
  • Add a widget test covering back/forward navigation during puzzle play.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
test/view/puzzle/puzzle_screen_test.dart Adds a widget test validating back/forward history navigation during play.
lib/src/widgets/buttons.dart Wraps RepeatButton with semantics merge (and affects gesture behavior).
lib/src/view/puzzle/puzzle_screen.dart Exposes Previous/Next buttons outside view mode and disables actions while “in history”.
lib/src/model/puzzle/puzzle_controller.dart Updates move application/rewind logic and relaxes canGoNext/canGoBack for play-mode navigation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/src/model/puzzle/puzzle_controller.dart Outdated
Comment thread lib/src/model/puzzle/puzzle_controller.dart
Comment thread lib/src/model/puzzle/puzzle_controller.dart
Comment thread lib/src/view/puzzle/puzzle_screen.dart
Comment thread lib/src/widgets/buttons.dart Outdated
@veloce

veloce commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

The feature I fought hard not to include... but admitely I lost the battle 😅

Thanks for the implementation, will review asap.

@veloce

veloce commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

UI feedback: we should not mix buttons with and without labels in the bottom bar.

So please remove the labels (but be sure to include semantics and tooltips).

@ijm8710

ijm8710 commented Apr 14, 2026

Copy link
Copy Markdown

UI feedback: we should not mix buttons with and without labels in the bottom bar.

So please remove the labels (but be sure to include semantics and tooltips).

Veloce, Your logic def makes sense to either all have labels or have no labels...

Any chance to encourage you in the reverse direction then? For comparison, studies already have labels for back and next. I don't think the two buttons that were there previously are always immediately known what they do.

@veloce

veloce commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

From what I see in the video, when too many buttons labels are truncated. Even more true in verbose languages, so it is easier with not labels.

@HaonRekcef

Copy link
Copy Markdown
Collaborator Author
Screen_recording_20260415_132410.webm

I removed the labels and changed the icons because the combination of i and ? was not understandable.

We could also use different icons than the ones I choose now:

Hint: ? or lightbulb

Solution: Key, Eye or flag

Maybe we should also change the view solution icon in studies to the same we choose in Puzzles.

@ijm8710

ijm8710 commented Apr 15, 2026

Copy link
Copy Markdown

I don't hate the light bulb but I definitely don't like the flag since it's already associate with resigning

Perhaps keep question mark for hint and lightbulb for solution?

Or if we want to keep lightbulb for hint I would use either an eye or a target/bullseye for solution

@veloce

veloce commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

I like the lightbulb and the flag. Flag makes sense cause in a way if you want to see the solution it is like resigning, isn't it?

@HaonRekcef

Copy link
Copy Markdown
Collaborator Author

That was my logic too.
So should we change the ? in the studies to a flag icon too?

@HaonRekcef

Copy link
Copy Markdown
Collaborator Author

Adjusted the icon for learn from mistakes and studies now.

@veloce veloce left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@veloce veloce merged commit 6d73bc5 into lichess-org:main Apr 25, 2026
1 check passed
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.

Puzzles computer’s First Move Plays Too Fast and Does Not Show Which Piece Was Taken

4 participants