Skip to content

Add board wipe and deal-in animations for fresh games - #83

Merged
austin-smith merged 4 commits into
mainfrom
fresh-deal-animations
Jul 17, 2026
Merged

austin-smith merged 4 commits into
mainfrom
fresh-deal-animations

Conversation

@austin-smith

Copy link
Copy Markdown
Owner

What Changed

Every fresh board — New Game, Redeal, Golf's next hole, and game switches that deal fresh — now animates instead of snapping into place:

  • Board wipe: a palm stroke crosses the board left to right; each card stays planted until the accelerating front reaches it, then rides the stroke, piling into a traveling clump that carries the old board off the right edge. Implemented with per-frame catch-and-carry math (GeometryEffect) because endpoint animation cannot produce accumulation.
  • Deal-in flight: cards fly one at a time from the stock to their slots in real dealer order (left-to-right tableau passes, pyramid/peaks top-down, reserve packet first, starter cards last), face-down cards traveling face-down and face-up cards flipping mid-air. Stockless variants (FreeCell, Yukon) deal from an invisible deck above the board's top edge. The takeoff stagger is budgeted so Klondike's 28 cards and Spider's 54 finish in the same window.

Supporting changes:

  • SolitaireViewModel publishes an explicit BoardDealEvent from fresh deals; restores never set it, so a hydrated board can never replay a deal. The wipe only runs when a mutation actually dealt (Golf's final-hole advance stays on the finished board untouched).
  • CardView seeds its resting tilt at init so overlay stand-ins render pixel-identical to the board from their first frame.
  • Both deal flights share one resolver and one set of pacing constants; everything scales through MotionPolicy (Animation Speed setting and Reduce Motion collapse to instant).
  • Session test helpers (withIsolatedStatsStore, makeViewModel) hoisted into TestSupport, replacing three per-file copies.

Why

Starting a new game was the least animated moment in the app: the old board vanished and the new deal appeared in a single frame, while ordinary draws, undos, and wins all have choreographed flights. The deal ceremony is the moment players see most often.

Validation

  • Full unit suite passes on macOS, including 16 new tests covering the dealer ordering per variant, flight-plan anchors and stagger budget, wipe stroke physics (accelerating front, catch order, clumping, exit span), and the deal event's publish/clear rules.
  • Frame-by-frame simulator verification of the wipe/deal on Klondike, Golf, TriPeaks, and FreeCell; pixel-diff confirmation that the board-to-overlay handoff is seamless; regression check that Spider's mid-game stock deal still shows its queued packet on the stock.
  • A high-effort multi-agent review ran on the diff; all ten verified findings (four visual defects, one race, five cleanups) were fixed and re-validated.

UI Changes

Two new animations on every fresh deal: the old board sweeps off the table under a palm stroke, then the new board deals in card by card from the stock (or from above the board for stockless variants), with sound and haptic at takeoff. Both respect the Animation Speed setting and Reduce Motion.

@cursor

cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e7ce9634a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ComputerSolitaire/Views/Shared/ContentView.swift
@austin-smith

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80c351daf9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ComputerSolitaire/Views/Shared/ContentView.swift
redeal reuses the outgoing game's card ids, so leftover frames from the played-out layout satisfied the deal flight's readiness check and could land cards at their old positions before popping to the redealt spread
@austin-smith

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 016fb0cf0c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@austin-smith
austin-smith merged commit 731bd87 into main Jul 17, 2026
3 checks passed
@austin-smith
austin-smith deleted the fresh-deal-animations branch July 17, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant