[fix](trx-frontend-http): fix APRS bar coords visibility, cap at 5 entries

Coordinates were clipped by white-space:nowrap on the frame row.
Split each frame into a .aprs-bar-frame-main line (nowrap+ellipsis)
and a separate .aprs-bar-frame-pos line for the coordinate button,
so coordinates are always visible regardless of info length.
Restore 5-entry cap (slice from history).

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-01 14:51:02 +01:00
parent 5987a0b4a8
commit 7c810729ed
2 changed files with 16 additions and 5 deletions
@@ -107,7 +107,7 @@ function applyAprsFilterToAll() {
function updateAprsBar() {
if (!aprsBarOverlay) return;
const isPkt = (document.getElementById("mode")?.value || "").toUpperCase() === "PKT";
const okFrames = aprsPacketHistory.filter((p) => p.crcOk);
const okFrames = aprsPacketHistory.filter((p) => p.crcOk).slice(0, 5);
if (!isPkt || okFrames.length === 0) {
aprsBarOverlay.style.display = "none";
return;
@@ -119,9 +119,12 @@ function updateAprsBar() {
const dest = escapeMapHtml(pkt.destCall || "");
const info = escapeMapHtml(pkt.info || "");
const posHtml = pkt.lat != null && pkt.lon != null
? ` <button class="aprs-bar-pos" onclick="window.navigateToAprsMap(${pkt.lat},${pkt.lon})">${pkt.lat.toFixed(4)}, ${pkt.lon.toFixed(4)}</button>`
? `<button class="aprs-bar-pos" onclick="window.navigateToAprsMap(${pkt.lat},${pkt.lon})">${pkt.lat.toFixed(4)}, ${pkt.lon.toFixed(4)}</button>`
: "";
html += `<div class="aprs-bar-frame">${ts}${call}>${dest}: ${info}${posHtml}</div>`;
html += `<div class="aprs-bar-frame">` +
`<div class="aprs-bar-frame-main">${ts}${call}>${dest}: ${info}</div>` +
(posHtml ? `<div class="aprs-bar-frame-pos">${posHtml}</div>` : "") +
`</div>`;
}
aprsBarOverlay.innerHTML = html;
aprsBarOverlay.style.display = "flex";
@@ -680,11 +680,19 @@ small { color: var(--text-muted); }
.aprs-bar-frame {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: clamp(0.58rem, 1.05vw, 0.74rem);
display: flex;
flex-direction: column;
line-height: 1.45;
opacity: 1;
}
.aprs-bar-frame-main {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1.45;
opacity: 1;
}
.aprs-bar-frame-pos {
display: block;
white-space: nowrap;
}
.aprs-bar-frame + .aprs-bar-frame {
opacity: 0.72;