my-sea voice: voice-btn glow/pulse state machine (sea-precedence, pulse-while-alone, 2x on 2nd party) — TDD

Phase 3 of the my-sea voice batch (user-spec 2026-05-29). A --quaUser/--ninUser
glow + pulse machine for the burger btn + its voice sub-btn, driven by the
voice sub-btn availability (voice_active) + the live mesh state.

- voice-mesh.js: VoiceRoom gains a state-change hook — setOnStateChange(cb) +
  peerCount() + _notify({inCall, peerCount, muted}), fired on join, every peer
  add/drop, mute toggle, and teardown. No behaviour change without a subscriber
  (VoiceMeshSpec stays green).
- voice-glow.js (new): the glow machine. PRE-JOIN nudge — burger glows when the
  fan is closed (sea draw-nudge keeps burger precedence; voice reclaims it once
  the sea glow clears), voice sub-btn glows when the fan opens. LIVE — the glow
  PULSES on whichever surface shows (voice sub-btn fan-open, burger fan-closed):
  base 2s cadence while alone, doubled (.voice-pulse--fast) once a 2nd party
  connects (equalizer stand-in; a true volume-reactive equalizer is a live-only
  enhancement). Class writes are reconciled (idempotent) so the burger-class
  MutationObserver doesn't feed back on itself.
- _burger.scss: .voice-glow + @keyframes voice-pulse + .voice-pulse(--fast).
- loaded on my_sea.html + my_sea_visit.html (after burger-btn.js).
- VoiceGlowSpec.js (18 specs) + registered in SpecRunner; MySeaSeatsSpec flare
  window updated 1.5s → 2s (Phase 2 bump). 428 Jasmine specs green.

Live-verify on staging: the actual glow colours/cadence + the equalizer
upgrade (item 5) and disconnect states (item 7) land in later phases.

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-05-29 21:06:02 -04:00
parent 7bd8e3256a
commit b021d8017c
11 changed files with 519 additions and 2 deletions

View File

@@ -1112,6 +1112,10 @@
{% include "apps/gameboard/_partials/_my_sea_bud_panel.html" %}
{% include "apps/gameboard/_partials/_burger.html" %}
<script src="{% static 'apps/epic/burger-btn.js' %}"></script>
{# Voice-affordance glow/pulse machine (keys on voice_active + the live #}
{# mesh state). Coexists w. the sea-btn glow-handoff machine below — #}
{# sea takes burger precedence; voice is the second-place reveal. #}
<script src="{% static 'apps/voice/voice-glow.js' %}"></script>
{# Phase 2 of the Sea sub-btn rollout — wires #id_sea_btn click to #}
{# open #id_sea_spread_modal. AUTO DRAW + Escape + backdrop click #}

View File

@@ -87,6 +87,9 @@
{% block scripts %}
<script src="{% static 'apps/gameboard/my-sea-seats.js' %}"></script>
<script src="{% static 'apps/epic/burger-btn.js' %}"></script>
{# Voice-affordance glow/pulse machine — keys on the voice sub-btn's #}
{# availability + the live mesh state (VoiceRoom.setOnStateChange). #}
<script src="{% static 'apps/voice/voice-glow.js' %}"></script>
{% if seat2_present %}
{# Read-only cross stage — StageCard + SeaDeal bind to #id_sea_overlay #}
{# (inside #id_my_sea_visit_draw) for click→stage + SPIN + FYI + hover. #}