From 5987a0b4a89cc49abdb46c2d800685ae081de1f0 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sun, 1 Mar 2026 14:49:48 +0100 Subject: [PATCH] [feat](trx-frontend-http): add Clear button to APRS bar overlay Small pill-shaped button in the header row, right-aligned. Clicking it delegates to the existing aprs-clear-btn, clearing history, the packet panel, and the bar in one shot. Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Stan Grams --- .../assets/web/plugins/aprs.js | 5 ++++- .../trx-frontend-http/assets/web/style.css | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/aprs.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/aprs.js index e63d8e5..a139162 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/aprs.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/aprs.js @@ -112,7 +112,7 @@ function updateAprsBar() { aprsBarOverlay.style.display = "none"; return; } - let html = '
APRS
'; + let html = '
APRS
'; for (const pkt of okFrames) { const ts = pkt._ts ? `${pkt._ts}` : ""; const call = `${escapeMapHtml(pkt.srcCall)}`; @@ -127,6 +127,9 @@ function updateAprsBar() { aprsBarOverlay.style.display = "flex"; } window.updateAprsBar = updateAprsBar; +window.clearAprsBar = function() { + document.getElementById("aprs-clear-btn")?.click(); +}; function addAprsPacket(pkt) { const tag = pkt.crcOk ? "[APRS]" : "[APRS-CRC-FAIL]"; 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 e8a37d2..76f2acb 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 @@ -646,6 +646,9 @@ small { color: var(--text-muted); } gap: 0.1rem; } .aprs-bar-header { + display: flex; + align-items: center; + justify-content: space-between; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: clamp(0.52rem, 0.95vw, 0.66rem); font-weight: 700; @@ -655,6 +658,25 @@ small { color: var(--text-muted); } margin-bottom: 0.12rem; opacity: 0.85; } +.aprs-bar-clear { + background: none; + border: 1px solid color-mix(in srgb, var(--accent-green) 40%, transparent); + border-radius: 999px; + padding: 0.05rem 0.45rem; + font-family: inherit; + font-size: inherit; + font-weight: 600; + letter-spacing: 0.06em; + color: var(--accent-green); + cursor: pointer; + opacity: 0.7; + text-transform: uppercase; + transition: opacity 120ms, background 120ms; +} +.aprs-bar-clear:hover { + opacity: 1; + background: color-mix(in srgb, var(--accent-green) 12%, transparent); +} .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);