From 77cd29f07a74dce2d98bda15f000fe21508e6acb Mon Sep 17 00:00:00 2001 From: sganggs Date: Fri, 9 Oct 2026 23:57:05 +0800 Subject: [PATCH] Keep lobby settings next to the guide when install controls appear (#413) --- docs/history/0.2.3.md | 4 ++++ public/js/screens/lobby.js | 2 +- test/ui/settings-entry.e2e.test.js | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/history/0.2.3.md b/docs/history/0.2.3.md index 5f19d459..62af1641 100644 --- a/docs/history/0.2.3.md +++ b/docs/history/0.2.3.md @@ -271,6 +271,10 @@ same offer once. See [the prompt API](https://developer.mozilla.org/en-US/docs/W and [installability requirements](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable). The existing original fortress favicon supplies correctly sized 192/512 px icons, shipped outside optional game art. No service worker or offline cache is installed; the server is still required. +The lobby keeps Settings immediately before How to Play even when the optional install/recovery buttons appear; +the full browser run caught and corrected an initial insertion between that established pair. +The settings-entry check tests the absent board-style/background-music option labels, allowing the text-size help +to explain that the board keeps its scale. Tests: offer lifecycle/disposal, actual PNG dimensions, real Chrome manifest and installability checks, and a synthetic dismissed offer through the actual button. Initial incognito rejection was a test-environment limitation; the real diff --git a/public/js/screens/lobby.js b/public/js/screens/lobby.js index 8f56e07b..902648c0 100644 --- a/public/js/screens/lobby.js +++ b/public/js/screens/lobby.js @@ -316,9 +316,9 @@ export function LobbyScreen() {
<${Button} variant="secondary" size="sm" icon="chart" class="stats-entry" onClick=${openStats} title=${t('统计数据')} aria-label=${t('统计数据')}>${t('统计')} - <${SettingsButton} class="lobby-settings" variant="secondary" label=${t('设置')} /> <${ResumeMatchButton} /> <${PwaInstallButton} class="lobby-pwa" /> + <${SettingsButton} class="lobby-settings" variant="secondary" label=${t('设置')} /> <${GuideButton} class="lobby-guide" variant="secondary" label=${t('玩法说明')} /> <${LoadoutButton} from="lobby" size="sm" class="lobby-loadout" label=${t('干员调配')} />
diff --git a/test/ui/settings-entry.e2e.test.js b/test/ui/settings-entry.e2e.test.js index 0820ca34..71979c2b 100644 --- a/test/ui/settings-entry.e2e.test.js +++ b/test/ui/settings-entry.e2e.test.js @@ -61,8 +61,10 @@ describe('the settings entry of the lobby and the room', { skip: !ENABLED && 'se assert.match(text, /设置/); assert.match(text, /背景音乐/); assert.match(text, /快捷键/); - assert.doesNotMatch(text, /棋盘/, 'no board-style option (declined)'); - assert.doesNotMatch(text, /后台/, 'no background-music option (declined)'); + // The text-size hint mentions the unchanged board scale; the declined options concern controls, not help copy. + const optionLabels = await page.$$eval('.modal .set-row__label', (nodes) => nodes.map((n) => n.textContent).join(' ')); + assert.doesNotMatch(optionLabels, /棋盘/, 'no board-style option (declined)'); + assert.doesNotMatch(optionLabels, /后台/, 'no background-music option (declined)'); await page.keyboard.press('Escape'); await sleep(300); assert.equal(await modalText(page), null, 'Esc closes it');