Live Hard Mode toggle until first guess, move How to Play/Dev Mode into Settings#145
Open
dhoepp wants to merge 1 commit into
Open
Live Hard Mode toggle until first guess, move How to Play/Dev Mode into Settings#145dhoepp wants to merge 1 commit into
dhoepp wants to merge 1 commit into
Conversation
… Settings Hard Mode previously snapshotted the Settings toggle once at mount and stayed locked for the entire /game session, even across "new game" clicks, so a mid-session flip only ever took effect on a full page reload. It now tracks the live setting until the first guess is submitted, then locks for the rest of that game (and re-unlocks when a new game starts) — set during render rather than in an effect, per react-hooks/set-state-in-effect. Also moved "How to Play" and the Dev Mode toggle out of the header and into the Settings modal, cutting the header down to Home/Settings/dark toggle/sign-in so it's no longer cramped below 430px wide. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🤖 AI Review (Gemini 2.5 Flash)This pull request refactors the location of the Dev Mode toggle and the 'How to Play' button, moving them from the Header component into the SettingsModal. Additionally, it updates the Hard Mode game logic to dynamically apply the setting when no guesses have been made in the current game, and lock it in once a guess is submitted. The changes appear to be well-implemented according to the revised feature specifications. |
dhoepp
enabled auto-merge
July 21, 2026 12:53
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
/gamemount and stayed locked for the entire session (even across "New Game" clicks in Infinity mode) until a full page reload — so flipping the setting mid-session silently did nothing until you reloaded. State is set during render (not inside an effect) per thereact-hooks/set-state-in-effectrule, avoiding an extra cascading re-render.Why
Reviewer notes
GamePage.tsx:hardModestate is now nudged back to the livehardModeSettingduring render wheneverguesses.length === 0(React's documented "adjust state when a value changes" pattern), then frozen once a guess exists. Re-unlocks automatically whenhandleNewGameresetsguessesto[].SettingsModal.tsxgained a requiredonOpenHowToPlayprop;Header.tsxstill owns theshowHelp/showSettingsopen state and just passes the callback through.!loading && configured && user && canUseDevMode).Test plan
tsc -bandeslintclean (pre-existing unrelatedexhaustive-depswarning left as-is)🤖 Generated with Claude Code