[feat](trx-frontend-http): sync mode picker to active virtual channel

- Add vchanSyncModeDisplay() in vchan.js; called from vchanSyncAccentUI()
  and vchanSubscribe() so the mode picker always reflects the active
  virtual channel's mode on switch and on channel-list refresh
- Guard the rig-state mode picker update in render() so it is skipped
  when vchanIsOnVirtual() is true, preventing primary-channel mode from
  overwriting the virtual channel selection

Note: per-channel audio and decoder output require server-side protocol
changes (separate Opus streams per virtual channel) and are not yet
implemented.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-11 07:37:52 +01:00
parent 3d284abab6
commit 28036ab589
2 changed files with 20 additions and 1 deletions
@@ -2445,7 +2445,12 @@ function render(update) {
if (update.status && update.status.mode) {
const mode = normalizeMode(update.status.mode);
const modeUpper = mode ? mode.toUpperCase() : "";
modeEl.value = modeUpper;
// When subscribed to a virtual channel the mode picker must reflect
// that channel's mode, not the primary rig mode. Skip the update here;
// vchan.js will apply the correct mode via vchanSyncModeDisplay().
if (typeof vchanIsOnVirtual !== "function" || !vchanIsOnVirtual()) {
modeEl.value = modeUpper;
}
if (modeUpper === "WFM" && lastModeName !== "WFM") {
setJogDivisor(10);
resetRdsDisplay();