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

@@ -83,6 +83,9 @@ export class RoomCodeDisplay {
const mid = Math.floor(raw.length / 2);
inputs.code1.value = raw.slice(0, mid);
inputs.code2.value = raw.slice(mid);
} else {
inputs.code1.value = '';
inputs.code2.value = '';
}
this.#applySettings();
@@ -114,7 +117,7 @@ export class RoomCodeDisplay {
* @param {{ roomCode?: string, [key: string]: unknown }} ctx
*/
update(ctx) {
if (!this.#inputs) {
if (!this.#active || !this.#inputs) {
return;
}
@@ -122,7 +125,7 @@ export class RoomCodeDisplay {
const current =
this.#inputs.code1.value.toUpperCase() + this.#inputs.code2.value.toUpperCase();
if (next !== current) {
if (next && next !== current) {
this.activate(ctx);
}
}