Speak onboarding and all game dialogue automatically
Build and publish frontend / publish (push) Successful in 38s

This commit is contained in:
Ein Anderssono
2026-10-15 10:54:10 +02:00
parent 5354132489
commit 69184d1920
5 changed files with 70 additions and 36 deletions
+5 -4
View File
@@ -151,10 +151,11 @@ test('TTS and microphone are mutually exclusive', () => {
assert.equal(h.controller.getState(), 'SPEAKING');
});
test('speech is disabled in screen-reader mode and gracefully degrades without synthesis', () => {
test('game speech stays automatic even with legacy text-only settings and gracefully degrades without synthesis', () => {
const screenReader = makeHarness();
screenReader.controller.update({mode: 'screen-reader'});
assert.equal(screenReader.controller.speak('dialog'), false);
screenReader.controller.update({mode: 'text-only', autoSpeak: false});
assert.equal(screenReader.controller.speak('dialog'), true);
assert.equal(screenReader.synthesis.spoken[0].text, 'dialog');
const noTts = makeHarness({tts: false});
noTts.controller.update({mode: 'game-voice'});
assert.equal(noTts.controller.speak('dialog'), false);
@@ -180,7 +181,7 @@ test('settings survive reload and invalid storage falls back to accessible defau
const defaults = GameVoice.loadSettings(storage, 'new-player');
assert.equal(defaults.mode, 'game-voice');
assert.equal(defaults.autoSpeak, true);
values.set('voice-v1', JSON.stringify({mode: 'screen-reader', autoSpeak: false, rate: 1.4, voiceName: 'Svensk', soundSignals: false}));
values.set('voice-v1', JSON.stringify({mode: 'text-only', autoSpeak: false, rate: 1.4, voiceName: 'Svensk', soundSignals: false}));
const migrated = GameVoice.loadSettings(storage, 'voice-v2', 'voice-v1');
assert.equal(migrated.mode, 'game-voice');
assert.equal(migrated.autoSpeak, true);