Skip to content

Conversation

@Aotumuri
Copy link
Member

@Aotumuri Aotumuri commented Jan 20, 2026

Resolves #2962

Description:

Anonymize lobby preview player names when “Hidden names” is enabled, using the same deterministic mapping as in-game.

スクリーンショット 2026-01-20 21 13 19 スクリーンショット 2026-01-20 21 13 27

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory
  • I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced

Please put your Discord username so you can be contacted if a bug or regression is found:

aotumuri

@CLAassistant
Copy link

CLAassistant commented Jan 20, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ryanbarlow97
❌ Aotumuri
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

Walkthrough

Username anonymization is now applied in the lobby preview when users have anonymized names enabled. A currentClientID property is introduced and propagated through components to identify the viewing player, allowing their own name to remain visible while other players' names are randomized according to user settings.

Changes

Cohort / File(s) Summary
Client ID State Management
src/client/JoinPrivateLobbyModal.ts
Introduces currentClientID private state field initialized as empty string. Generates new client ID via generateID() when joining a lobby and propagates it through the JoinLobbyEvent payload at multiple join-flow checkpoints. Resets ID when closing or reinitializing the modal.
Client ID Propagation
src/client/HostLobbyModal.ts
Adds new property binding .currentClientID=${this.lobbyCreatorClientID} to LobbyPlayerView component to pass the creator's client ID downstream.
Anonymization Logic & Display
src/client/components/LobbyPlayerView.ts
Implements conditional username anonymization based on user settings. Adds currentClientID property to track the viewing player. Introduces displayUsername() helper method that returns the original name for disabled anonymization or current client, otherwise returns randomized name via createRandomName(). Updates all render paths (team lists, host actions, prompts, aria-labels) to use displayUsername() instead of raw username.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🎭 In lobbies veiled, where names take flight,
Players masked in randomized delight,
Yet you stay clear to your own keen eye,
A whimsical dance where anonymity and you comply! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Anonymized/hidden names on lobby preview' clearly and concisely describes the main change—adding name anonymization to the lobby preview UI.
Linked Issues check ✅ Passed The PR implements the core requirement from issue #2962: displaying anonymized names in the lobby preview using deterministic mapping consistent with in-game behavior.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing lobby preview name anonymization. The addition of currentClientID tracking and displayUsername helper are necessary to support the anonymization feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset, describing the implementation of name anonymization in the lobby preview when the 'Hidden names' setting is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@iiamlewis iiamlewis added this to the v29 milestone Jan 20, 2026
@iiamlewis iiamlewis added the Bugfix Fixes a bug label Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Anonymized/hidden names: on lobby preview too?

4 participants