Repository navigation
Fix game screen stacking under wizard on Start - #15
Merged
Merged
Conversation
startGame() toggled setupScreen/gameScreen/endScreen's .active class by hand instead of going through showScreen(), so it never cleared setupStep2Screen or setupStep3Screen -- whichever wizard step the player clicked Start from stayed .active underneath gameScreen. Closes Men-in-Black-5/ideas#172
Owner
Author
|
reviewer: approved. Confirmed |
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.
What
startGame()toggledsetupScreen/gameScreen/endScreen's.activeclass by hand instead of routing through the existingshowScreen()helper (the pattern used everywhere else in the file). That manual toggle only ever clearedsetupScreen(the wizard's step-1 screen) -- it never touchedsetupStep2ScreenorsetupStep3Screen, so whichever wizard step the player actually clicked Start Game from stayed.activeand rendered stacked underneathgameScreen.Fix: replace the 3-line manual toggle with
showScreen('gameScreen'), which clears.activefrom every.screenelement before activating the target. Also removed the now-deadsetupScreen/gameScreen/endScreenlocal variable declarations instartGame()that only existed to feed the manual toggle.endGame()'s own manualgameScreen/endScreentoggle was left as-is -- it's a 2-screen swap with no wizard screens in play at that point in the flow (a wizard screen would already have been cleared bystartGame()'s fix by the timeendGame()can run), so it isn't part of this bug and isn't in the issue's scope.Testing
npx tsc --noEmit-- clean.npx vitest run-- 172/172 tests pass (no existing test exercised this DOM path).npm run build-- clean.navigator.requestMIDIAccesssince headless has no real MIDI device/permission prompt to answer) driving the actual wizard: Start -> step 1 -> step 2 -> step 3 -> Start Game.['setupStep3Screen', 'gameScreen']-- reproduces the reported stacking bug exactly.['gameScreen']only.Closes Men-in-Black-5/ideas#172