Stage 17 round 6 (#4/#5/#6): draft persistence wire + gateway + UI
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 11s
CI / ui (pull_request) Successful in 32s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m7s

Complete the client-side draft feature on top of the shipped backend
foundation (the game_drafts store/service):

- FB: DraftRequest{game_id,json} + DraftView{json} (a draft get reuses
  GameActionRequest); regenerated committed Go + TS bindings.
- Backend REST: GET/PUT /games/:id/draft, a draftDTO
  (rack_order/board_tiles) mapped to game.Draft.
- Gateway: draft.get/draft.save transcode forwarding the composition
  JSON verbatim (json.RawMessage both ways -- no double-encode).
- UI: debounced save of the rack order + board tiles and restore on
  load (lib/draft.ts), plus #5 -- tiles may be arranged on the
  opponent's turn (placement relaxed; the preview and Make-move stay
  your-turn-only, so an off-turn draft is position-only).

Tests: backend handler validation, gateway pass-through round-trip, UI
draft/codec units, and a draft-restore e2e.
This commit is contained in:
Ilia Denisov
2026-06-07 22:25:29 +02:00
parent 353dff20c4
commit f5c2404123
22 changed files with 721 additions and 7 deletions
+14
View File
@@ -236,6 +236,20 @@ table HintResult {
hints_remaining:int;
}
// DraftRequest saves the player's client-side composition for a game (Stage 17): a single
// JSON string of {rack_order, board_tiles} the client serializes itself, so the wire carries
// no tile array. The gateway forwards json verbatim to the backend, which owns its shape.
table DraftRequest {
game_id:string;
json:string;
}
// DraftView returns the player's stored composition as the same opaque JSON string (empty
// when none is stored). A draft get reuses GameActionRequest for its game id.
table DraftView {
json:string;
}
// History is a game's decoded move journal — the source for client board replay.
table History {
game_id:string;