Skip to content

Add complete playable chess game - #1

Draft
slugmandrew wants to merge 3 commits into
devfrom
agent/playable-chess
Draft

Add complete playable chess game#1
slugmandrew wants to merge 3 commits into
devfrom
agent/playable-chess

Conversation

@slugmandrew

@slugmandrew slugmandrew commented Jul 18, 2026

Copy link
Copy Markdown
Owner

What changed

  • replace the partial movement implementation with standards-compliant gameplay powered by chess.js
  • add check, checkmate, draw detection, castling, en passant, and selectable promotion
  • support both click-to-move and drag-and-drop through the same validated move path
  • add a computer opponent that plays Black with easy, medium, and hard alpha-beta search depths
  • add a visible thinking state, mode-aware input locking, and full-turn undo against the computer
  • constrain the board to its layout column and enforce an 8×8 square grid so the outer rank and file remain visible
  • add move history, captured pieces, undo, reset, legal-move highlights, and a responsive interface
  • migrate from Create React App 4/Webpack 4 to Vite 4 and Vitest
  • replace the generic README and add detailed architecture documentation
  • remove unused prototype files and dependencies

Why

The existing UI rendered a chess board and supported some piece movement, but it did not enforce complete chess rules or reliably support playing a full game. It now supports both same-device play and games against a local computer opponent. The prior viewport-based board width could also overflow beside the information panel, cutting off the outer row and column; the board now sizes within its grid column.

Create React App 4's development server could not parse the public class fields shipped by chess.js 1.0. Vite pre-bundles the dependency with esbuild, resolving that parser failure while modernizing the development and test workflow.

Validation

  • development server: pnpm start served the application and transformed chess.js successfully
  • tests: 11 passing with pnpm test:run
  • test coverage includes computer response flow, forced mate choice, full-turn undo, special chess moves, and click controls
  • strict TypeScript and production build: pnpm build
  • production bundle: 895 modules transformed by Vite 4.5.14
  • diff whitespace validation: git diff --check

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