From f8fb57210fe55c41973162a07ef710c72e5772a1 Mon Sep 17 00:00:00 2001 From: Gregory Salaun Date: Thu, 13 Aug 2026 10:34:15 +0200 Subject: [PATCH] fix(cluster): hide worked must not hide what is new MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported on BH2SWB and 4X9AA: both flagged NEW PFX, neither ever worked, both vanished the moment "hide worked" went on. The predicate hid a spot when worked_call OR status === 'worked' — and that second one is the ENTITY's status, not the callsign's. So any spot in an entity worked years ago disappeared, however new it was for something else. The extra markers are orthogonal to the entity status; the band map already says so in as many words. They now win: a new prefix, county, grid or park is never hidden, whatever the entity says. A worked entity that is new for nothing is still hidden, which is what the filter is for. Extracted to spotIsWorked in lib/spotDisplay, beside the other rule the cluster and band map share, rather than left inline in a predicate that has already grown once. This repo has no frontend test runner, so this is verified by build and reading rather than by a test. --- changelog.json | 8 ++++++-- frontend/src/App.tsx | 13 +++++++++++-- frontend/src/lib/spotDisplay.ts | 13 +++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/changelog.json b/changelog.json index 74c10db..e4ae2d5 100644 --- a/changelog.json +++ b/changelog.json @@ -2,8 +2,12 @@ { "version": "0.25.0", "date": "", - "en": [], - "fr": [] + "en": [ + "Cluster: \"Hide worked\" no longer hides a spot that is a new prefix, county, grid or park in an entity already worked." + ], + "fr": [ + "Cluster : « Masquer les contactés » ne masque plus un spot qui est un nouveau préfixe, comté, carré ou parc dans une contrée déjà faite." + ] }, { "version": "0.24.9", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 872fd07..e228e2a 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -90,7 +90,7 @@ import { ExportFieldsDialog } from '@/components/ExportFieldsDialog'; import { ShutdownProgress } from '@/components/ShutdownProgress'; import { ClusterGrid } from '@/components/ClusterGrid'; import { cleanSpotter, inferSpotMode, spotModeCategory, spotStatusKey } from '@/lib/spot'; -import { applySpotDisplay, readSpotDisplayOptions, SPOT_DISPLAY_OPTIONS_EXPOSED } from '@/lib/spotDisplay'; +import { applySpotDisplay, readSpotDisplayOptions, spotIsWorked, SPOT_DISPLAY_OPTIONS_EXPOSED } from '@/lib/spotDisplay'; import { GetRowColors } from '../wailsjs/go/main/App'; import { WorkedBeforeGrid } from '@/components/WorkedBeforeGrid'; import { NetControlPanel } from '@/components/NetControlPanel'; @@ -4780,7 +4780,16 @@ export default function App() { const k = spotStatusKey(s.dx_call, s.band ?? '', s.comment ?? '', s.freq_hz); const e = spotStatus[k]; if (!e) return false; - if (e.worked_call || e.status === 'worked') return false; + // A spot that is NEW for something is not "worked", whatever the entity + // says. The extra markers are orthogonal to the entity status — the same + // rule the band map already states — so a new prefix, county, grid or + // park in an entity worked years ago is exactly what an operator is + // hunting, and hiding it is the opposite of what was asked. + // + // Reported on BH2SWB and 4X9AA: both flagged NEW PFX, neither ever + // worked, both vanished the moment "hide worked" went on. + const isNew = !!(e.new_pota || e.new_county || e.new_pfx || e.new_grid); + if (!isNew && (e.worked_call || e.status === 'worked')) return false; } return true; } diff --git a/frontend/src/lib/spotDisplay.ts b/frontend/src/lib/spotDisplay.ts index c44426d..2c5f003 100644 --- a/frontend/src/lib/spotDisplay.ts +++ b/frontend/src/lib/spotDisplay.ts @@ -74,3 +74,16 @@ export function applySpotDisplay(s: T, o: SpotDisplayOptions): } return e; } + +// spotIsWorked answers "does this spot bring me nothing?", which is what the +// "hide worked" filter is really asking. +// +// The extra markers are ORTHOGONAL to the entity status — a spot can be a worked +// entity AND a new park, prefix, county or grid — so they win. Without that, a +// new prefix in an entity worked years ago vanished the moment the filter went +// on, which is the opposite of what an operator hunting prefixes wants. +export function spotIsWorked(e: Entry): boolean { + if (!e) return false; + if (e.new_pota || e.new_county || e.new_pfx || e.new_grid) return false; + return !!e.worked_call || e.status === 'worked'; +}