feat(engine): Phase B home hierarchy — Continue card, hero New Game, deal-options disclosure #175

Merged
funman300 merged 3 commits from feat/home-hierarchy into master 2026-07-13 20:55:38 +00:00
Owner

Implements Phase B of docs/ui-redesign-2026-07.md (decisions 2–4, recorded in the first commit).

What changed

  • Continue card — rendered only while a game is in progress (moves made, not won); shows mode • elapsed • score and returns to the table on click.
  • Hero New Game — one tap replays the persisted Settings::last_mode (new serde-defaulted field) with current deal options; a locked persisted mode falls back to Classic. Card clicks, digit keys, and difficulty chips all persist last_mode (Daily / Play-by-Seed deliberately don't).
  • Deal-options disclosure under the hero: draw 1/3 chips, new winnable-only chip, difficulty tier chips — off the Home top level per decision 2. DifficultyExpanded renamed to DealOptionsExpanded.
  • Compact 2×3 mode grid — descriptions render on wide viewports only; tiles drop to 120 px min-height on narrow.
  • Stats strip moved from header to bottom (right pane on wide); still opens Profile.
  • Two-pane layout on wide viewports (≥ 1000 logical px: desktop, unfolded Fold): hero + grid left; Continue + daily callout + stats right. Added ui_modal::spawn_modal_sized so Home can widen its card to 1080 px — every other modal keeps the 720 px default.
  • Back to table replaces Cancel and only renders while a live game exists (Esc / scrim-tap still dismiss).

Internals

  • New HomeSpawnSources / HomeLaunchWriters SystemParams deduplicate the five respawn call sites and the three launch dispatch surfaces.
  • solitaire_data: Settings.last_mode: GameMode with #[serde(default)] — older settings.json files deserialize to Classic.

Tests

10 new home_plugin tests (Continue gating incl. won-game, hero default/replay/locked-fallback, last_mode persistence, disclosure expand, winnable toggle). Full workspace suite + clippy -D warnings green.

Fold 7 both-postures sweep still pending (tracked with the Phase A–G sweep).

🤖 Generated with Claude Code

Implements Phase B of docs/ui-redesign-2026-07.md (decisions 2–4, recorded in the first commit). ## What changed - **Continue card** — rendered only while a game is in progress (moves made, not won); shows mode • elapsed • score and returns to the table on click. - **Hero New Game** — one tap replays the persisted `Settings::last_mode` (new serde-defaulted field) with current deal options; a locked persisted mode falls back to Classic. Card clicks, digit keys, and difficulty chips all persist `last_mode` (Daily / Play-by-Seed deliberately don't). - **Deal-options disclosure** under the hero: draw 1/3 chips, new winnable-only chip, difficulty tier chips — off the Home top level per decision 2. `DifficultyExpanded` renamed to `DealOptionsExpanded`. - **Compact 2×3 mode grid** — descriptions render on wide viewports only; tiles drop to 120 px min-height on narrow. - **Stats strip** moved from header to bottom (right pane on wide); still opens Profile. - **Two-pane layout** on wide viewports (≥ 1000 logical px: desktop, unfolded Fold): hero + grid left; Continue + daily callout + stats right. Added `ui_modal::spawn_modal_sized` so Home can widen its card to 1080 px — every other modal keeps the 720 px default. - **Back to table** replaces Cancel and only renders while a live game exists (Esc / scrim-tap still dismiss). ## Internals - New `HomeSpawnSources` / `HomeLaunchWriters` SystemParams deduplicate the five respawn call sites and the three launch dispatch surfaces. - `solitaire_data`: `Settings.last_mode: GameMode` with `#[serde(default)]` — older settings.json files deserialize to Classic. ## Tests 10 new home_plugin tests (Continue gating incl. won-game, hero default/replay/locked-fallback, last_mode persistence, disclosure expand, winnable toggle). Full workspace suite + `clippy -D warnings` green. Fold 7 both-postures sweep still pending (tracked with the Phase A–G sweep). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
funman300 added 2 commits 2026-07-13 20:08:56 +00:00
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Restructures the Home overlay per docs/ui-redesign-2026-07.md Phase B:

- Continue card (mode / elapsed / score) when a game is in progress;
  clicking returns to the table
- Hero New Game replays the persisted Settings::last_mode (new field,
  serde-default Classic) with one tap; locked modes fall back to Classic
- Deal options (draw 1/3, winnable-only, difficulty tiers) move into a
  disclosure under the hero — off the Home top level (decision 2)
- Compact symmetric 2x3 mode grid; descriptions on wide viewports only
- Stats strip moves to the bottom (right pane on wide)
- Two-pane body on wide viewports (>= 1000 logical px) via new
  ui_modal::spawn_modal_sized (default card stays 720 px)
- Cancel becomes "Back to table" and only renders while a live
  (un-won) game exists

10 new home_plugin tests; all 936 engine tests + clippy green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
funman300 added 1 commit 2026-07-13 20:11:57 +00:00
style: cargo fmt
Test / test (pull_request) Successful in 37m46s
fc87b13e5b
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
funman300 merged commit f51ee7b234 into master 2026-07-13 20:55:38 +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#175