The piece`s own z-index could only stack within its grid cell`s context,
so when translated over neighbouring cells it rendered underneath their
pieces. Promote the hosting cell to z-50 while it holds the dragged
piece so the whole cell (and piece inside) float above the board.
Dragging a piece now follows the cursor with spring lag and a subtle tilt,
scales up with a deeper shadow while lifted, and on a valid drop glides
smoothly from the cursor-release position into the destination square.
Invalid drops spring back to the origin. Dragging is disabled entirely
for the non-playing side (no grab cursor, no transforms, no drag events).
Cursor tracking uses a document-level `dragover` listener — the `drag`
event on the source element is throttled by Chromium and reports 0/0 in
Firefox, so is unusable for smooth tracking.
Replaces motion`s `layoutId` FLIP with a manual implementation. Motion
measures layout rects without inline transforms, so `layoutId` always
animated from the source square instead of the cursor position. The new
approach stashes the transformed `getBoundingClientRect` on dragend and
consumes it from a `useLayoutEffect` at mount, jumping the spring to the
delta and letting it animate home — producing a true release-to-target
FLIP.
Each room owns a ChessEngine wrapped in a GameSession; only the server
calls insert/retract/fireRules and all EntityIds are minted server-side.
GameSessionRegistry keys sessions by room code so two rooms cannot
observe or collide with each other's working-memory state.
GameSession.applyMove validates algebraic inputs, finds the matching
legal move via ChessEngine.findMove, applies it, and returns a fact-
level diff (inserted/retracted) plus the new turn and terminal state.
Terminal states are sticky: further moves after checkmate/draw return
GAME_OVER rather than silently mutating a dead session.
Exposes @paratype/chess's headless surface (ChessEngine, coord helpers,
schema types) via a new package entry point; the React app continues to
import concrete modules directly.
Introduces PresetRegistry + three pawn-focused preset rules from
RULES.md (pawns-move-backward, double-pawn-sprint,
pawn-diagonal-no-capture). Presets register themselves via
side-effect imports and expose getExtraMoves/filterMoves hooks for
the ChessEngine to invoke during move generation (engine wiring is
P3.11). Registry enforces incompatibility and requires invariants.
- packages/chess/src/engine.ts — ChessEngine integrates all rule modules
(pawn, knight, sliding, king, castling, en-passant, promotion, check,
checkmate, stalemate, draws) into a playable game without the Rete
production network
- packages/chess/src/pgn.ts — minimal SAN/PGN parser with full
disambiguation support (file/rank hints, full from-square)
- packages/chess/tests/fide-games/classic-games.test.ts — 5 game tests:
Fool's Mate, Scholar's Mate, Ruy López, Sicilian Defence, Italian Game
All 5 tests green; typecheck clean.