From 16d36328ec83ba30ba64a4253ddbffa63d6f747c Mon Sep 17 00:00:00 2001 From: Gabriel Franco Date: Sun, 13 Sep 2026 19:35:37 -0300 Subject: [PATCH] fix(frontend): drop Change Theme button, stop pre-selecting last theme - Theme-picker modal always opens with a fixed default highlighted card instead of the last-played theme. - Removed the change-theme-btn entirely; Back to Menu is now the only result-modal button shown while a solo/bot round is active, and does what Change Theme used to (go to the main menu) plus solo cleanup. --- frontend/index.html | 1 - frontend/src/main.ts | 3 --- frontend/src/ui/soloConfigFlow.ts | 13 +++++-------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 0294898..785cbcd 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -184,7 +184,6 @@ diff --git a/frontend/src/main.ts b/frontend/src/main.ts index cb126f0..5fd2e3c 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -24,7 +24,6 @@ const matchmakingStatusEl = requireEl('matchmaking-status'); const helpBtn = requireEl('help-btn'); const muteBtn = requireEl('mute-btn'); const themeNameBadge = requireEl('theme-name-badge'); -const changeThemeBtn = requireEl('change-theme-btn'); const backToMenuBtn = requireEl('back-to-menu-btn'); const privateRoomMount = requireEl('private-room-mount'); @@ -66,7 +65,6 @@ createSoloConfigFlow( themeNameBadge, preview: previewElements, themePicker: themePickerElements, - changeThemeBtn, backToMenuBtn, }, { hideMenu: () => showView(null), showMenu: () => showView('menu') }, @@ -88,7 +86,6 @@ createMatchmakingFlow( ); helpBtn.addEventListener('click', () => showView('menu')); -changeThemeBtn.addEventListener('click', () => showView('menu')); muteBtn.addEventListener('click', () => { const muted = sound.toggleMute(); diff --git a/frontend/src/ui/soloConfigFlow.ts b/frontend/src/ui/soloConfigFlow.ts index 09211de..ddd3b58 100644 --- a/frontend/src/ui/soloConfigFlow.ts +++ b/frontend/src/ui/soloConfigFlow.ts @@ -53,11 +53,10 @@ export interface SoloConfigFlowElements { gridMount: HTMLElement; cancelBtn: HTMLButtonElement; }; - /** Result-modal button used by every non-solo match; hidden for as - * long as a solo/bot round is active, in favor of `backToMenuBtn`. */ - changeThemeBtn: HTMLButtonElement; - /** Result-modal button shown in `changeThemeBtn`'s place once a - * solo/bot round has started. */ + /** Result-modal button shown for as long as a solo/bot round is + * active — does the same "back to the main menu" thing the old + * change-theme button used to, plus solo cleanup (stops the bot, + * hides the timer HUD). */ backToMenuBtn: HTMLButtonElement; } @@ -238,7 +237,7 @@ export function createSoloConfigFlow( const timerHud = createTimerHud(elements.timerMount, quit); - const themeGrid = createThemeGrid(elements.themePicker.gridMount, readLastTheme() ?? 'gruvbox', (themeId) => { + const themeGrid = createThemeGrid(elements.themePicker.gridMount, 'gruvbox', (themeId) => { sound.playOpen(); if (!pendingConfig) return; const config = pendingConfig; @@ -277,7 +276,6 @@ export function createSoloConfigFlow( lastConfig = config; soloActive = true; writeLastTheme(config.themeId); - elements.changeThemeBtn.classList.add('hidden'); elements.backToMenuBtn.classList.remove('hidden'); hooks.hideMenu(); runThemePreview(elements.preview, config.themeId, () => { @@ -365,7 +363,6 @@ export function createSoloConfigFlow( soloActive = false; botMatch.stop(); timerHud.hide(); - elements.changeThemeBtn.classList.remove('hidden'); elements.backToMenuBtn.classList.add('hidden'); hooks.showMenu(); }