Skip to content

feat: per-game gesture type + last-used gesture hint#655

Merged
wyne merged 2 commits into
mainfrom
claude/charming-golick-1137e2
Jun 16, 2026
Merged

feat: per-game gesture type + last-used gesture hint#655
wyne merged 2 commits into
mainfrom
claude/charming-golick-1137e2

Conversation

@wyne

@wyne wyne commented Jun 14, 2026

Copy link
Copy Markdown
Owner

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 interactionType a per-game setting instead of a single global value (prerequisite for later threshold enforcement).

  • redux/GamesSlice.ts: optional interactionType?: InteractionType on GameState (no persist migration needed — optional, resolves via fallback when unset) + setGameInteractionType reducer. Intentionally not in gameDefaults, 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 to settings.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.
  • Read paths routed through the game-scoped selector: 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: persisted lastUsedInteractionType + setLastUsedInteractionType (no-ops when unchanged).
  • store.ts: whitelist the field, bump settings persist version 3 → 4, migration 3 seeds it from the existing global gesture so returning users aren't nagged; fresh installs start undefined and see the hint until first use.
  • useGestureHint simplified to !gameLocked && currentGesture !== lastUsed.
  • Gesture marked "used" at the three score-commit chokepoints (HalfTap, Swipe, Dial deferred-flush), updating only on use, never on change — so switching gestures re-shows the hint until used once, and opening a game whose gesture differs from the last-used one shows a subtle "different mode here" cue.

Tests

  • Per-game selector precedence/fallback (selectors.test.ts); per-game switch in useGestureHint; games slice added to the GameOptionsButton store.
  • useGestureHint tests rewritten for the last-used model (new user, match/differ, used-dismisses, per-game cue, locked); setLastUsedInteractionType setter tests (set + no-op guard).

All 381 tests pass; tsc clean; ESLint clean on changed files.

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage after merging claude/charming-golick-1137e2 into main will be

60.92%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
redux
   GamesSlice.ts55.15%28.57%58.33%65.66%102–103, 103, 103, 105, 114, 124, 146–148, 163, 182, 193, 200, 202, 205–207, 257, 271, 284, 293–294, 294, 294, 300, 300, 300–301, 303, 305–306, 309, 309, 309, 309, 309–310, 313–314, 316, 318, 318, 318, 318, 318–319, 321, 321, 321, 323–324, 327, 327, 327, 329, 33, 56, 67, 84, 89–90, 90, 90
   PlayersSlice.ts89.90%100%87.50%85.11%103, 105, 33, 50–51, 68–69
   SettingsSlice.ts46.81%25%42.11%54.17%101, 104, 54, 57, 63, 66, 72, 75, 84, 84, 84, 90, 93, 98
   backup.ts0%0%0%0%11, 27–29, 31, 45–49, 51, 51, 51–52, 57, 60, 64–66, 71, 71, 71, 73–75, 78–79, 81–82, 85, 85, 85, 85, 85–87, 90–93, 95, 97
   hooks.ts100%100%100%100%
   selectors.ts100%100%100%100%
   store.ts0%0%0%0%10, 12, 12, 12–13, 13, 13–15, 18, 21–23, 23, 23, 23, 23–24, 28, 54, 61, 68, 75, 93
   testStore.ts0%100%0%0%11–15, 20–23, 25, 42–44, 5
src
   Analytics.ts100%100%100%100%
   ColorPalette.ts100%100%100%100%
   Logger.ts91.23%87.50%81.82%94.74%14–15, 22
   Navigation.tsx75.68%72.73%62.50%83.33%45, 49, 70, 73, 79–80
   constants.ts100%100%100%100%
   theme.ts93.75%85.71%100%100%79
src/components
   EditGame.tsx81.40%70%71.43%88.46%25, 39, 64, 64, 64–65
   FloatingActionButton.tsx68.97%100%50%73.68%38, 41–42, 55–56
   GameListItem.tsx66.10%47.83%100%73.33%103, 20, 23–24, 24, 24–26, 26, 26–28, 28, 28–30, 30, 30–31, 73
   GameListItemPlayerName.tsx100%100%100%100%
   MenuOpenContext.tsx87.50%100%66.67%100%
   PlayerListItem.tsx0%0%0%0%123, 123, 134, 24, 32–34, 34, 34–38, 40, 40, 40, 40, 40–41, 41, 41–42, 42, 42, 44–45, 56, 63–64, 66, 72–73, 76, 79, 82–83, 90, 93, 93, 96, 96, 96–97, 99
   ScoreLogTable.tsx92.59%82.35%100%96.15%50, 52, 54, 54
   SplashOverlay.tsx0%0%0%0%22–24, 24, 24, 26–28, 30, 32–33, 35, 37, 40, 40, 40, 43, 49, 53, 58, 74
src/components/AppInfo
   RotatingIcon.tsx0%0%0%0%18–19, 21–24, 26, 28–30, 37–38, 40, 40, 40–41, 44, 44, 44–48, 51, 53–54, 59
   SeedData.ts0%100%0%0%17, 47, 49–50, 52, 54–56, 58–60, 62, 68, 71, 82–85
src/components/BigButtons
   BigButton.tsx0%0%0%0%18, 18–20, 22–23, 23, 25, 25–26, 26, 48
src/components/Boards
   ListBoard.tsx86.81%72.73%84.21%98.57%123, 180, 206–207, 220, 223, 262, 29, 33, 59–61, 84, 84, 88, 92
   PlayerTile.tsx0%0%0%0%29, 39, 39, 39, 39, 39–40, 40, 40, 40, 40, 42–46, 46, 46–47, 47, 47, 47, 47–48, 48, 48–50, 50, 50, 52–54, 54, 54, 56, 59, 59, 63–64, 67–68, 70, 72, 82, 82, 99
   TileBoard.tsx96.39%90.32%100%100%18, 78, 92
src/components/Buttons
   AppSettingsButton.tsx100%100%100%100%
   BackButton.tsx0%100%0%0%16–18, 20–21
   GameOptionsButton.tsx51.85%42.86%69.23%54.72%102, 122, 122, 122–123, 125–126, 130, 130, 130, 130, 130, 130, 130, 132–133, 135–136, 138–139, 141–144, 146–148, 150–152, 159, 165–166, 177, 179, 179, 185, 185, 185, 185, 40, 46, 48, 58, 65, 73, 94, 98
   HeaderButton.tsx100%100%100%100%
src/components/ColorPalettes
   ColorSelector.tsx100%100%100%100%
   PalettePreview.tsx0%0%0%0%10–12, 14, 19, 19, 25
   PaletteSelector.tsx0%0%0%0%13, 15–18, 20, 22, 22, 22, 24–25, 31, 37, 40, 45, 56
src/components/Headers
   RoundHeaderTitle.tsx0%0%0%0%12–14, 16, 18, 18, 18, 20–21, 21, 21–22, 22, 22, 24–25, 27–28, 28, 28, 28, 28, 30–31, 31, 34–35, 44–45, 45, 45, 47–49, 57, 59, 62, 62, 62, 62, 64, 64, 70, 70, 70, 70, 73,

…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>
@wyne wyne changed the title feat: per-game gesture interaction type feat: per-game gesture type + last-used gesture hint Jun 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage after merging claude/charming-golick-1137e2 into main will be

60.43%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
redux
   GamesSlice.ts52.12%26.19%54.17%62.63%102–103, 103, 103, 105, 113–114, 114, 114, 116, 124, 146–148, 163, 182, 193, 200, 202, 205–207, 257, 271, 284, 293–294, 294, 294, 300, 300, 300–301, 303, 305–306, 309, 309, 309, 309, 309–310, 313–314, 316, 318, 318, 318, 318, 318–319, 321, 321, 321, 323–324, 327, 327, 327, 329, 33, 56, 67, 84, 89–90, 90, 90
   PlayersSlice.ts89.90%100%87.50%85.11%103, 105, 33, 50–51, 68–69
   SettingsSlice.ts48.08%50%40%53.85%100, 103, 108, 111, 114, 58, 61, 67, 70, 73, 82, 85, 94, 94, 94
   backup.ts0%0%0%0%11, 27–29, 31, 45–49, 51, 51, 51–52, 57, 60, 64–66, 71, 71, 71, 73–75, 78–79, 81–82, 85, 85, 85, 85, 85–87, 90–93, 95, 97
   hooks.ts100%100%100%100%
   selectors.ts100%100%100%100%
   store.ts0%0%0%0%10, 12, 12, 12–13, 13, 13–15, 18, 21–23, 23, 23, 23, 23–24, 29, 33, 60, 67, 74, 81, 99
   testStore.ts0%100%0%0%11–15, 20–23, 25, 42–44, 5
src
   Analytics.ts100%100%100%100%
   ColorPalette.ts100%100%100%100%
   Logger.ts91.23%87.50%81.82%94.74%14–15, 22
   Navigation.tsx75.68%72.73%62.50%83.33%45, 49, 70, 73, 79–80
   constants.ts100%100%100%100%
   theme.ts93.75%85.71%100%100%79
src/components
   EditGame.tsx81.40%70%71.43%88.46%25, 39, 64, 64, 64–65
   FloatingActionButton.tsx68.97%100%50%73.68%38, 41–42, 55–56
   GameListItem.tsx66.10%47.83%100%73.33%103, 20, 23–24, 24, 24–26, 26, 26–28, 28, 28–30, 30, 30–31, 73
   GameListItemPlayerName.tsx100%100%100%100%
   MenuOpenContext.tsx87.50%100%66.67%100%
   PlayerListItem.tsx0%0%0%0%123, 123, 134, 24, 32–34, 34, 34–38, 40, 40, 40, 40, 40–41, 41, 41–42, 42, 42, 44–45, 56, 63–64, 66, 72–73, 76, 79, 82–83, 90, 93, 93, 96, 96, 96–97, 99
   ScoreLogTable.tsx92.59%82.35%100%96.15%50, 52, 54, 54
   SplashOverlay.tsx0%0%0%0%22–24, 24, 24, 26–28, 30, 32–33, 35, 37, 40, 40, 40, 43, 49, 53, 58, 74
src/components/AppInfo
   RotatingIcon.tsx0%0%0%0%18–19, 21–24, 26, 28–30, 37–38, 40, 40, 40–41, 44, 44, 44–48, 51, 53–54, 59
   SeedData.ts0%100%0%0%17, 47, 49–50, 52, 54–56, 58–60, 62, 68, 71, 82–85
src/components/BigButtons
   BigButton.tsx0%0%0%0%18, 18–20, 22–23, 23, 25, 25–26, 26, 48
src/components/Boards
   ListBoard.tsx86.81%72.73%84.21%98.57%123, 180, 206–207, 220, 223, 262, 29, 33, 59–61, 84, 84, 88, 92
   PlayerTile.tsx0%0%0%0%29, 39, 39, 39, 39, 39–40, 40, 40, 40, 40, 42–46, 46, 46–47, 47, 47, 47, 47–48, 48, 48–50, 50, 50, 52–54, 54, 54, 56, 59, 59, 63–64, 67–68, 70, 72, 82, 82, 99
   TileBoard.tsx96.39%90.32%100%100%18, 78, 92
src/components/Buttons
   AppSettingsButton.tsx100%100%100%100%
   BackButton.tsx0%100%0%0%16–18, 20–21
   GameOptionsButton.tsx51.85%42.86%69.23%54.72%102, 122, 122, 122–123, 125–126, 130, 130, 130, 130, 130, 130, 130, 132–133, 135–136, 138–139, 141–144, 146–148, 150–152, 159, 165–166, 177, 179, 179, 185, 185, 185, 185, 40, 46, 48, 58, 65, 73, 94, 98
   HeaderButton.tsx100%100%100%100%
src/components/ColorPalettes
   ColorSelector.tsx100%100%100%100%
   PalettePreview.tsx0%0%0%0%10–12, 14, 19, 19, 25
   PaletteSelector.tsx0%0%0%0%13, 15–18, 20, 22, 22, 22, 24–25, 31, 37, 40, 45, 56
src/components/Headers
   RoundHeaderTitle.tsx0%0%0%0%12–14, 16, 18, 18, 18, 20–21, 21, 21–22, 22, 22, 24–25, 27–28, 28, 28, 28, 28, 30–31, 31, 34–35, 44–45, 45, 45, 47–49, 57, 59, 62, 62, 62, 62, 64, 64, 70,

@wyne wyne merged commit 908cded into main Jun 16, 2026
5 checks passed
@wyne wyne deleted the claude/charming-golick-1137e2 branch June 16, 2026 03:24
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant