Skip to content

Conversation

@antonryoung02
Copy link
Contributor

Description

I added utils.getPromotionUpdates and utils.pawnPromotesAtSquares to identify promoting moves.

In the animation useEffect I added a condition where the promotion is animated only if positionUpdates doesn't have any pieces to animate and promotionUpdates has one piece to animate. I added these constraints to simplify the problem, because the main benefit of the fix is to animate when only the promotion move is being played or undone. In other cases it can be hard to verify if the promotion actually happened or how you should handle conflicts with positionUpdates.

Fixes #220

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • Verified the animation happens when the engine promotes in Storybook > Options API > animationDurationInMs

I didn't write any unit tests for my logic because I didn't see a test suite to add them to. Let me know if I'm misunderstanding storybook!

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (if appropriate):

Additional context

Add any other context about the pull request here.

@vercel
Copy link

vercel bot commented Nov 1, 2025

@antonryoung02 is attempting to deploy a commit to the Ryan Gregory's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
react-chessboard Ready Ready Preview Comment Nov 12, 2025 11:40pm

@Clariity Clariity merged commit b844916 into Clariity:main Nov 26, 2025
1 check failed
@github-actions
Copy link

🎉 This PR is included in version 5.8.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Promoting moves are not animated

2 participants