From 4e9516871f13ae27461526651a55b1ea84c3ff78 Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Sat, 28 Feb 2026 01:37:04 +0100 Subject: [PATCH] [feat](trx-frontend-http): improve mobile UX and fix S0/S9 label offset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add viewport meta tag so mobile browsers use device width instead of the default 980px desktop viewport - Add 520px breakpoint: remove controls-tray forced min-width (was 52–58rem, causing horizontal scroll on phones), stack controls-row into a single column with jog wheel first (order: -1) - Scale frequency DSEG14 display with clamp() on narrow screens - Make volume sliders responsive width with larger 20px thumb - Raise spectrum Set/Auto button and input heights to 2.2rem (overrides the min-height: 0 that blocked the existing 760px touch-size rule) - Add overflow-x: auto + flex-shrink: 0 to sub-tab-bar so all six plugin tabs are reachable on small screens without clipping - Swap spectrum hint text based on input device: mouse/keyboard hint hidden on touch devices, touch-specific hint shown instead - Offset S0/S9/S9+ signal history labels 6px below their grid lines Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: Stan Grams --- .../trx-frontend-http/assets/web/app.js | 2 +- .../trx-frontend-http/assets/web/index.html | 4 +- .../trx-frontend-http/assets/web/style.css | 56 ++++++++++++++++++- 3 files changed, 57 insertions(+), 5 deletions(-) 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 19b583e..edb216b 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 @@ -654,7 +654,7 @@ function drawOverviewSignalHistory(ctx, w, h, isLight) { ctx.moveTo(0, y); ctx.lineTo(w, y); ctx.stroke(); - ctx.fillText(marker.label, w - 6, Math.max(8, Math.min(h - 8, y))); + ctx.fillText(marker.label, w - 6, Math.max(8, Math.min(h - 8, y + 6))); } ctx.beginPath(); diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html index b287f07..081f41c 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/index.html @@ -2,6 +2,7 @@ + trx-rs v{ver} @@ -84,7 +85,8 @@ -
Scroll to zoom · Ctrl+Scroll to tune · Drag to pan · Drag BW edges to resize
+
Scroll to zoom · Ctrl+Scroll to tune · Drag to pan · Drag BW edges to resize
+
Pinch to zoom · Drag to pan · Drag BW edges to resize
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 693a669..1fc59eb 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 @@ -605,8 +605,8 @@ small { color: var(--text-muted); } transition: width 100ms ease; } -.sub-tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; } -.sub-tab { background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 0.35rem 0.75rem; color: var(--text-muted); cursor: pointer; font-size: 0.85rem; height: auto; } +.sub-tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; overflow-x: auto; -webkit-overflow-scrolling: touch; } +.sub-tab { flex-shrink: 0; background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 0.35rem 0.75rem; color: var(--text-muted); cursor: pointer; font-size: 0.85rem; height: auto; } .sub-tab.active { border-bottom-color: var(--accent-green); color: var(--accent-green); font-weight: 600; } .sub-tab:hover:not(.active) { color: var(--text); } #aprs-map { min-height: 150px; border-radius: 6px; } @@ -830,10 +830,60 @@ button:focus-visible, input:focus-visible, select:focus-visible { padding: 0 8px; font-size: 0.73rem; } -#spectrum-hint { +.spectrum-hint-mouse, +.spectrum-hint-touch { font-size: 0.68rem; color: var(--text-muted); text-align: right; margin-top: 2px; opacity: 0.6; } +/* Show correct hint based on input device */ +.spectrum-hint-touch { display: none; } +@media (hover: none) and (pointer: coarse) { + .spectrum-hint-mouse { display: none; } + .spectrum-hint-touch { display: block; } +} + +/* ── Phone layout (≤ 520px) ───────────────────────────────────────────── */ +@media (max-width: 520px) { + /* Remove forced min-width — no horizontal scroll on phones */ + .controls-tray { + width: 100%; + } + + /* Single-column controls: jog first, then mode, then power */ + .controls-row { + grid-template-columns: 1fr; + } + .controls-col-center { + order: -1; + justify-self: center; + width: auto; + } + .controls-col-center::after { display: none; } + .controls-col.label-below-col .inline, + .controls-col.label-below-col .btn-grid { margin-top: 0; } + + /* Scale frequency display to fit narrow screens */ + #freq { font-size: clamp(1.3rem, 6vw, 2rem); } + + /* Wider volume sliders for touch */ + .vol-slider { width: clamp(80px, 35vw, 140px); } + .vol-slider::-webkit-slider-thumb { width: 20px; height: 20px; } + .vol-slider::-moz-range-thumb { width: 20px; height: 20px; } + + /* Spectrum control inputs and buttons: meet minimum tap-target size */ + #spectrum-bw-input, + #spectrum-floor-input { + height: 2.2rem; + font-size: 0.82rem; + } + #spectrum-bw-set-btn, + #spectrum-auto-btn { + height: 2.2rem; + min-height: 0; + padding: 0 10px; + font-size: 0.82rem; + } +}