fix(cluster): hide worked must not hide what is new

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.
This commit is contained in:
2026-08-13 10:34:15 +02:00
parent 8762131248
commit f8fb57210f
3 changed files with 30 additions and 4 deletions
+6 -2
View File
@@ -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",
+11 -2
View File
@@ -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;
}
+13
View File
@@ -74,3 +74,16 @@ export function applySpotDisplay<T extends Entry>(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';
}