Skip to content

feat: suggest recent players when naming a player - #772

Open
wyne wants to merge 1 commit into
mainfrom
feat/recent-player-suggestions
Open

wyne wants to merge 1 commit into
mainfrom
feat/recent-player-suggestions

Conversation

@wyne

@wyne wyne commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Summary

From user feedback: in games with many players (7 Wonders), you had to type part of every name before any suggestions appeared.

Now, focusing a player's name field shows a Recent players list right away:

  • Ordered by most recently created game, then seat order
  • Leaves out names already used in the current game, so tapping down the roster doesn't offer duplicates
  • Leaves out default Player N names
  • Up to 8 names, using the existing dropdown

Typing still searches every saved name, as before. Clearing the field shows the recent list again.

Changes

  • redux/selectors.ts: new memoized selectRecentPlayerNames
  • src/screens/EditPlayerScreen.tsx: until the name is edited (or once it's cleared), show recent players with a header; after typing, show filtered matches as before

Testing

  • New selector tests (ordering, dedupe, default names, memoization)
  • New screen tests: list on focus, order, exclusions, switching to search when typing, coming back after clearing, saving on tap, hidden when empty
  • npm run lint and npm run test (475 passing)
  • Not yet checked on a device or simulator

🤖 Generated with Claude Code

Focusing the player name field now lists recent players right away,
without typing first. Names come from the newest games first, skip
anyone already seated in this game, and leave out default "Player N"
names. Typing still searches every saved name, and clearing the field
brings the recent list back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage after merging feat/recent-player-suggestions into main will be

65.91%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
redux
   GamesSlice.ts59.90%35.42%63.33%69.30%104–105, 105, 105, 107, 115–116, 116, 116, 118, 126, 148, 173–175, 190, 220, 227, 229, 232–234, 298, 311, 320–321, 321, 321, 327, 327, 327–328, 330, 332–333, 336, 336, 336, 336, 336–337, 340–341, 343, 345, 345, 345, 345, 345–346, 348, 348, 348, 350–351, 354, 354, 354, 356, 58, 69, 86, 91–92, 92, 92
   PlayersSlice.ts88.04%95%85.71%86.27%105, 107, 115, 35, 52–53, 70–71
   SettingsSlice.ts61.54%66.67%55%65.38%103, 106, 111, 117, 61, 64, 70, 73, 76, 88, 97
   backup.ts78.19%75.19%88.89%80.21%105, 105, 128–130, 138, 174–175, 177, 191–195, 197, 197, 197–198, 203, 206, 217, 227–228, 244, 58–63, 65, 68, 68–70, 70, 70–71, 71, 71, 73–74, 76–78, 80–81, 81–82, 88–89
   hooks.ts100%100%100%100%
   scoreUtils.ts93.33%87.50%100%100%5
   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%
   AnalyticsEvents.ts100%100%100%100%
   ColorPalette.ts100%100%100%100%
   Logger.ts91.23%87.50%81.82%94.74%14–15, 22
   Navigation.tsx77.14%65.52%66.67%90.63%135, 139, 139–140, 147, 147, 149, 149, 155–156, 75, 79, 95
   constants.ts100%100%100%100%
   platform.ts100%100%100%100%
   theme.ts93.75%85.71%100%100%85
src/components
   EditGame.tsx79.63%75%66.67%84.85%35, 49, 62–63, 86, 86, 86–87
   FloatingActionButton.tsx100%100%100%100%
   GameListItem.tsx94.19%85.29%100%100%122, 155, 25, 31, 58
   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.tsx90.91%80%100%96.67%51, 53, 55, 55, 64, 70
   SectionLabel.tsx100%100%100%100%
   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%19, 19–21, 23, 29, 29, 33, 33–34, 34, 57
src/components/Boards
   ListBoard.tsx86.90%73.21%84.21%98.57%123, 182, 208–209, 222, 225, 266, 29, 33, 59–61, 84, 84, 88, 92
   PlayerTile.tsx0%0%0%0%29, 38–42, 42, 42–43, 43, 43, 43, 43–44, 44, 44–46, 46, 46, 48–50, 50, 50, 52, 55, 55, 59–60, 63–64, 66, 68, 68, 68, 68, 68–69, 69, 69, 69, 69, 71, 81, 81, 98
   TileBoard.tsx96.43%90.32%100%100%18, 77, 93
src/components/Buttons
   AppSettingsButton.tsx59.38%50%50%65%37–38, 42–44, 47, 53, 53, 56
   GameOptionsButton.tsx45.21%36%52.17%49.32%100–101, 103–104, 106–107, 109–112, 114–116, 118–120, 148, 152, 156–159, 162, 166, 168–169, 169, 169, 171, 177, 180, 184, 184, 184, 184, 186, 186, 219, 226, 246, 252–253, 264, 266, 266, 272, 272, 272, 272, 56, 58, 63–64, 70, 80, 83, 90, 90, 90–91, 93–94, 98, 98, 98, 98, 98, 98, 98
   HeaderButton.tsx81.82%60%100%100%19–20
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.tsx9.80%13.27%0%4.44%101–102, 106, 114, 114, 114, 117, 122,

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