From 2594697e0001e8cca9a7492694ec47043a2c3129 Mon Sep 17 00:00:00 2001 From: rouggy Date: Thu, 27 Aug 2026 00:42:26 +0200 Subject: [PATCH] fix(cat): the chip says what YOU called the radio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It showed what the radio calls itself over CAT — 'Kenwood (911)' for a K3, a bare 'CAT' for a Flex that reports nothing useful. That is the answer to a question nobody asks once the rig has a name in the list, and it made the two radios look alike in the one place they have to be told apart. The name the operator typed comes first now, on the chip and in the menu, and falls back to the radio's own identity when they typed none. The model identity is still in the tooltip, where it answers 'what is actually connected' without taking the place of 'which of my rigs is this'. --- app_radios.go | 9 ++++++++- frontend/src/App.tsx | 20 ++++++++++++++------ frontend/src/components/SettingsModal.tsx | 2 +- frontend/wailsjs/go/models.ts | 2 ++ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app_radios.go b/app_radios.go index 2fe8d99..252e6d4 100644 --- a/app_radios.go +++ b/app_radios.go @@ -118,9 +118,16 @@ func (a *App) ActiveRadioID() string { } // RadioListEntry is what the status-bar menu needs: enough to draw a row. +// +// Name is what the OPERATOR typed, empty when they typed nothing; Label is what +// to draw when there is no better idea. The two are separate because the caller +// has a better idea than we do: the status bar knows what the radio calls +// itself over CAT, and "FTDX10" beats "Radio 2" — but only where the operator +// has not given it a name of their own, which beats both. type RadioListEntry struct { ID string `json:"id"` Name string `json:"name"` + Label string `json:"label"` Backend string `json:"backend"` Active bool `json:"active"` } @@ -135,7 +142,7 @@ func (a *App) ListRadios() []RadioListEntry { out := make([]RadioListEntry, 0, len(list)) for i, r := range list { out = append(out, RadioListEntry{ - ID: r.ID, Name: radioLabel(r, i), + ID: r.ID, Name: strings.TrimSpace(r.Name), Label: radioLabel(r, i), Backend: r.Settings.Backend, Active: r.ID == active, }) } diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 12a40b2..9f8c267 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -313,9 +313,17 @@ function RadioChip({ catUp, catState, onOpenSettings }: { return () => document.removeEventListener('mousedown', onDoc); }, [open]); + // What the operator called this radio comes first. + // + // The chip showed what the RADIO calls itself over CAT — "Kenwood (911)" for + // a K3, a bare "CAT" for a Flex that reports nothing useful — which is the + // answer to a question nobody asked once the rig has a name in the list. The + // model identity is still there, in the tooltip. + const active = radios.find((r: any) => r.active); + const named = (active?.name || '').trim(); const label = catUp - ? (catState.rig || 'CAT') - : (catState.enabled ? (shortCatError(catState.error) || 'CAT off') : 'CAT'); + ? (named || catState.rig || 'CAT') + : (catState.enabled ? (named || shortCatError(catState.error) || 'CAT off') : (named || 'CAT')); // The menu opens with ONE radio too. // // It was only shown from two, on the reasoning that a single radio has @@ -330,9 +338,9 @@ function RadioChip({ catUp, catState, onOpenSettings }: { ))} diff --git a/frontend/src/components/SettingsModal.tsx b/frontend/src/components/SettingsModal.tsx index f28ec7e..8aff137 100644 --- a/frontend/src/components/SettingsModal.tsx +++ b/frontend/src/components/SettingsModal.tsx @@ -3224,7 +3224,7 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged {radios.map((r: any, i: number) => ( - {r.name?.trim() || `Radio ${i + 1}`} + {r.name?.trim() || r.label || `Radio ${i + 1}`} ))} diff --git a/frontend/wailsjs/go/models.ts b/frontend/wailsjs/go/models.ts index b6a9427..5aa0560 100644 --- a/frontend/wailsjs/go/models.ts +++ b/frontend/wailsjs/go/models.ts @@ -3606,6 +3606,7 @@ export namespace main { export class RadioListEntry { id: string; name: string; + label: string; backend: string; active: boolean; @@ -3617,6 +3618,7 @@ export namespace main { if ('string' === typeof source) source = JSON.parse(source); this.id = source["id"]; this.name = source["name"]; + this.label = source["label"]; this.backend = source["backend"]; this.active = source["active"]; }