Skip to content

feat(gallery): surface sprite atlas versions - #658

Merged
Railly merged 5 commits into
mainfrom
codex/sprite-version-badge
Aug 8, 2026
Merged

feat(gallery): surface sprite atlas versions#658
Railly merged 5 commits into
mainfrom
codex/sprite-version-badge

Conversation

@henryjing96

Copy link
Copy Markdown
Member

This PR adds persisted sprite atlas version support so Petdex can distinguish classic v1 pets from hatch v2 pets across submission, editing, search, Gallery, detail pages, and manifests.

What changed:

  • Parse spriteVersionNumber from pet.json during web submit, owner edit, and CLI submit/edit.
  • Persist sprite_version_number for approved pets and pending_sprite_version_number for owner edits awaiting review.
  • Add Gallery and detail page badges that show only v1 or v2.
  • Add a separate Version filter row in Gallery for v1 / v2.
  • Include spriteVersionNumber in search responses and public manifests.
  • Add search API support for spriteVersions=1,2.
  • Add cache key bumps for pet/search/manifest aggregates that now include version data.
  • Add local mock v2 sample data for validation.
  • Add tests for parsing, validation, search params, and row mapping.
image

Notes for @Railly :
Before releasing this code, or as part of the release process, please run the DB migration so production has the new columns and index.

If the normal Drizzle migration flow is used, apply:
drizzle/0018_sprite_version_number.sql

If a manual/idempotent script is preferred, run:
bun --env-file .env.production scripts/apply-sprite-version-number.ts

After the migration, backfill existing pets from their stored pet.json files:
bun --env-file .env.production scripts/backfill-sprite-version-number.ts

Please make sure .env.production contains the real production DATABASE_URL before running these commands.

Backfill behavior:

  • Missing spriteVersionNumber defaults to v1.
  • spriteVersionNumber: 1 writes v1.
  • spriteVersionNumber: 2 writes v2.
  • Unsupported values are skipped and reported in the script output.

Validation:

  • bun run check
  • bun test

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
petdex Ignored Ignored Preview Aug 8, 2026 9:30pm

@henryjing96

Copy link
Copy Markdown
Member Author

This PR addresses issue #600.
One release note: this change includes new database fields and a backfill for existing pets, so @Railly will need to run the DB migration/backfill as part of the production release.

Please DM me when operating on the DB and merging the PR if helpful, and we can coordinate the production rollout together. Thanks

Railly added 3 commits August 8, 2026 17:54
- declare spriteVersions on SearchFacets, which computeFacets already returns
- widen the search row to the integer drizzle infers and narrow at the seam
- default the atlas version for submissions and the missing-files fallback
- drop the vestigial pendingSpriteVersionNumber, which EditPolicyInput never read
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.

2 participants