From c31ab05c80b837e2177c4ac42ebb809427934977 Mon Sep 17 00:00:00 2001 From: rouggy Date: Fri, 21 Aug 2026 14:35:54 +0200 Subject: [PATCH] fix(awards): "no field" leaves no rule running behind the panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Choosing "no field" cleared the primary field and hid the matching controls — but the fallback OR rules stayed in the definition and went on scanning their own fields. An RDA award declared to match nothing still found a district in the QTH, and the panel no longer showed the rule doing it. Only a manual override on the same QSO kept the wrong reference out of the log. So the choice now clears the fallbacks too, which is what its label promises, and a rule that survives — from an imported definition, a shared template — is rendered even in "no field" mode. Nothing that still runs may be invisible. No catalogue award pairs an empty field with OR rules, so nothing shipped changes behaviour. --- frontend/src/components/AwardEditor.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/AwardEditor.tsx b/frontend/src/components/AwardEditor.tsx index da14b20..c8de09a 100644 --- a/frontend/src/components/AwardEditor.tsx +++ b/frontend/src/components/AwardEditor.tsx @@ -574,8 +574,12 @@ export function AwardEditor({ open, onClose, onSaved }: Props) { {/* NO_FIELD is a sentinel because the stored value is the empty string and a Select cannot carry one — an empty item value means "show the placeholder" to Radix. */} + {/* Picking "no field" clears the fallbacks too: it promises that + nothing is matched automatically, and an OR rule left behind goes + on scanning its own field — worse than a visible one, because the + panel stops showing it. */} patch({ prefix: e.target.value })} placeholder={t('awed.prefixPlaceholder')} title={t('awed.prefixTitle')} /> + )} {/* Fallback searches: tried in order, only while nothing has matched yet — the first that hits wins (short-circuit), so a value already resolved by the primary rule isn't - re-derived differently by a later one. */} + re-derived differently by a later one. + + Shown even with no field when rules survive from an + imported definition: a rule that still runs must still + be visible, or the award finds references the panel + says it cannot. */} + {(!noField || (cur.or_rules?.length ?? 0) > 0) && (

{t('awed.additionalSearches')} (OR) {t('awed.orAlsoMatch')}

@@ -650,7 +661,7 @@ export function AwardEditor({ open, onClose, onSaved }: Props) { ); })}
- )} + )}