Add optional local table sound controls

Connect browser-local mute, keyboard volume and a test sample with short original Web Audio cues for public phase/status/turn changes and tagged automatic actions. Audio consumes only projected sequences and public phase identity, with no game actions, private eligibility checks, media requests or saved-game writes. Preferences default off at 35%, survive refresh and synchronize across same-origin tabs.

Silent initial snapshots, stale sequence rejection, batch priority and a 700ms cooldown avoid historical replay and queued bursts. User gestures unlock audio; hidden tabs stay silent. Mute, backgrounding and unmount stop active voices, pending unlocks are cancelled, and unavailable audio remains cosmetic. Existing automatic visual notices and AI pacing remain independent.

Six focused regressions cover cursor consumption, phase priority, room changes, bounded volume and voices, unlock cancellation, disposal, unavailable audio and accessible initial controls. Independent review found a mobile panel overflow; the corrected panel stayed inside the viewport in DOM measurements. Browser controls verified enable/mute, keyboard volume, zero-volume disabling, refresh restoration and cross-tab preference updates. Preferences were restored to off/35%. Physical output and screenshot acceptance remain unverified because screenshot capture timed out. Broader event coverage and final sound design remain unfinished.

Types, lint and 4856 offline tests plus production build pass on the unchanged source fingerprint below. The first broad check found the accessibility linter's semantic-output requirement; the status element was corrected before the final checks. HTTP/AI calibration runs were not repeated for this cosmetic-only change.

All 1,072 saved games, 2,243 seats and original recovery/entry/handover records match the pre-outage backup; SQLite quick-check and foreign keys pass. The responding server and isolated browser seat were reused after the latest outage, without resetting games or creating automation. Mode and publication gates remain closed.

Verified source tree: da84d2cc4ed5b0face56afb034857b85c52708e11d86ff3f1cb3c8abdeee99d0
This commit is contained in:
Quintine committed 2026-09-20 11:15:43 +10:00
1 parent 62e87d2b96
commit bfa24b0c4a
10 files changed
+532 -17

No files matched your search

+24
View File
@@ -214,6 +214,7 @@ export const RULE_TOPICS: RuleTopic[] = [
'automatic-responses',
'automatic-decisions',
'ai-pacing',
'table-sounds',
'seat-handover',
'ecaz-modules',
'discoveries',
@@ -221,6 +222,29 @@ export const RULE_TOPICS: RuleTopic[] = [
'advanced-combat',
],
},
{
id: 'table-sounds',
title: 'Sound effects',
category: 'Getting started',
coverage: 'Partial',
developmentStage: 'Prototyped',
summary: 'Optional short cues for phase changes and automatic actions, with local mute and volume controls.',
steps: [
'Open Sound effects in the table header to enable or mute audio, change its volume or test a sample. Sound starts off. Preferences stay in this browser and are shared by its tabs.',
'One short tone marks a new automatic action notice. Two tones mark a phase, turn or game-status change. Several updates arriving together produce at most one cue.',
'Sound and automatic visual notices have separate controls. Muting sound does not hide notices or change AI pacing.',
'Refresh restores your preference without replaying old events. Click or press a key to allow future sounds after refresh. Background tabs stay silent and do not queue old sounds.',
'Volume zero is silent and disables Test sound. Muting stops current tones. If audio is unavailable, play continues normally; cues never reveal concealed cards or decisions.',
],
related: ['automatic-casualties', 'ai-pacing', 'privacy', 'implementation-checklist'],
checklist: [
{ area: 'Implementation', status: 'Partial', detail: 'Local synthesized phase and tagged automatic-action cues are connected; broader event coverage and final sound design remain unfinished.' },
{ area: 'Player controls', status: 'Implemented', detail: 'Mute, keyboard volume, test sample and refresh-persistent browser preferences.' },
{ area: 'AI', status: 'Implemented', detail: 'Existing projected human and AI updates share the same cosmetic cues without changing legal actions or pacing.' },
{ area: 'Documentation', status: 'Implemented', detail: 'This guide explains preferences, browser activation, background silence and unavailable audio.' },
{ area: 'Verification', status: 'Partial', detail: 'Focused cursor/audio checks and browser preference controls; physical output and broader browser acceptance remain open.', evidence: ['tests/table-sound.test.tsx'] },
],
},
{
id: 'seat-handover',
title: 'Pass a seat to another player',