my-sea voice: persist the call across in-sea reloads via auto-rejoin; pngquant the RWS card back — TDD

Voice-persistence follow-up (user-spec item 6). Every my-sea navigation is a
full page reload that kills the WebSocket + peer connections; true no-reload
nav would need an SPA refactor of the heavily-tested draw IIFEs. Instead we
auto-rejoin: bindVoiceBtn remembers the active room in sessionStorage on join
and silently re-joins it on the next my-sea page if voice is still available
there (mic permission persists for the session, so no prompt). Same user-
visible result (a brief reconnect, not seamless) with no risk to the draw flows.

- burger-btn.js: sessionStorage 'mysea-voice-room' remember/forget helpers +
  window.mySeaVoiceForget; bindVoiceBtn refactored to startCall()/withVoiceRoom()
  and auto-rejoins on bind when the remembered room === the active btn's room.
  A failed join (e.g. INSECURE_CONTEXT) forgets the room so it doesn't retry.
- _my_sea_gear.html: the NVM-disconnect guard confirm + BYE forget the room
  (and leave the mesh) — an explicit leave shouldn't auto-rejoin.
- BurgerSpec: +4 auto-rejoin specs (match / different-sea / inactive / remember
  + forget). 438 Jasmine specs green.

Also (bundled, user's parallel work): pngquant the resaved RWS deck card back
(tarot-rider-waite-smith-back.png) from 733KB truecolor+a to a 264KB 8-bit
palette PNG, matching its companion card faces. Dimensions preserved (the
rotated 401x694).

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 22:08:45 -04:00
parent 2cbc1bf292
commit c4e738ad16
5 changed files with 171 additions and 19 deletions

View File

@@ -25,7 +25,11 @@ window.mySeaGuardedNav = window.mySeaGuardedNav || function (e, url) {
window.showGuard(
anchor,
'Leave the Sea?<br>Youll disconnect from voice.',
function () { window.location.href = url; }, // confirm
function () { // confirm = leave
if (window.mySeaVoiceForget) window.mySeaVoiceForget();
if (window.VoiceRoom && window.VoiceRoom.leave) window.VoiceRoom.leave();
window.location.href = url;
},
null, // dismiss = stay
{ yesLabel: 'NVM' }
);
@@ -42,7 +46,10 @@ window.mySeaGuardedNav = window.mySeaGuardedNav || function (e, url) {
{% if leave_url %}
<form method="POST" action="{{ leave_url }}" style="display:contents">
{% csrf_token %}
<button type="submit" id="id_my_sea_bye_btn" class="btn btn-abandon">BYE</button>
{# BYE is an explicit leave — forget the room so the destination page #}
{# (and any return to my_sea) doesn't auto-rejoin the dropped call. #}
<button type="submit" id="id_my_sea_bye_btn" class="btn btn-abandon"
onclick="if(window.mySeaVoiceForget)window.mySeaVoiceForget()">BYE</button>
</form>
{% endif %}
</div>