fix: address code review issues from final review

- Override modes now actually affect component visibility (force_show,
  force_hide, auto respected in transitions and updates)
- RoomCodeDisplay.update() guarded by #active flag to prevent
  re-activation outside lobby state
- broadcastUpdate() only sends to components when in lobby state
- Relaxed idle→playing/ended transitions for out-of-order events
- room.disconnected now clears room code, players, lobby state context
- Empty room codes clear input fields instead of leaving stale values
- Removed dead auto-mode-toggle UI and associated CSS
- Fixed player list vertical centering when offset is applied

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-20 13:08:52 -04:00
parent 19c94d294f
commit 875153ef63
4 changed files with 63 additions and 98 deletions

View File

@@ -305,59 +305,6 @@
background-color: #c9302c;
}
/* Auto/Manual mode toggle */
.mode-toggle {
display: flex;
align-items: center;
gap: 8px;
}
.mode-toggle-switch {
position: relative;
width: 36px;
height: 18px;
flex-shrink: 0;
}
.mode-toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.mode-toggle-slider {
position: absolute;
cursor: pointer;
top: 0; left: 0; right: 0; bottom: 0;
background-color: #555;
border-radius: 18px;
transition: background-color 0.2s;
}
.mode-toggle-slider:before {
content: "";
position: absolute;
height: 14px;
width: 14px;
left: 2px;
bottom: 2px;
background-color: white;
border-radius: 50%;
transition: transform 0.2s;
}
.mode-toggle-switch input:checked + .mode-toggle-slider {
background-color: #4CAF50;
}
.mode-toggle-switch input:checked + .mode-toggle-slider:before {
transform: translateX(18px);
}
.mode-label {
color: #ccc;
font-size: 12px;
}
/* Player list */
#player-list-container {
@@ -771,17 +718,6 @@
<div class="control-row" style="display: none;" id="ws-disconnect-row">
<button id="ws-disconnect-btn">Disconnect</button>
</div>
<div class="control-row" style="margin-top: 5px;">
<label>Update Mode:</label>
<div class="mode-toggle">
<span class="mode-label">Manual</span>
<label class="mode-toggle-switch">
<input type="checkbox" id="auto-mode-toggle" checked>
<span class="mode-toggle-slider"></span>
</label>
<span class="mode-label">Auto</span>
</div>
</div>
</div>
</div>