Fix multi-hop move animation showing only the last segment#188
Merged
Fix multi-hop move animation showing only the last segment#188
Conversation
…e positions Co-authored-by: ProLoser <67395+ProLoser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix multiple moves animation display issue
Fix multi-hop move animation showing only the last segment
Mar 20, 2026
|
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.
When a piece is moved multiple times in one turn (e.g. "6/3 3/1"), the animation overlay only played the final segment instead of all hops.
Root cause
parseMove's cancellation logic removesmoved[point]for intermediate stops — points where a piece both arrives and departs. This is correct for ghost/moved highlighting, butMoveAnimation.tsxrelied solely on.piece.movedelements to locate the animation target, so intermediate destinations had notoEland the segment was silently skipped.Fix
Fall back to
.piece.ghostelements when no.piece.movedis found at the destination. Ghost pieces survive the cancellation and are rendered at every intermediate point, so their DOM position correctly anchors the animation end for that segment.The
toIdxcounter already tracks how many times each point has been visited as a destination, so it correctly indexes into the ghost list for cases like doubles where the same intermediate point is visited multiple times.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.