Skip to content

Commit fad4b81

Browse files
Markus Holzhäuserclaude
authored andcommitted
fix: hide setup cards in lobby view + hide join button for admin players (#653)
- Add tts-settings and ha-entities to setupSections so they are hidden when transitioning to the lobby view - Hide "Als Spieler beitreten" button when admin is already registered as a player (via join_ack, sessionStorage, or players list) - Remove orphaned "-->" HTML fragment rendering as visible text - Bump version to 3.0.6-rc.1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a5b56ca commit fad4b81

6 files changed

Lines changed: 123 additions & 13 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ config/*
7272
!config/configuration.yaml
7373
community-post.md
7474
*.bak
75+
INFLUENCER_OUTREACH.md
76+
beatify-stats.md
77+
beatify-stats-history.json
7578

7679
# ---- Release notes (keep CHANGELOG.md) ----
7780
RELEASE_NOTES_*.md

custom_components/beatify/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"documentation": "https://github.com/mholzi/beatify",
1313
"iot_class": "local_push",
1414
"issue_tracker": "https://github.com/mholzi/beatify/issues",
15-
"version": "3.0.5"
15+
"version": "3.0.6-rc.1"
1616
}

custom_components/beatify/www/admin.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ <h2 class="section-header"><span class="section-icon" aria-hidden="true">🎵</s
201201
</div>
202202
</div>
203203
</section>
204-
-->
205204

206205
<!-- Game Settings Section - Collapsible with all settings -->
207206
<section id="game-settings" class="section-collapsible collapsed" aria-labelledby="game-settings-heading">

custom_components/beatify/www/js/admin.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const STORAGE_LAST_PLAYER = 'beatify_last_player';
114114
const STORAGE_GAME_SETTINGS = 'beatify_game_settings';
115115

116116
// Setup sections to hide/show as a group
117-
const setupSections = ['media-players', 'music-service', 'playlists', 'game-settings', 'admin-actions', 'my-requests'];
117+
const setupSections = ['media-players', 'music-service', 'playlists', 'game-settings', 'admin-actions', 'my-requests', 'tts-settings', 'ha-entities'];
118118

119119
// Platform display labels for speaker grouping
120120
const PLATFORM_LABELS = {
@@ -1499,16 +1499,16 @@ function showLobbyView(gameData) {
14991499
// Update difficulty badge (use gameData.difficulty if available, else selectedDifficulty)
15001500
updateLobbyDifficultyBadge(gameData.difficulty || selectedDifficulty);
15011501

1502-
// Fix #228: Update participate button label if admin is already registered as a player.
1503-
// The actual redirect logic is handled in openAdminJoinModal().
1502+
// Fix #228: Hide participate button if admin is already registered as a player.
15041503
var participateBtn = document.getElementById('participate-btn');
15051504
if (participateBtn) {
1505+
var adminInPlayers = (gameData.players || []).some(function(p) { return p.is_admin; });
15061506
var adminNameStored = null;
15071507
try { adminNameStored = sessionStorage.getItem('beatify_admin_name'); } catch(e) {}
1508-
var btnLabel = participateBtn.querySelector('[data-i18n]');
1509-
if (adminNameStored && btnLabel) {
1510-
btnLabel.setAttribute('data-i18n', 'admin.startGameplay');
1511-
btnLabel.textContent = BeatifyI18n.t('admin.startGameplay');
1508+
if (adminInPlayers || adminNameStored || isPlaying) {
1509+
participateBtn.classList.add('hidden');
1510+
} else {
1511+
participateBtn.classList.remove('hidden');
15121512
}
15131513
}
15141514

@@ -2864,6 +2864,8 @@ function handleAdminWsMessage(data) {
28642864
document.cookie = 'beatify_session=' + data.session_id +
28652865
';path=/;max-age=86400;SameSite=Strict';
28662866
}
2867+
// Hide "Join as Player" button since admin is now a player
2868+
document.getElementById('participate-btn')?.classList.add('hidden');
28672869
console.log('[Admin WS] Joined as player:', adminPlayerName);
28682870
break;
28692871

custom_components/beatify/www/js/admin.min.js

Lines changed: 107 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

custom_components/beatify/www/js/player.bundle.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)