feat(web): add generated PET sprites and picker polish - #325
Open
JeffreyDeng-spec wants to merge 2 commits into
Open
feat(web): add generated PET sprites and picker polish#325JeffreyDeng-spec wants to merge 2 commits into
JeffreyDeng-spec wants to merge 2 commits into
Conversation
Replace the inline PET SVG renderer with generated sprite sheets and eye overlays, refresh the six retained presets, and polish the Settings > Pet picker with the selected-card note and page-level eye tracking. Also removes the standalone selected preview box and includes focused pixel/sprite regression coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why we need this PR?
The home PET had accumulated several SVG-only visual variants that were hard to tune consistently across runtime states, settings previews, and new pixel-art refinements. This PR moves the retained six PET presets to generated sprite sheets, keeps the runtime stateless, and polishes the Settings > Pet picker requested in the recent PET iteration.
What changed
src/web/scripts/generate-pet-sprites.mjsplus a generated sprite manifest.Out for worknote,Visuals
Six clear browser-rendered Idle previews, one per PET. Each image is captured from the committed body sprite plus eye overlay, matching the final rendered preview instead of the body sheet's eye-less first frame.
Key files:
.github/assets/pet-idle-previews/*src/web/public/pets/*src/web/scripts/generate-pet-sprites.mjssrc/web/src/components/home-pet/cloud-code-monster-pet-sprite-manifest.tssrc/web/src/components/home-pet/cloud-code-monster-pet-pixel-parts.tsxsrc/web/src/components/home-pet/cloud-code-monster-pet.tsxsrc/web/src/app/(app)/w/[slug]/settings/pet-tab.tsxsrc/web/src/components/home-pet/cloud-code-monster-pet.test.tsVerification run:
node src/web/scripts/generate-pet-sprites.mjsgit diff --checkpnpm --filter @alook/web test -- cloud-code-monster-petpnpm --filter @alook/web typecheckpnpm --filter @alook/web lintpnpm typecheckpnpm testChecklist
Impact Areas
@alook/shared)@alook/web)@alook/cli)@alook/email-worker)@alook/ws-do)