add liveDrawArrow and knightArrow options to arrowOptions - #231
Open
Vikrambgs wants to merge 2 commits into
Open
add liveDrawArrow and knightArrow options to arrowOptions #231Vikrambgs wants to merge 2 commits into
Vikrambgs wants to merge 2 commits into
Conversation
|
@Vikrambgs 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. |
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.
Description
This PR adds two new configuration options to arrowOptions inside ChessboardOptions to provide developers with finer control over arrow drawing behavior and rendering style:
liveDrawArrow(boolean, default: true):Controls whether arrow drawing renders a live preview while right-click dragging over squares (true), or delays drawing until the final target square is set upon right-mouse release (false).
knightArrow(boolean, default: true):Controls whether knight moves are rendered as traditional L-shaped arrows (true), or as direct straight arrows connecting start and end squares (false).
Additionally,
ChessboardOptions['arrowOptions']was updated toPartial<typeof defaultArrowOptions>so consumers can supply partialarrowOptionsobjects (e.g.arrowOptions={{ liveDrawArrow: false }}) without TypeScript requiring all default properties.Fixes # N/A
Type of change
[✓] New feature (non-breaking change which adds functionality)
[✓] Documentation update
How Has This Been Tested?
[✓] Static Verification: Ran pnpm run test:static (tsc, eslint, and prettier --check) to ensure 0 TypeScript errors, clean linting, and proper formatting.
[✓] Storybook Integration: Updated
ArrowOptions.stories.tsxwith interactive toggle controls for liveDrawArrow and knightArrow to test toggling options dynamically.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
[✓] New and existing unit tests pass locally with my changes
[✓] Any dependent changes have been merged and published in downstream modules
Screenshots (if appropriate):
N/A
Additional context
Default Behavior Preserved
Both options default to true, maintaining 100% backward compatibility with existing chessboard implementations.