Summary
call.js, group-call.js, voice-channel.js, and beacon-mesh.js mix WebRTC/mesh protocol state with DOM room UI. Split each into signalling (no DOM) and view (subscribes to signalling events) so ICE bugs and badge bugs are not both “somewhere in the same 1k+ line file”, and signalling becomes Vitest-testable.
Pattern (per domain)
*-signalling.js — WebRTC / mesh protocol only
*-view.js — roster/room render; EventEmitter or callbacks; no direct mutation of signalling internals
Acceptance
Summary
call.js,group-call.js,voice-channel.js, andbeacon-mesh.jsmix WebRTC/mesh protocol state with DOM room UI. Split each into signalling (no DOM) and view (subscribes to signalling events) so ICE bugs and badge bugs are not both “somewhere in the same 1k+ line file”, and signalling becomes Vitest-testable.Pattern (per domain)
*-signalling.js— WebRTC / mesh protocol only*-view.js— roster/room render; EventEmitter or callbacks; no direct mutation of signalling internalsAcceptance