houserules/packages
Joey Yakimowich-Payne 4b6306fb57
feat(chess): lobby + URL-shareable starting layouts (Phase D)
Wires the starting-layout picker into the lobby UI. Users can now:
- Pick a premade (Classic / Dunsany / Monster / Pawns-Only / Horde /
  Knightmate / Chess960 / Empty) from the Host Game section.
- Paste a shareable link (?layoutId=dunsany or ?fen=<encoded>) to
  pre-select a layout when arriving at the lobby.
- See the selected layout's name as a purple badge on the game view
  header next to the room code (hidden for Classic, the default).

Components:
- ui/LayoutPicker.tsx: dropdown reading LAYOUT_REGISTRY. Chess960
  re-seeds on each selection. Custom... entry can be wired to the
  editor modal in Phase E.
- ui/Lobby.tsx: LayoutPicker above Create Room, URL-param reader
  for ?layoutId / ?fen / ?name (validated via validateLayout —
  malformed links silently fall back to Classic).
- ui/GameView.tsx: new LayoutBadge (inline) reads sessionStorage
  'layout-name' written by Lobby on create/join.

Networking:
- net/types.ts: LayoutRequest discriminated union, PiecePlacementWire,
  ResolvedLayoutWire added; RoomCreate/RoomCreated/RoomJoined
  payloads now carry optional 'layout' fields mirroring the server.
- net/lobby-request.ts: OneShotRoomResult returns the resolved
  layout from room.created / room.joined when the server echoes it.

Persistence:
- persist/autosave.ts: keyed-by-layout storage slots
  (paratype-chess:v2:autosave:${layoutId}). One-time migration moves
  the legacy v1 key into the classic slot so existing FIDE saves
  survive. New clearAllAutoSaves wipes every layout slot; used by
  Lobby when starting a fresh game.

1011 tests passing; bun run check clean. Manual smoke pending.
2026-04-18 20:07:25 -06:00
..
chess feat(chess): lobby + URL-shareable starting layouts (Phase D) 2026-04-18 20:07:25 -06:00
rete fix(rete): inject clock into EventLog; use tsc for DTS; fix cycle.test.ts private access; add Playwright worker limit 2026-04-16 18:25:49 -06:00
server feat(server): layout-aware room.create + resolved layout echoes (Phase C) 2026-04-18 20:01:01 -06:00