The title / login screen has a settings button: it opens the in-match settings dialog (local preferences only) (#183)

One gear button in the title connection row opens the existing SettingsModal; it reads and writes the same local preferences and touches no server state. Contributed by @zasx77771.
This commit is contained in:
MayAsteroidea authored and GitHub committed 2026-10-06 14:35:23 +08:00
1 parent f6794a2f2c
commit 19a89085a4
3 files changed
+15 -1

No files matched your search

+7
View File
@@ -968,6 +968,13 @@ describe('screen helpers', () => {
assert.equal(findUiAsset({ ui: {} }, ['x']), null);
});
test('title exposes the shared settings modal', () => {
const source = readFileSync(path.join(PUBLIC, 'js/screens/title.js'), 'utf8');
assert.match(source, /import \{ SettingsModal \} from '\.\.\/ui\/settings\.js'/);
assert.match(source, /class="title-settings fsbtn tapx"/, 'title screen includes the settings control');
assert.match(source, /<\$\{SettingsModal\} open=\$\{settingsOpen\}/, 'settings control opens the shared modal');
});
test('lobby: normalizeCode / parseRoomParam / difficultyInfo', async () => {
const { normalizeCode, parseRoomParam, difficultyInfo, MODE_TEXT } = await mod('screens/lobby.js');
assert.equal(normalizeCode('ab-c d9'), 'ABCD');