From 5dcf1b5e9c71836d246bb98de6d5253b892fecb6 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 27 Sep 2026 14:41:21 -0400 Subject: [PATCH] SDRs panel: an unreported device list reads 'not reported', not 'not plugged in' Co-Authored-By: Claude Opus 5.5 --- drb-frontend/components/SdrSettings.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drb-frontend/components/SdrSettings.tsx b/drb-frontend/components/SdrSettings.tsx index fcda4a9..41564db 100644 --- a/drb-frontend/components/SdrSettings.tsx +++ b/drb-frontend/components/SdrSettings.tsx @@ -26,10 +26,11 @@ const selectClass = "bg-gray-800 border border-gray-700 rounded px-2 py-1 text-gray-200 text-xs focus:outline-none focus:border-indigo-500 disabled:opacity-60 max-w-[13rem]"; function DeviceSelect({ - value, devices, autoLabel, label, disabled, onChange, + value, devices, devicesKnown, autoLabel, label, disabled, onChange, }: { value: string; devices: SdrDevice[]; + devicesKnown: boolean; autoLabel: string; label: string; disabled: boolean; @@ -44,7 +45,9 @@ function DeviceSelect({ SDR {d.index + 1} ยท serial {d.serial ?? "unknown"}{d.duplicate_serial ? " (shared serial!)" : ""} ))} - {value && !known && } + {value && !known && ( + + )} ); } @@ -57,6 +60,7 @@ export function SdrSettings({ node, canEdit }: { node: NodeRecord; canEdit: bool const reported = node.secondary_sdr_running != null; const running = node.secondary_sdr_running ?? []; const devices = node.sdr_devices ?? []; + const devicesKnown = reported && node.sdr_devices != null; const [rows, setRows] = useState(() => rowsFrom(priority, pins)); const [op25Pin, setOp25Pin] = useState(pins.op25 ?? ""); @@ -114,7 +118,7 @@ export function SdrSettings({ node, canEdit }: { node: NodeRecord; canEdit: bool

SDRs

- {reported && node.sdr_devices != null + {devicesKnown ? `This node reports ${devices.length} SDR${devices.length === 1 ? "" : "s"}.` : "This node hasn't reported its SDRs yet."}

@@ -134,6 +138,7 @@ export function SdrSettings({ node, canEdit }: { node: NodeRecord; canEdit: bool { const meta = MODES.find((x) => x.mode === row.mode)!; - const pinMissing = !!row.pin && !devices.some((d) => d.serial === row.pin); + const pinMissing = devicesKnown && !!row.pin && !devices.some((d) => d.serial === row.pin); const state = !row.enabled ? "Off" : dirty @@ -173,6 +178,7 @@ export function SdrSettings({ node, canEdit }: { node: NodeRecord; canEdit: bool