From 1e438acaf730881badf9eded717a570e7695aea2 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sun, 22 Mar 2026 14:20:09 +0100 Subject: [PATCH] [feat](trx-frontend-http): show rig name and location in page title Include active rig display name and nearest city in the browser tab title: "freq - rig name - city, country - trx-rs v". Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stan Grams --- .../trx-frontend/trx-frontend-http/assets/web/app.js | 7 +++++++ 1 file changed, 7 insertions(+) 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 ffb58a4..384b8bd 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 @@ -599,6 +599,7 @@ let sdrSquelchSupported = false; let lastRigIds = []; let lastRigDisplayNames = {}; let lastActiveRigId = null; +let lastCityLabel = ""; let sseSessionId = null; const originalTitle = document.title; const savedTheme = loadSetting("theme", null); @@ -618,6 +619,9 @@ function updateDocumentTitle(rds = null) { if (ps && ps.length > 0) { parts.push(ps); } + const rigName = (lastActiveRigId && lastRigDisplayNames[lastActiveRigId]) || lastActiveRigId || ""; + if (rigName) parts.push(rigName); + if (lastCityLabel) parts.push(lastCityLabel); parts.push(originalTitle); document.title = parts.join(" - "); } @@ -941,6 +945,7 @@ function updateRigSubtitle(activeRigId) { if (!rigSubtitle) return; const name = (activeRigId && lastRigDisplayNames[activeRigId]) || activeRigId || "--"; rigSubtitle.textContent = `Rig: ${name}`; + updateDocumentTitle(activeChannelRds()); } function applyRigList(activeRigId, rigIds, displayNames) { @@ -6443,9 +6448,11 @@ function reverseGeocodeLocation(lat, lon, grid) { const country = addr.country || ""; if (!city && !country) return; const label = city && country ? `${city}, ${country}` : (city || country); + lastCityLabel = label; if (locationSubtitle) { locationSubtitle.textContent = `Location: ${grid} ยท ${label}`; } + updateDocumentTitle(activeChannelRds()); }) .catch(() => {}); }