From fef1380d3aeb77e63959f63c4f4a6622dca3cd0c Mon Sep 17 00:00:00 2001 From: KaraZajac Date: Tue, 17 Feb 2026 21:42:20 -0500 Subject: [PATCH] UI Updates --- src/app.rs | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/src/app.rs b/src/app.rs index b3834f5..06b43b8 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1006,12 +1006,18 @@ impl App { // -- Signal Action Menu helpers -- - /// Signal actions shown in the menu: all if HackRF (TX), else only export and delete. + /// Signal actions shown in the menu. With HackRF: Replay always; Lock/Unlock/Trunk/Panic only when + /// the selected capture is encoder-capable (unknown or decoded-only signals get Replay only). + /// Without TX (e.g. RTL-SDR): only export and delete. pub fn available_signal_actions(&self) -> Vec { - if self.radio.as_ref().map_or(false, |r| r.supports_tx()) { - SignalAction::ALL.to_vec() - } else { - SignalAction::ALL + let has_tx = self.radio.as_ref().map_or(false, |r| r.supports_tx()); + let encoder_capable = self + .selected_capture + .and_then(|idx| self.captures.get(idx)) + .map_or(false, |c| c.status == crate::capture::CaptureStatus::EncoderCapable); + + if !has_tx { + return SignalAction::ALL .iter() .filter(|a| { matches!( @@ -1020,6 +1026,25 @@ impl App { ) }) .copied() + .collect(); + } + + if encoder_capable { + SignalAction::ALL.to_vec() + } else { + // Unknown or decoded-only: only Replay + export + delete (no TX Lock/Unlock/Trunk/Panic) + SignalAction::ALL + .iter() + .filter(|a| { + !matches!( + a, + SignalAction::Lock + | SignalAction::Unlock + | SignalAction::Trunk + | SignalAction::Panic + ) + }) + .copied() .collect() } }