Add a new "move on release" board setting#99
Merged
Merged
Conversation
Add `ChessboardSettings.moveOnRelease`: when enabled, a tap-to-move is committed on pointer release instead of pointer press, and a square target follows the finger so the destination can be adjusted before releasing. Closes #93
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an optional “move on release” interaction mode to the interactive chessboard, matching Chess.com-style tap-to-move behavior where the move is committed on pointer/touch release and the intended destination can be adjusted by sliding before lifting.
Changes:
- Add
ChessboardSettings.moveOnReleaseto defer tap-to-move commitment until pointer up. - Update board gesture handling to show a square target that tracks the pointer while the destination is being chosen.
- Add widget tests covering commit-on-release, sliding destination changes, target follower behavior, and invalid release handling.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
lib/src/board_settings.dart |
Introduces moveOnRelease setting with documentation, equality/hash, and copyWith support. |
lib/src/widgets/board.dart |
Implements deferred tap-to-move flow with a follower target and commits on pointer up when enabled. |
test/widgets/board_test.dart |
Adds focused widget tests validating the new move-on-release behavior and visuals. |
example/lib/main.dart |
Adds a demo toggle in the example app to enable/disable move-on-release. |
example/lib/atomic_game_page.dart |
Minor formatting-only adjustment. |
CHANGELOG.md |
Documents the new setting in a 10.2.0 entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
ChessboardSettings.moveOnRelease: when enabled, a tap-to-move is committed on pointer release instead of pointer press, and a square target follows the finger so the destination can be adjusted before releasing.Closes #93