Skip to content

Prevent crashes during game variant switches - #65

Merged
austin-smith merged 1 commit into
mainfrom
guard-variant-switch-pile-indices
Jul 14, 2026
Merged

austin-smith merged 1 commit into
mainfrom
guard-variant-switch-pile-indices

Conversation

@austin-smith

Copy link
Copy Markdown
Owner

What Changed

  • Guard FreeCell slots against transient out-of-range state during game switches.
  • Guard foundation piles against transient array shrinkage while the previous board remains mounted.

Why

SwiftUI can re-render a mounted board view after the next game variant's state has replaced its arrays but before the view hierarchy is rebuilt. Fixed-index pile views could therefore subscript arrays that had become smaller and crash.

Validation

  • macOS test suite: 541 tests executed, 10 skipped, 0 failures.
  • git diff --check

UI Changes

No intended visual changes. Transient stale pile views now render nothing until the board hierarchy rebuilds.

@austin-smith
austin-smith marked this pull request as ready for review July 14, 2026 04:13
@austin-smith austin-smith changed the title Guard pile views during variant switches Prevent crashes during variant switches Jul 14, 2026
@austin-smith austin-smith changed the title Prevent crashes during variant switches Prevent crashes during game variant switches Jul 14, 2026
@austin-smith
austin-smith merged commit 4cda943 into main Jul 14, 2026
2 checks passed
@austin-smith
austin-smith deleted the guard-variant-switch-pile-indices branch July 14, 2026 04:17
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