Repository navigation
chess: premove a recapture onto the viewer's own piece - #463
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
muchq | cc78e20 | Commit Preview URL Branch Preview URL |
Oct 19 2026, 08:16 PM |
Off turn, a tap or drop on a square holding the viewer's own piece always picked that piece up, so the usual capture premove — retaking on a square the opponent is about to capture on — could not be queued. Now it queues when the picked piece covers that square on an empty board, and picks the other piece up otherwise.
aaylward
force-pushed
the
chess-premove-recapture
branch
from
October 19, 2026 20:15
341fc43 to
cc78e20
Compare
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.
Bug
Premoving a capture of an opponent's piece already worked. Premoving a recapture didn't. Off turn, the target square still holds your own piece (the one about to be taken), and a tap or drop there always picked that piece up instead.
Fix
rules.covers(piece, from, to)checks whether the piece can take on that square on an empty board (sliders aren't blocked). Off turn, on your own piece's square:This matches chessground. The hub still decides legality when your turn comes. README updated, since the client now reads piece geometry.
Tests
coversunit tests: each piece type, pawn direction, and moving to its own square.coversforced totrue, both reselect tests fail.