From bd4f1b23250dfec9431d00cc3824ba9d2842ce11 Mon Sep 17 00:00:00 2001 From: rouggy Date: Mon, 24 Aug 2026 21:21:02 +0200 Subject: [PATCH] fix(decodes): new-band-mode had no badge, so its rows looked unfiltered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A station new on this band AND in this mode is one status, 'new-band-mode', and the badge table has an entry for neither half. The lookup returned nothing, so those rows showed only their grid or prefix badge — and with NEW/BAND/MODE selected, a row whose visible badges were LOC and PFX read as the filter letting through things nobody asked for. It was not: the row belonged there and the panel failed to say why. catsOf has always split that status into its two categories for filtering. The badges now do the same on screen. --- changelog.json | 6 +++-- frontend/src/components/DecodesPanel.tsx | 28 +++++++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/changelog.json b/changelog.json index 5cff80d..35bf4ff 100644 --- a/changelog.json +++ b/changelog.json @@ -5,12 +5,14 @@ "en": [ "Elecraft console: MOX unkeys again, and the power and SWR bars move while transmitting. The poll stops while the carrier is up — the rig refuses most questions then — and the panel was left believing the radio was still receiving, so pressing MOX a second time sent another transmit command instead of stopping.", "Elecraft console: RIT and XIT can be moved — ±10 and ±100 Hz buttons with the offset shown beside them. A lit RIT button says the feature is on and nothing about where it has put the receiver.", - "Elecraft console: a 4.0 kHz filter button, the K3 maximum and the one FT8 wants." + "Elecraft console: a 4.0 kHz filter button, the K3 maximum and the one FT8 wants.", + "FT decodes: a station that is new on both the band and the mode now shows both badges. That status had no badge of its own, so those rows passed the BAND and MODE filters and then displayed no reason for being in the list — only their grid or prefix badge, which looked like the filter leaking." ], "fr": [ "Console Elecraft : MOX repasse bien en réception, et les barres de puissance et de ROS bougent pendant l'émission. L'interrogation s'arrête quand la porteuse est levée — la radio refuse alors la plupart des questions — et le panneau croyait donc la radio toujours en réception : un second appui sur MOX envoyait une nouvelle commande d'émission au lieu d'arrêter.", "Console Elecraft : le RIT et le XIT se règlent — boutons ±10 et ±100 Hz avec le décalage affiché à côté. Un bouton RIT allumé dit que la fonction est active et rien sur l'endroit où elle a mis le récepteur.", - "Console Elecraft : un bouton de filtre à 4,0 kHz, le maximum du K3 et celui qu'il faut pour le FT8." + "Console Elecraft : un bouton de filtre à 4,0 kHz, le maximum du K3 et celui qu'il faut pour le FT8.", + "Décodes FT : une station nouvelle à la fois sur la bande et dans le mode affiche maintenant les deux badges. Ce statut n'avait pas de badge à lui : ces lignes passaient les filtres BANDE et MODE puis n'affichaient aucune raison d'être là — seulement leur badge de locator ou de préfixe, ce qui donnait l'impression d'un filtre qui fuyait." ] }, { diff --git a/frontend/src/components/DecodesPanel.tsx b/frontend/src/components/DecodesPanel.tsx index f092abd..0d41455 100644 --- a/frontend/src/components/DecodesPanel.tsx +++ b/frontend/src/components/DecodesPanel.tsx @@ -316,6 +316,22 @@ const ENTITY_BADGE: Record = { 'new-call': { label: 'dec.stCall', cls: 'bg-muted text-muted-foreground' }, }; +// entityBadgesFor turns a status into the badges that describe it. +// +// A LIST, because "new-band-mode" is two facts at once — new on this band and +// new in this mode — and the map above has an entry for neither. It was read +// with a single lookup, which returned nothing for that status: those rows +// passed the BAND and MODE filters and then showed no reason for being there, +// which is precisely what was reported. catsOf has always split the status into +// its two categories; this is the same split, on the screen. +function entityBadgesFor(status: string): { label: string; cls: string }[] { + if (status === 'new-band-mode') { + return [ENTITY_BADGE['new-band'], ENTITY_BADGE['new-mode']]; + } + const one = ENTITY_BADGE[status]; + return one ? [one] : []; +} + // The orthogonal ones: a station already worked for its entity can still be a // new grid, a new prefix or a park never logged. // @@ -1004,10 +1020,10 @@ export function DecodesPanel({ decodes, txMsgs, txState, txStates, spotStatus, o {g.decodes.map((d, i) => { const e = statusOf(d); const st = e?.status && e.status !== 'worked' ? e.status : ''; - const entity = st ? ENTITY_BADGE[st] : undefined; + const entities = st ? entityBadgesFor(st) : []; const extras = EXTRA_BADGES.filter((b) => !!e?.[b.key]); const mine = !!me && d.call === me; - const hot = !!entity || extras.length > 0; + const hot = entities.length > 0 || extras.length > 0; // Someone answering us outranks everything else on the screen. const replying = answersMe(d.msg); // The station we are calling, so it can be picked out of a slot @@ -1096,11 +1112,11 @@ export function DecodesPanel({ decodes, txMsgs, txState, txStates, spotStatus, o {t('dec.wkd')} )} - {entity && ( - - {t(entity.label)} + {entities.map((b) => ( + + {t(b.label)} - )} + ))} {extras.map((b) => { // A square WORKED but not yet confirmed is a different job // from one never worked: a QSL to chase, not a QSO to make.