Skip to content

add liveDrawArrow and knightArrow options to arrowOptions - #231

Open
Vikrambgs wants to merge 2 commits into
Clariity:mainfrom
Vikrambgs:feat/arrow-options
Open

add liveDrawArrow and knightArrow options to arrowOptions #231
Vikrambgs wants to merge 2 commits into
Clariity:mainfrom
Vikrambgs:feat/arrow-options

Conversation

@Vikrambgs

Copy link
Copy Markdown
Contributor

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:

  1. 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).

  2. 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 to Partial<typeof defaultArrowOptions> so consumers can supply partial arrowOptions objects (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.tsx with 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.

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

@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.

@Vikrambgs Vikrambgs changed the title Feat/arrow options add liveDrawArrow and knightArrow options to arrowOptions Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant