Commit Graph

1324 Commits

Author SHA1 Message Date
sjg 127da19856 [fix](trx-frontend-http): unify Delete Selected button styling with other toolbar buttons
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 21:14:58 +01:00
sjg 65c59e55e4 [fix](trx-frontend-http): separate bookmark overlay list from editor list
Scope picker filters the bookmarks table for editing. Spectrum and map
always show merged general + active rig bookmarks via bmOverlayList.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 21:12:59 +01:00
sjg a00b1d216a [fix](trx-frontend-http): show trx-client version in header, remove version info from footer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 21:08:41 +01:00
sjg 68449425be [fix](trx-frontend-http): always list rig-specific and general bookmarks together
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 21:05:47 +01:00
sjg e52d276198 [fix](trx-frontend-http): use display names in header rig picker
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 21:04:15 +01:00
sjg eb798ad79f [feat](trx-frontend-http): merge general bookmarks into rig view, fix button styling, improve rig display names
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 21:02:08 +01:00
sjg de5f27f75e [feat](trx-frontend-http): add Select All bookmarks across pages, fix move wrap styling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 20:52:01 +01:00
sjg abe8529332 [feat](trx-frontend-http): add batch move bookmarks between scopes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 20:47:32 +01:00
sjg 8c44a1b5f2 [fix](trx-frontend-http): scope server-lost overlay to content area, keep header accessible
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 20:43:15 +01:00
sjg dc271c1fdb chore(trx-rs): remove WIP.md, all items implemented
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 20:31:56 +01:00
sjg 55266bf83e [fix](trx-frontend-http): add Default impl for BookmarkStoreMap, merge bookmarks in scheduler
Fix clippy warning by adding Default impl for BookmarkStoreMap. Scheduler
bookmark picker now fetches both general and rig-specific bookmarks and
merges them so all available bookmarks are shown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 20:26:55 +01:00
sjg 55688a27b2 [feat](trx-frontend-http): per-rig bookmarks, scheduler, and decode filtering
Two-tier bookmark system: general bookmarks shared across all rigs plus
rig-specific bookmarks with scope picker in the Bookmarks tab. Scheduler
storage split into per-rig files with migration from legacy single file.
Decode history tagged with rig_id and filterable via ?remote= on
/decode/history endpoint. Decode SSE reconnects on rig switch to refresh
filtered history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 20:24:49 +01:00
sjg b50c6bca96 chore(trx-rs): add WIP.md
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 08:52:01 +01:00
sjg e46189e9ac [fix](trx-client): use send_replace for per-rig audio stream info
watch::Sender::send() silently discards the value when receiver_count
is zero.  The per-rig info channel is created with watch::channel().0
which drops the only Receiver, so the first send(Some(info)) after TCP
connect returns early without storing the value.  Later subscribers
see None forever.  send_replace() stores unconditionally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 08:39:29 +01:00
sjg 7e447ab1f6 [fix](trx-frontend-http): drop global info_rx fallback for vchan audio
Use only the per-rig stream info when a remote is specified on the
channel audio path; do not fall back to the global channel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 08:03:07 +01:00
sjg 723e3ad7cb [fix](trx-client): preserve per-rig stream info across audio reconnects
The audio client was clearing per_rig_info_tx to None every time the
TCP connection dropped, even during transient reconnect cycles.  This
caused WebSocket clients subscribing to per-rig audio to stall
indefinitely waiting for stream info that would only arrive after the
next successful reconnect.

Move the None send to the permanent shutdown path only.  The last-known
stream info remains valid for the same rig across reconnects.

Also revert the global info_rx fallback from 6e4c5e3 since the root
cause is now fixed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 08:00:13 +01:00
sjg 6e4c5e3c72 [fix](trx-frontend-http): fall back to global stream info for per-rig audio
Per-rig info_rx watch channel is transiently None when the rig's audio
TCP connection is between reconnect cycles.  This caused the WebSocket
handler to hang indefinitely waiting for stream info that might never
arrive, regressed in 7d76606.

Prefer the per-rig info_rx when it holds a value, otherwise fall back to
the global info channel (the pre-regression behaviour).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 07:55:09 +01:00
sjg cfc8407c3a [chore](trx-frontend-http): add debug logging to audio WebSocket handler
Trace per-rig audio subscription lookup, stream info availability, and
session lifecycle to diagnose multi-rig audio regression.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 07:50:14 +01:00
sjg 80ed1155f5 [fix](trx-frontend-http): scope channel audio by remote
Send the selected remote together with virtual-channel audio requests and use per-rig stream info when /audio is opened with channel_id.

This keeps browser channel audio aligned with the requested remote after the recent multi-rig client changes.

Add coverage for parsing channel_id together with remote.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-24 07:29:57 +01:00
sjg db5fa26bd9 [fix](trx-frontend-http): start browser audio on user gesture
Create and resume the RX AudioContext from the audio button click so Chromium does not leave playback suspended until a later interaction.

Reuse that context when stream metadata arrives instead of recreating it from the WebSocket message path.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 22:52:28 +01:00
sjg 32e1618384 [fix](trx-frontend-http): drop rig_id http aliases
Remove the remaining legacy rig_id aliases across the HTTP frontend and use remote consistently for scheduler and audio requests.

Disable browser caching for the HTML, CSS, and JS assets so clients pick up the parameter rename immediately instead of running stale frontend code.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 22:49:01 +01:00
sjg 7d76606927 [fix](trx-frontend-http): accept remote on audio endpoint
Parse the renamed `remote` query parameter on `/audio` while keeping
`rig_id` as a compatibility alias, and use per-rig stream info for
rig-scoped audio subscriptions.

Add tests covering both query names.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 22:31:04 +01:00
sjg b8ce05d41e [fix](trx-client): isolate selected state per server group
Keep global state and spectrum updates scoped to the server group that
owns the selected short name, so other servers cannot overwrite the UI
or clear the active spectrum stream.

Add regression tests for cross-server selection and spectrum ownership.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 22:23:22 +01:00
sjg fad63be247 [fix](trx-client): keep multi-server rigs in audio cache
Merge per-server GetRigs updates into the shared remote rig cache
instead of replacing it, so audio tasks from other servers are not
torn down on each poll cycle.

Add a regression test covering the multi-server cache update path.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 22:18:50 +01:00
sjg e09f14d2d3 [feat](trx-client): support audio URL overrides
Use full audio endpoint URLs for trx-server audio connections while
preserving server-advertised ports and legacy port-based fallback for
backward compatibility.

Add `server_url` and per-remote `rig_urls` config entries, plus
validation and tests for audio URL parsing and address resolution.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 22:04:14 +01:00
sjg d8444f35f6 [refactor](trx-frontend-http): rename rig_id API fields to remote
Rename HTTP query params, JSON fields, and scheduler payloads to
use remote names consistently while still accepting legacy `rig_id`
inputs through serde aliases.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 21:54:45 +01:00
sjg 2db13da706 [fix](trx-client): use default remote name in config
Use the remote short name for the HTTP frontend default selection and
keep `default_rig_id` as a serde alias for backward compatibility.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 21:54:37 +01:00
sjg 9cd172ce64 [feat](trx-client): support multiple trx-servers from a single client
Introduce [[remotes]] config array where each entry maps a user-chosen
short name to a (server URL, rig_id) pair. Short names replace raw
rig_ids as the universal key throughout frontends, audio routing, and
state management, allowing rig_ids to safely collide across servers.

Entries sharing the same server URL and token share a single TCP
connection. A request routing dispatcher forwards frontend commands to
the correct per-server channel based on the short name.

Legacy [remote] config and CLI --url are preserved via automatic
fallback to a single-entry remotes list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-23 21:00:31 +01:00
sjg 1e438acaf7 [feat](trx-frontend-http): show rig name and location in page title
Include active rig display name and nearest city in the browser tab
title: "freq - rig name - city, country - trx-rs v<version>".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 14:20:09 +01:00
sjg 6c8d294f6a [chore](docs): upgrade docs
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 14:15:51 +01:00
sjg eb97d8379d [chore](trx-rs): remove MANUAL.md - moved to docs/ (wiki submodule)
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 14:15:25 +01:00
sjg 182240faa8 [docs](trx-rs): add threshold selection guide to MANUAL.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 14:14:04 +01:00
sjg a5a654d508 [docs](trx-rs): add noise blanker section to MANUAL.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 14:11:26 +01:00
sjg 1f6e3bb142 [feat](trx-frontend-http): add noise blanker controls to SDR settings UI
Add checkbox to enable/disable NB and number input for threshold (1-100).
Controls are hidden by default and shown when the server reports NB support
via SSE filter state updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 14:05:14 +01:00
sjg 189d27bac8 [feat](trx-rs): add configurable noise blanker for SoapySDR backend
IQ-domain impulse noise blanker using exponential-smoothing RMS tracker. Samples exceeding threshold × running RMS are replaced with the last clean sample. Configurable via [sdr.noise_blanker] in TOML config and runtime via POST /set_sdr_noise_blanker API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 13:54:17 +01:00
sjg 01a6b331f6 [fix](trx-frontend-http): invalidate bookmark colors on style change too
The bookmark color palette is derived from CSS variables (--accent-yellow,
--accent-green, etc.) which change on both dark/light theme toggle AND
palette style change (arctic, lime, etc.). The previous fix only covered
setTheme; extract invalidateBookmarkColors() and call it from setStyle
as well so bookmark chips recolour on any visual change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 12:12:09 +01:00
sjg f9f06a1db1 [fix](trx-frontend-http): force style recalc before reading bookmark theme colors
getComputedStyle may return stale CSS variable values if the browser
has not flushed the style recalculation after changing data-theme. Force
a recalc by reading a property value first. Also clear cached bookmark
DOM keys so the next draw pass rebuilds chips from scratch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 09:42:41 +01:00
sjg 2d1f635019 [fix](trx-frontend-http): directly re-apply bookmark chip colors on theme change
Bumping bmRevision and scheduling a spectrum draw was not enough because
the spectrum draw path only runs when spectrum data is present. Instead,
directly update --bm-cat-bg/--bm-cat-fg on all existing bookmark chips
from the new theme palette so colors update immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 09:29:50 +01:00
sjg 4d09636793 [fix](trx-frontend-http): guard scheduleSpectrumDraw from TDZ during init
scheduleSpectrumDraw references a let-bound variable that hasn't been
initialized yet when setTheme runs at startup. Wrap in try/catch so the
early call is silently skipped.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 09:25:38 +01:00
sjg 84259a01f4 [fix](trx-frontend-http): redraw bookmark colors on theme change
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 09:20:32 +01:00
sjg 4ad5bf863d [fix](trx-client): update per-rig state channel on command response
send_command only updated the global state_tx watch channel, but SSE
sessions subscribe to per-rig rig_states channels. Per-rig channels were
only updated during the poll cycle (default 750ms). Now send_command also
pushes state to the per-rig channel immediately, eliminating up to 750ms
of latency for confirmed frequency/mode/state changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 09:09:59 +01:00
sjg 3ad5f7a3b7 [fix](trx-frontend-http): make vchan wrapper fire-and-forget on freq change
The vchan setRigFrequency wrapper was awaiting vchanTakeSchedulerControl()
(HTTP PUT to /scheduler-control) and vchanSetChannelFreq() (HTTP PUT to
channel freq endpoint) before calling the original setRigFrequency. This
added a full HTTP round-trip of latency to every frequency change. Make
both fire-and-forget: optimistic local update happens first, network calls
run in background.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 08:57:50 +01:00
sjg faf86faff9 [fix](trx-frontend-http): make setRigFrequency fire-and-forget
The HTTP round-trip for set_freq blocks on the server processing the
command (mpsc → TCP → rig hardware → response). With optimistic local
updates, CSS overlay, and SSE snap-back guard already in place, there is
no reason to await the network call. All callers (jog, freq input, spectrum
click, RDS AF tune) now return immediately after the optimistic update.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 08:31:01 +01:00
sjg 7f9ecad34c [fix](trx-frontend-http): prevent SSE from snapping freq back during optimistic update
When the user changes frequency, applyLocalTunedFrequency sets lastFreqHz
optimistically. But the SSE state stream could push back the old server
frequency before set_freq completes, causing the marker to snap back then
forward. Add a sequence-guarded _freqOptimisticHz that suppresses stale
SSE frequency updates while a set_freq is in flight.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 08:20:58 +01:00
sjg 54df7cf0f9 [feat](trx-frontend-http): GPU-composited CSS overlay for instant freq/BW updates
Replace synchronous drawSignalOverlay() calls in freq/BW change handlers
with lightweight CSS div elements repositioned via transform: translateX().
This is GPU-composited with zero layout/paint cost, making frequency and
bandwidth changes appear instantaneous. The full WebGL overlay catches up
on the next requestAnimationFrame.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 08:09:36 +01:00
sjg dc2c8b6eb1 [fix](trx-frontend-http): instant spectrum overlay on freq/bw changes
Call drawSignalOverlay() synchronously on frequency and bandwidth changes instead of deferring entirely to requestAnimationFrame. Also make bookmark apply fire-and-forget so the click handler returns immediately after optimistic UI updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 07:51:30 +01:00
sjg 5821531a93 [feat](trx-client): per-rig audio TCP connections
Replace single-connection relay with per-rig audio manager that spawns independent TCP connections for each rig. Each rig gets its own broadcast channel, stream info, and vchan command routing. Selected rig mirrors to global channels for backward compat. Also fix bookmark apply to update spectrum marker instantly and fire all requests in parallel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 07:37:59 +01:00
sjg 5d905bff87 [fix](trx-frontend-http): stop per-rig audio fallback to global broadcast
When ?rig_id= is specified on /audio, don't fall back to the global broadcast (which carries whichever rig is connected). Return 404 for rigs without an active audio connection instead of silently delivering the wrong rig's audio. Also create per-rig audio channels for all known rigs eagerly so connected rigs are instantly subscribable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 07:26:26 +01:00
sjg bf754f573a [fix](trx-frontend-http): filter SSE channel events by rig and fix audio hang
Channel SSE events were broadcast to all tabs regardless of rig, causing tabs to display wrong rig's channels. Per-rig audio info_rx override caused WebSocket to hang waiting for stream info that never arrives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 07:17:26 +01:00
sjg 9900314c8c [feat](trx-client): add per-rig spectrum and audio streams
Each browser tab can now subscribe to a specific rig's spectrum and
audio independently via ?rig_id= query params on /spectrum and /audio.
The remote client polls spectrum for all rigs with active subscribers
and routes responses to per-rig watch channels. Virtual channel
commands are routed through per-rig senders with global fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-03-22 06:59:54 +01:00