From c50f716390b4c4998071452661fb5a8e23c960ec Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sat, 14 Mar 2026 13:21:04 +0100 Subject: [PATCH] [fix](trx-frontend-http): follow active channel in page title Use the currently tuned virtual channel for the website title\ninstead of always showing channel 0 metadata.\n\nVerification: node --check assets/web/app.js\nVerification: node --check assets/web/plugins/vchan.js\n\nCo-authored-by: OpenAI Codex Signed-off-by: Stan Grams --- .../trx-frontend/trx-frontend-http/assets/web/app.js | 5 +++-- .../trx-frontend-http/assets/web/plugins/vchan.js | 6 ++++++ 2 files changed, 9 insertions(+), 2 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 9ff897a..c390d89 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 @@ -412,11 +412,12 @@ function currentTheme() { } function updateDocumentTitle(rds = null) { - if (!Number.isFinite(lastFreqHz)) { + const freqHz = activeChannelFreqHz(); + if (!Number.isFinite(freqHz)) { document.title = originalTitle; return; } - const parts = [formatFreq(lastFreqHz)]; + const parts = [formatFreq(freqHz)]; const ps = rds?.program_service; if (ps && ps.length > 0) { parts.push(ps); diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/vchan.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/vchan.js index b07c86d..9521e44 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/vchan.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/vchan.js @@ -188,6 +188,9 @@ function vchanRender() { picker.appendChild(addBtn); vchanSyncAccentUI(); + if (typeof updateDocumentTitle === "function" && typeof activeChannelRds === "function") { + updateDocumentTitle(activeChannelRds()); + } vchanRenderSchedulerRelease(); } @@ -389,6 +392,9 @@ function vchanSyncAccentUI() { } else if (typeof _origRefreshFreqDisplay === "function") { _origRefreshFreqDisplay(); } + if (typeof updateDocumentTitle === "function" && typeof activeChannelRds === "function") { + updateDocumentTitle(activeChannelRds()); + } } // Saved reference to the original refreshFreqDisplay from app.js.