feat(engine): surface upstream move-type counters and replay seek #173

Merged
funman300 merged 1 commits from feat/upstream-stat-counters into master 2026-07-16 23:53:11 +00:00
Owner

Two unused-for-free features from the upstream card_game/klondike crates (follow-up to the #170/#171 serializer work):

Move-type recap on the win modal

GameState now exposes the granular KlondikeStats counters — move_to_foundation_count, move_to_tableau_count, move_from_foundation_count, flip_up_count — all pure delegations to upstream stats that were already being tracked. The win modal shows a quiet recap line under the XP breakdown (e.g. 21 to foundation · 14 tableau moves · 9 flips), zero-valued parts omitted. No sync/schema changes.

Replay seek

ReplayPlayer.seek(step) in the wasm player: clamped jump to any position. Rewinds from a stored copy of the recorded deal and fast-forwards — no JSON reparse, no intermediate renders. The web viewer's Prev button now uses it (previously re-created the whole player in JS and looped). Also the primitive a future scrub-drag UI needs.

Tests: recap builder (fresh game empty, real deal reports played move types, zeros omitted), seek forward/backward equivalence with stepping + end clamping.

Gate: workspace tests green (27 binaries), clippy --all-targets -D warnings clean, rustfmt applied.

🤖 Generated with Claude Code

Two unused-for-free features from the upstream `card_game`/`klondike` crates (follow-up to the #170/#171 serializer work): ## Move-type recap on the win modal `GameState` now exposes the granular `KlondikeStats` counters — `move_to_foundation_count`, `move_to_tableau_count`, `move_from_foundation_count`, `flip_up_count` — all pure delegations to upstream stats that were already being tracked. The win modal shows a quiet recap line under the XP breakdown (e.g. `21 to foundation · 14 tableau moves · 9 flips`), zero-valued parts omitted. No sync/schema changes. ## Replay seek `ReplayPlayer.seek(step)` in the wasm player: clamped jump to any position. Rewinds from a stored copy of the recorded deal and fast-forwards — no JSON reparse, no intermediate renders. The web viewer's Prev button now uses it (previously re-created the whole player in JS and looped). Also the primitive a future scrub-drag UI needs. Tests: recap builder (fresh game empty, real deal reports played move types, zeros omitted), seek forward/backward equivalence with stepping + end clamping. Gate: workspace tests green (27 binaries), clippy `--all-targets -D warnings` clean, rustfmt applied. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
funman300 added 1 commit 2026-07-10 18:07:40 +00:00
Two unused-for-free upstream card_game/klondike features:

- GameState now exposes the granular KlondikeStats counters
  (move_to_foundation_count, move_to_tableau_count,
  move_from_foundation_count, flip_up_count) and the win modal shows a
  quiet per-move-type recap line built from them (e.g. "21 to
  foundation - 14 tableau moves - 9 flips")
- wasm ReplayPlayer gains seek(step): clamped jump to any position,
  rewinding via a stored copy of the recorded deal instead of reparsing
  the replay JSON; replay.js Prev now uses it

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
funman300 merged commit 7f604f5df6 into master 2026-07-16 23:53:11 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#173