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:
+11
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user