Skip to content

Hide a disguised Ditto's shiny state in save snapshots - #420

Merged
chattymin merged 1 commit into
chattymin:mainfrom
Borisserz:fix/snapshot-ditto-shiny
Oct 5, 2026
Merged

chattymin merged 1 commit into
chattymin:mainfrom
Borisserz:fix/snapshot-ditto-shiny

Conversation

@Borisserz

Copy link
Copy Markdown
Contributor

Summary

Fixes #419. The snapshot list in Settings drew a disguised shiny Ditto as a shiny sprite of its disguise species, which spoiled the reveal. SaveSnapshotManager read the raw active.isShiny in all three snapshot paths: create, list for envelope files, and list for legacy raw-state files. Every other display path hides it until dittoRevealed.

The hiding rule now lives in one place, MonState.displaysShiny. CompanionStore.currentIsShiny, CompanionState.ownsShinySpecies and the three snapshot paths all use it, so no display path can reimplement it differently. Graduation keeps storing the raw isShiny in DexEntry, because that is stored data, not display.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

UI changes

Before After
Settings → Snapshots: a disguised shiny Ditto's row shows a shiny sprite of the disguise species The row shows the normal sprite until the reveal, then the shiny Ditto

Validation

  • New SaveSnapshotTests.testSnapshotDoesNotRevealShinyOfDisguisedDitto covers the create path, the envelope listing and a legacy raw-state file, plus a revealed Ditto that must show as shiny. On unfixed main it fails with 4 failures.
  • Full swift test: 1385 tests, 0 failures (17 skipped, as on main). The existing Ditto hiding tests (testReleasingDisguisedDittoKeepsShinyHidden and others) still pass after the refactor.
  • Class sweep over every raw isShiny read in Sources: the remaining ones are storage (graduate) or run after the reveal (revealDitto celebration), so they are correct.
  • Added a defect-log entry next to the existing Ditto shiny-hiding entry.

Checklist

  • swift build and swift test pass locally
  • PR title and description are written in English
  • UI changes are described above (before/after — images optional)
  • No copyrighted assets, secrets, or private tooling references are committed (see CONTRIBUTING)
  • Tests were added or updated for this change

@chattymin
chattymin merged commit 1a71018 into chattymin:main Oct 5, 2026
2 checks passed
chattymin pushed a commit to Borisserz/PokeTokenBar that referenced this pull request Oct 5, 2026
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.

Snapshot list reveals a disguised Ditto's shiny state before the reveal

2 participants