From ab0003b08d4d978d46d23212f9d37d8aa276fd50 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Thu, 26 Mar 2026 18:36:08 +0100 Subject: [PATCH] [feat](trx-frontend-http): show receiver/locator on map panel stat cards Co-Authored-By: Claude Opus 4.6 Signed-off-by: Stan Grams --- .../trx-frontend-http/assets/web/app.js | 39 +++++++++++++++++++ .../trx-frontend-http/assets/web/style.css | 7 ++++ 2 files changed, 46 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 d544e0d..dcc38dc 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 @@ -6713,6 +6713,7 @@ function rebuildDecodeContactPaths() { sourceType: entry.sourceType, tsMs, bandLabel: band?.label || null, + remote: detail?.remote || null, }); } } @@ -6743,11 +6744,23 @@ function rebuildDecodeContactPaths() { distanceText: formatDecodeContactDistance(distanceKm), line: null, labelMarker: null, + remote: msg.remote, }); } syncDecodeContactPathVisibility(); } +function _receiverLabel(rigId) { + if (!rigId) return null; + const rig = serverRigs.find(r => r.remote === rigId); + const name = lastRigDisplayNames[rigId] || rigId; + if (rig && rig.latitude != null && rig.longitude != null) { + const grid = latLonToMaidenhead(rig.latitude, rig.longitude); + return `${name} (${grid})`; + } + return name; +} + function renderMapQsoSummary() { const listEl = document.getElementById("map-qso-summary-list"); if (!listEl) return; @@ -6835,6 +6848,14 @@ function renderMapQsoSummary() { meta.appendChild(age); } + const rxLabel = _receiverLabel(entry.remote); + if (rxLabel) { + const rx = document.createElement("span"); + rx.className = "map-qso-card-pill map-qso-card-rx"; + rx.textContent = rxLabel; + meta.appendChild(rx); + } + body.appendChild(meta); const grids = document.createElement("div"); @@ -6873,6 +6894,7 @@ function renderMapSignalSummary() { grid: entry.grid, sourceType: entry.sourceType, bandLabel: bandForHz(Number(detail?.freq_hz))?.label || null, + remote: detail?.remote || null, }); } } @@ -6950,6 +6972,14 @@ function renderMapSignalSummary() { meta.appendChild(age); } + const rxLabel = _receiverLabel(entry.remote); + if (rxLabel) { + const rx = document.createElement("span"); + rx.className = "map-qso-card-pill map-qso-card-rx"; + rx.textContent = rxLabel; + meta.appendChild(rx); + } + body.appendChild(meta); const grids = document.createElement("div"); @@ -6987,6 +7017,7 @@ function renderMapWeakSignalSummary() { grid: entry.grid, sourceType: entry.sourceType, bandLabel: bandForHz(Number(detail?.freq_hz))?.label || null, + remote: detail?.remote || null, }); } } @@ -7064,6 +7095,14 @@ function renderMapWeakSignalSummary() { meta.appendChild(age); } + const rxLabel = _receiverLabel(entry.remote); + if (rxLabel) { + const rx = document.createElement("span"); + rx.className = "map-qso-card-pill map-qso-card-rx"; + rx.textContent = rxLabel; + meta.appendChild(rx); + } + body.appendChild(meta); const grids = document.createElement("div"); 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 c86a219..9f9ac1d 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 @@ -1623,6 +1623,13 @@ button.map-qso-card:focus-visible { border-color: color-mix(in srgb, var(--band-color, var(--accent-green)) 40%, transparent); background: color-mix(in srgb, var(--band-color, var(--accent-green)) 14%, transparent); } +.map-qso-card-rx { + text-transform: none; + font-weight: 600; + color: var(--text-muted); + border-color: color-mix(in srgb, var(--accent-blue, #5b9bd5) 35%, transparent); + background: color-mix(in srgb, var(--accent-blue, #5b9bd5) 10%, transparent); +} .map-overlay-panel { position: absolute; right: 0.7rem;