[fix](trx-frontend-http): show map loading message, sync active rig marker, align recorder actions with bookmarks

- Display "Loading map…" placeholder on first map tab click while
  map-core.js is still loading; hide it once the module initializes.
- Sync receiver marker highlight when switching rigs so the map
  reflects the currently active rig immediately.
- Add "Actions" header to recorder files table and match button
  sizing to bookmarks table style.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-04-04 13:04:42 +02:00
parent 02ed6d918c
commit 9f29876afc
4 changed files with 23 additions and 6 deletions
@@ -3850,6 +3850,7 @@ async function switchRigFromSelect(selectEl) {
if (typeof setSchedulerRig === "function") setSchedulerRig(lastActiveRigId);
if (typeof setBackgroundDecodeRig === "function") setBackgroundDecodeRig(lastActiveRigId);
if (typeof bmFetch === "function") bmFetch(document.getElementById("bm-category-filter")?.value || "");
window.trx.map?.syncAprsReceiverMarker();
// Switch this session's rig and reconnect SSE to the new rig's
// state channel.
try {
@@ -4450,9 +4451,15 @@ function navigateToTab(name, options = {}) {
scheduleSpectrumLayout();
if (typeof window.loadPluginsForTab === "function") window.loadPluginsForTab(name);
if (name === "map") {
window.trx.map?.initAprsMap();
window.trx.map?.sizeAprsMapToViewport();
if (window.trx.map?.aprsMap) setTimeout(() => window.trx.map.aprsMap.invalidateSize(), 50);
const loadingEl = document.getElementById("map-loading");
if (window.trx.map) {
if (loadingEl) loadingEl.style.display = "none";
window.trx.map.initAprsMap();
window.trx.map.sizeAprsMapToViewport();
if (window.trx.map.aprsMap) setTimeout(() => window.trx.map.aprsMap.invalidateSize(), 50);
} else if (loadingEl) {
loadingEl.style.display = "";
}
}
if (name === "statistics") {
window.trx.map?.scheduleStatsRender();
@@ -5833,7 +5840,7 @@ function renderRecorderFiles() {
return;
}
let html = '<table class="recorder-table"><thead><tr><th>File</th><th>Size</th><th></th></tr></thead><tbody>';
let html = '<table class="recorder-table"><thead><tr><th>File</th><th>Size</th><th>Actions</th></tr></thead><tbody>';
for (const f of page) {
const safeName = escapeMapHtml(f.name);
const encodedName = encodeURIComponent(f.name);
@@ -977,6 +977,7 @@
</div>
</div>
<div id="tab-map" class="tab-panel" data-tab="map" style="display:none;">
<div id="map-loading" class="map-loading-msg">Loading map&hellip;</div>
<template id="tmpl-map">
<div id="map-stage">
<div class="map-overlay-panel">
@@ -3428,6 +3428,8 @@
function autoInitIfVisible() {
const panel = document.getElementById("tab-map");
if (panel && panel.style.display !== "none") {
const loadingEl = document.getElementById("map-loading");
if (loadingEl) loadingEl.style.display = "none";
initAprsMap();
sizeAprsMapToViewport();
if (aprsMap) setTimeout(() => aprsMap.invalidateSize(), 50);
@@ -1263,7 +1263,6 @@ small { color: var(--text-muted); }
box-sizing: border-box;
margin: 0;
padding: 0.2rem 0.5rem;
height: 1.65rem;
font-size: 0.78rem;
font-family: inherit;
line-height: 1.4;
@@ -1274,7 +1273,6 @@ small { color: var(--text-muted); }
background: var(--btn-bg);
color: var(--text);
cursor: pointer;
transition: background-color 100ms ease, border-color 100ms ease, color 100ms ease, box-shadow 100ms ease;
}
.recorder-table .rec-file-btn:hover { background: color-mix(in srgb, var(--btn-bg) 75%, var(--accent-green)); border-color: color-mix(in srgb, var(--btn-border) 60%, var(--accent-green)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-green) 18%, transparent); }
.recorder-table .rec-file-btn:active { background: color-mix(in srgb, var(--btn-bg) 55%, var(--accent-green)); border-color: var(--accent-green); box-shadow: none; transform: translateY(1px); }
@@ -1704,6 +1702,15 @@ small { color: var(--text-muted); }
min-height: 0;
gap: 0.85rem;
}
.map-loading-msg {
display: flex;
align-items: center;
justify-content: center;
height: 60vh;
font-size: 1.1rem;
color: var(--text-secondary);
opacity: 0.8;
}
#map-stage {
position: relative;
flex: 0 1 auto;