Skip to content

Add animation speed setting - #76

Merged
austin-smith merged 2 commits into
mainfrom
animation-speed-setting
Jul 16, 2026
Merged

austin-smith merged 2 commits into
mainfrom
animation-speed-setting

Conversation

@austin-smith

Copy link
Copy Markdown
Owner

What Changed

  • New Animation Speed setting — Normal / Fast / Instant — at the bottom of the Gameplay settings section on iOS and macOS (shared row; navigation-link picker on iOS, pop-up on macOS).
  • New Animation/MotionPolicy.swift: the speed catalog plus a single policy that scales every gameplay animation and completion delay. The system Reduce Motion setting clamps to instant regardless of the chosen speed.
  • Every gameplay animation routes through the policy: board move springs, tap-move and drag-drop flights, invalid-drop returns, tilt settles, draw and tableau-deal flights, undo flights, card flips, and the drop-target/hint highlights. Each asyncAfter completion scales through the same policy with the same base duration, so flights and their cleanup cannot drift apart.
  • The win celebration deliberately ignores the speed setting — it is a reward, not a wait — but Reduce Motion suppresses it: at win time it presents the settled end state the relaunch path already uses, and a Reduce Motion toggle mid-cascade lands the cards immediately via the same shared path.
  • The hint wiggle keeps its normal pace on Fast (an affordance, not a wait) and is suppressed on Instant; the hint highlight still marks the cards.

Why

Solitaire animations sit directly in the play loop — every draw, move, undo, and auto-finish has a fixed duration the player waits through. Players who play fast want the pace to match, and motion-sensitive players get Reduce Motion honored for the first time, including the full-screen win cascade.

Validation

  • Video frame-diff on the tap-move flight per speed: Normal = 8-frame flight + 12-frame flip (identical rhythm to before), Fast = 4 + 7 frames, Instant = single-frame changes with the move and flip applied and the end state correct.
  • Reduce Motion with the setting on Normal: no motion, confirming the clamp wins over the setting.
  • Draw at Instant: three cards land already fanned, stock count correct, no stranded overlay cards.
  • Live binding: switching to Instant in the settings sheet took effect on the next move without relaunch.
  • Full unit suite on macOS: 559 tests, 0 failures. macOS and iOS builds green; verified interactively in the iOS simulator and the macOS app.

@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.

@austin-smith
austin-smith merged commit 12ecf38 into main Jul 16, 2026
2 checks passed
@austin-smith
austin-smith deleted the animation-speed-setting branch July 16, 2026 02:25
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