fix(react-chess-game): address audio system review findings#84
Merged
Conversation
- bundle .ogg assets as data URIs (tsup dataurl loader): the file loader emitted page-relative paths that 404 in consumer apps, silently breaking all default sounds - restore isLegalMove guard in Board click handler so deselecting a piece no longer emits an illegal-move game event - track last handled event id in useBoardSounds so mounting Sounds mid-game doesn't replay the latest event Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: d6517b2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Follow-ups from the post-merge review of #81:
fileloader emitted page-relative paths like./capture-XXXX.oggin the published JS, which resolve against the consumer's page URL and 404 silently, so default sounds never played outside this repo's Storybook. Switched to thedataurlloader: assets are inlined as base64 data URIs (~30KB total), matching the pre-feat(react-chess-game): introduce typed game events and AudioManager for sound system #81 inline approach.illegal-moveevents: restored theisLegalMoveguard in the Board click handler, so clicking an unreachable square to deselect a piece no longer goes throughmakeMoveand no longer emits anillegal-moveevent on the newgameEventstream.useBoardSoundsnow tracks the last handled event id, so mountingChessGame.Soundsmid-game (e.g. a sound on/off toggle) doesn't replay the latest move's sound.Test plan
move-madedist/index.jsinlines audio asdata:application/ogg;base64,...with no loose .ogg files🤖 Generated with Claude Code