Add private lobby ID visibility toggle (#1382)

## Description:
Added an eye icon to the lobby ID button so users can hide/show their
lobby ID for privacy. When hidden, it shows dots (••••••••) instead of
the actual ID. Also added a setting in the user settings to control the
default behavior.

**Fixes #1091**

### What's new:
- Click the eye icon to toggle lobby ID visibility
- Global preference in User Settings modal
- Creating a new Lobby will take the set preference from User Settings
- Copy function still works when hidden


![image](https://github.com/user-attachments/assets/3f0b0299-cf49-492a-a1eb-51ec73ba1827)

![image](https://github.com/user-attachments/assets/77c48a89-1910-4bd4-988d-d86d5f3cbf4a)

![image](https://github.com/user-attachments/assets/5d4e16d8-0e91-4cb4-a343-4529172a766e)


## Please complete the following:
- [x] I have added screenshots for all UI updates
- [x] 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
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:
[UN]nvm
This commit is contained in:
floriankilian
2025-07-26 00:00:47 -04:00
committed by GitHub
parent a743b768a4
commit 48632cc0e0
5 changed files with 120 additions and 23 deletions
+17
View File
@@ -129,6 +129,14 @@ export class UserSettingModal extends LitElement {
console.log("🙈 Anonymous Names:", enabled ? "ON" : "OFF");
}
private toggleLobbyIdVisibility(e: CustomEvent<{ checked: boolean }>) {
const hideIds = e.detail?.checked;
if (typeof hideIds !== "boolean") return;
this.userSettings.set("settings.lobbyIdVisibility", !hideIds); // Invert because checked=hide
console.log("👁️ Hidden Lobby IDs:", hideIds ? "ON" : "OFF");
}
private toggleLeftClickOpensMenu(e: CustomEvent<{ checked: boolean }>) {
const enabled = e.detail?.checked;
if (typeof enabled !== "boolean") return;
@@ -289,6 +297,15 @@ export class UserSettingModal extends LitElement {
@change=${this.toggleAnonymousNames}
></setting-toggle>
<!-- 👁️ Hidden Lobby IDs -->
<setting-toggle
label="${translateText("user_setting.lobby_id_visibility_label")}"
description="${translateText("user_setting.lobby_id_visibility_desc")}"
id="lobby-id-visibility-toggle"
.checked=${!this.userSettings.get("settings.lobbyIdVisibility", true)}
@change=${this.toggleLobbyIdVisibility}
></setting-toggle>
<!-- 🏳️ Territory Patterns -->
<setting-toggle
label="${translateText("user_setting.territory_patterns_label")}"