From dffaed6216e18daa4ce1adaaa178df6624692e47 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sat, 21 Mar 2026 23:17:17 +0100 Subject: [PATCH] [fix](trx-frontend-http): restore select_rig call and simplify play button icon Rig switch needs the server call so SSE/audio follow the selected rig. Play button now uses a fixed triangle icon sized to match header controls. Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stan Grams --- .../trx-frontend-http/assets/web/app.js | 17 ++++++++--------- .../trx-frontend-http/assets/web/index.html | 2 +- .../trx-frontend-http/assets/web/style.css | 4 ++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js index 4e9cdfc..54d2473 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js @@ -3349,9 +3349,6 @@ async function switchRigFromSelect(selectEl) { showHint("Unknown rig", 1500); return; } - // Rig selection is purely client-side: set the per-tab rig_id so all - // subsequent commands target this rig. No server call needed — postPath() - // auto-appends rig_id to every request. const prevRig = lastActiveRigId; lastActiveRigId = selectEl.value; if (prevRig && prevRig !== lastActiveRigId) { @@ -3360,6 +3357,14 @@ async function switchRigFromSelect(selectEl) { updateRigSubtitle(lastActiveRigId); if (typeof setSchedulerRig === "function") setSchedulerRig(lastActiveRigId); if (typeof setBackgroundDecodeRig === "function") setBackgroundDecodeRig(lastActiveRigId); + // Also switch the server's active rig so the SSE stream and audio + // follow. Commands already carry rig_id per-tab, but SSE is still + // global until per-session streams are implemented. + try { + await postPath(`/select_rig?rig_id=${encodeURIComponent(selectEl.value)}`); + } catch (err) { + console.error("select_rig failed:", err); + } showHint(`Rig: ${lastActiveRigId}`, 1500); } @@ -7748,15 +7753,9 @@ txAudioBtn.addEventListener("click", startTxAudio); // Header play button mirrors the RX audio toggle. const headerAudioToggle = document.getElementById("header-audio-toggle"); -const headerAudioIconPath = document.getElementById("header-audio-icon-path"); -const PLAY_ICON = "M5 3.5v9l7-4.5z"; -const STOP_ICON = "M4 3.5h8v9H4z"; function syncHeaderAudioBtn() { if (!headerAudioToggle) return; headerAudioToggle.classList.toggle("audio-active", rxActive); - if (headerAudioIconPath) { - headerAudioIconPath.setAttribute("d", rxActive ? STOP_ICON : PLAY_ICON); - } headerAudioToggle.title = rxActive ? "Stop audio" : "Play audio"; } if (headerAudioToggle) { diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html index 3f4fed0..ddf487a 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html @@ -59,7 +59,7 @@
diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/style.css b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/style.css index c2bc042..32e27f1 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/style.css +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/style.css @@ -1041,6 +1041,10 @@ small { color: var(--text-muted); } cursor: pointer; flex-shrink: 0; } +.header-audio-btn svg { + width: 1rem; + height: 1rem; +} .header-audio-btn.audio-active { color: var(--accent-green); border-color: var(--accent-green);