From 27fea30680fe7e55d80eb0cfec7b937050712535 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Wed, 3 Jun 2026 11:19:04 -0400 Subject: [PATCH] zebra-spaces: log clicks on share/stop buttons + their state Diagnostic-only: logLine fires on every share/stop button click with the current sfuXPC/sfuXStream truthiness so the telemetry channel shows whether (a) the click reached the JS at all, (b) the unpublish function bailed at its 'nothing to do' early return, or (c) it actually entered the close path. Helps diagnose the 'stop sharing doesn't work' report without copy-pasting. --- web/zebra-spaces.html | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index c8e74f5..a3feb84 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -3470,10 +3470,19 @@ function renderRoom(){ * ================================================================== */ $('btn-raise').addEventListener('click', () => { send({ type:'raise-hand' }); }); $('btn-lower').addEventListener('click', () => { send({ type:'lower-hand' }); }); -$('btn-screen-share').addEventListener('click', () => { sfuPublishScreen().catch(e => logLine('err','screen share: '+e.message)); }); -$('btn-screen-stop').addEventListener('click', () => { sfuUnpublishScreen(); }); -$('btn-camera-share').addEventListener('click', () => { sfuPublishCamera().catch(e => logLine('err','camera share: '+e.message)); }); -$('btn-camera-stop').addEventListener('click', () => { sfuUnpublishCamera(); }); +$('btn-screen-share').addEventListener('click', () => { logLine('', 'click: btn-screen-share'); sfuPublishScreen().catch(e => logLine('err','screen share: '+e.message)); }); +$('btn-screen-stop').addEventListener('click', () => { + /* click telemetry — the 'screen share stopped' line lower in + * sfuUnpublishScreen only fires AFTER the early-return, so logging + * here lets us see whether the click reached the handler at all. */ + logLine('', 'click: btn-screen-stop (sfuScreenPC='+(!!sfuScreenPC)+' sfuScreenStream='+(!!sfuScreenStream)+')'); + sfuUnpublishScreen(); +}); +$('btn-camera-share').addEventListener('click', () => { logLine('', 'click: btn-camera-share'); sfuPublishCamera().catch(e => logLine('err','camera share: '+e.message)); }); +$('btn-camera-stop').addEventListener('click', () => { + logLine('', 'click: btn-camera-stop (sfuCameraPC='+(!!sfuCameraPC)+' sfuCameraStream='+(!!sfuCameraStream)+')'); + sfuUnpublishCamera(); +}); $('camera-select').addEventListener('change', async (e) => { cameraDeviceId = e.target.value; try { localStorage.setItem(CAM_DEV_KEY, cameraDeviceId); } catch(_){} @@ -3880,8 +3889,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');