Skip to content

Feat(UI): reusable fen chessboard - #15

Open
rmentos wants to merge 5 commits into
mainfrom
feat(ui)-reusable-fen-chessboard
Open

rmentos wants to merge 5 commits into
mainfrom
feat(ui)-reusable-fen-chessboard

Conversation

@rmentos

@rmentos rmentos commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Resolves #10: Create a reusable chessboard component with FEN support and legal move handling.

Added/Updated files:

  • src/components/chess/Chessboard-component.tsx - Reusable chessboard UI with piece rendering, board orientation, square selection, legal move highlights, last-move highlights, and disabled state.
  • src/components/chess/useChessGame.ts - Chess game state and move handling using chess.js.
  • test/chessboard.test.tsx - Tests for chessboard rendering, move handling, orientation, highlighting, disabled state, and invalid FEN handling.
  • app/(app)/play-game.tsx - Integrates the reusable chessboard into the game screen and removes obsolete board styles.

Also added comments and applied Prettier formatting to the relevant code.

Screenshots

Chessboard in the game screen
correctrendering

Optional Rank/File labels
optionallabels

Move selection and previous move highlighting
lastmovehighlighting

Invalid FEN
invalid fen

Move Callback
movecallback

Tests

Run the chessboard tests with:
`npm test -- chessboard.test.tsx'
with the result being
tests

@rmentos
rmentos requested a review from Umar-Azizadah October 10, 2026 20:38
@rmentos rmentos self-assigned this Oct 10, 2026
@rmentos rmentos linked an issue Oct 10, 2026 that may be closed by this pull request
10 of 19 tasks
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.

Chess UI: Build a reusable FEN-based chessboard component

1 participant