feat: per-game gesture type + last-used gesture hint#655
Merged
Conversation
Move interactionType from a single global SettingsSlice value to an optional per-game field, with the global value retained as the default for new games. - Add optional `interactionType` to GameState and a `setGameInteractionType` reducer (no persist migration needed; the field is optional and resolves via fallback when unset) - `selectInteractionType(state, gameId?)` now prefers the game-level gesture, falls back to the global default, then validates - GameOptionsButton sets the gesture on the current game and also updates the global default, preserving the "sticky last choice" so new games inherit the most recently picked gesture - Route all read paths (GameScreen, PlayerTile, useGestureHint, PointValuesSheet) through the game-scoped selector - Tests: game-level precedence/fallback in selectors, per-game switch in useGestureHint, and a games slice added to the GameOptionsButton store No threshold/enforcement logic — that is intentionally deferred. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
…cores The hint previously showed on every new game with no scores and re-showed on every gesture switch, nagging experienced users — especially now that gestures are per-game. Replace the per-game score "fingerprint" logic with a persisted, global "last-used gesture": show the hint only when the active gesture differs from the one the user most recently used. - Add persisted `lastUsedInteractionType` to SettingsSlice with a `setLastUsedInteractionType` setter that no-ops when unchanged (so the per-score dispatch from interaction components doesn't churn state) - store.ts: whitelist the field, bump settings persist version 3 -> 4, and add migration 3 seeding it from the existing global gesture so returning users aren't shown the hint for a gesture they already use; fresh installs start undefined and see the hint until first use - Simplify useGestureHint to `!gameLocked && currentGesture !== lastUsed`, reusing the per-game selectInteractionType - Mark a gesture "used" at the three score-commit chokepoints (HalfTap, Swipe, and the Dial deferred-flush), updating only on use — never on a gesture change — so switching gestures re-shows the hint until used once - Rewrite useGestureHint tests for the new model; add SettingsSlice setter tests (set + no-op guard) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Coverage after merging claude/charming-golick-1137e2 into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
wyne
added a commit
that referenced
this pull request
Jun 16, 2026
Update the large-player-count plan to reflect merged work and current file names on main: - §2 per-game gesture: marked complete (PR #655), with the as-shipped details and the gesture-hint rework (lastUsedInteractionType) - §3 threshold enforcement: noted now-unblocked since §2 prerequisite landed - §4: corrected the stale useGestureHint bullet (the useHasAnyScore claim was never accurate); PlayerListItem now memoized; AdditionTile still pending - §10: PlayerListItem memoized; renderItem useCallback still pending - File-name refresh across the doc: SettingsScreen -> EditGameScreen, Rounds.tsx -> ScoreLogTable.tsx; key-files table and implementation order updated to match Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
First slices of the large player count plan — the per-game gesture work (§2 / step 3) plus a follow-up rework of the gesture hint that builds on it. No threshold/enforcement logic is included — that is intentionally deferred.
Commit 1 — per-game gesture interaction type
Makes
interactionTypea per-game setting instead of a single global value (prerequisite for later threshold enforcement).redux/GamesSlice.ts: optionalinteractionType?: InteractionTypeonGameState(no persist migration needed — optional, resolves via fallback when unset) +setGameInteractionTypereducer. Intentionally not ingameDefaults, so new games inherit the global default rather than a frozen literal.redux/selectors.ts:selectInteractionType(state, gameId?)prefers the game-level gesture, falls back tosettings.interactionType, then validates.GameOptionsButton: on selection, sets the gesture on the current game and updates the global default, preserving "sticky last choice" so new games inherit the most recently picked gesture while each game keeps its own.GameScreen,PlayerTile,useGestureHint,PointValuesSheet.Commit 2 — last-used gesture hint
The hint previously showed on every new game with no scores and re-showed on every gesture switch — nagging experienced users, especially with per-game gestures. Replace the per-game score "fingerprint" logic with a persisted, global last-used gesture: show the hint only when the active gesture differs from the one the user most recently used.
SettingsSlice: persistedlastUsedInteractionType+setLastUsedInteractionType(no-ops when unchanged).store.ts: whitelist the field, bump settings persist version3 → 4, migration3seeds it from the existing global gesture so returning users aren't nagged; fresh installs startundefinedand see the hint until first use.useGestureHintsimplified to!gameLocked && currentGesture !== lastUsed.Tests
selectors.test.ts); per-game switch inuseGestureHint;gamesslice added to theGameOptionsButtonstore.useGestureHinttests rewritten for the last-used model (new user, match/differ, used-dismisses, per-game cue, locked);setLastUsedInteractionTypesetter tests (set + no-op guard).All 381 tests pass;
tscclean; ESLint clean on changed files.🤖 Generated with Claude Code