feat(cluster): quiet the worked spots, light up the empty slots
Two options that change what the eye is pulled towards, both applying to the cluster list AND the band map. Mute worked before: a spot that brings nothing new loses its colour and its badges. It stays in the list - the operator asked for less noise, not less information. "Brings nothing new" reuses the dimming rule the cluster list already had rather than inventing a second notion of done, so it keeps obeying the same-slot option and the digital-mode grouping for free. A new-band or new-slot status is NOT muted: having worked that callsign once on another band says nothing about the band in front of you. Highlight unworked in this slot: colours any callsign not yet worked on this band and this mode, whatever the entity says. For an operator filling slots a common entity on a fresh band+mode is the whole point, and the entity-level status flatly calls it worked. It reuses the existing new-slot status, so no new colour, no new legend, no new badge - both panels already knew how to draw it. WorkedSlot is computed independently of the same-slot preference: it is what this option reads, and it must not change meaning because a different option was toggled. The slot index is now built when either option needs it, and the status cache is keyed on both so a toggle invalidates it. The rules live in one module used by both panels. Marker colours already taught us what happens when the two derive the same thing separately.
This commit is contained in:
@@ -13,6 +13,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import { cleanSpotter, inferSpotMode, spotStatusKey } from '@/lib/spot';
|
||||
import { markerColour } from '@/lib/spotMarkers';
|
||||
import { applySpotDisplay, readSpotDisplayOptions } from '@/lib/spotDisplay';
|
||||
import { loadLocal, loadRemote, saveState, seedLocal, whenGridPrefsReady } from '@/lib/gridPrefs';
|
||||
import { useI18n } from '@/lib/i18n';
|
||||
|
||||
@@ -52,6 +53,9 @@ export type SpotStatusEntry = {
|
||||
country?: string;
|
||||
continent?: string;
|
||||
worked_call?: boolean;
|
||||
// worked_slot: this exact callsign already worked on THIS band and mode.
|
||||
// Always slot-scoped, unlike worked_call which follows the "same slot" option.
|
||||
worked_slot?: boolean;
|
||||
new_county?: boolean;
|
||||
new_pota?: boolean;
|
||||
new_pfx?: boolean;
|
||||
@@ -97,9 +101,13 @@ type ColEntry = ColDef<ClusterSpot> & { group: string; label: string; defaultVis
|
||||
// statusFor resolves the precomputed spot status (new / new-band / new-slot /
|
||||
// worked-call) for an ag-Grid cell's row.
|
||||
function statusFor(p: any): SpotStatusEntry | undefined {
|
||||
return p?.context?.spotStatus?.[
|
||||
const s = p?.context?.spotStatus?.[
|
||||
spotStatusKey(p.data?.dx_call, p.data?.band ?? '', p.data?.comment ?? '', p.data?.freq_hz)
|
||||
];
|
||||
// One chokepoint: the colour, the badges and the Status text all read through
|
||||
// here, so the two display options are applied once rather than in each
|
||||
// renderer — and the band map applies the very same function.
|
||||
return applySpotDisplay(s, readSpotDisplayOptions());
|
||||
}
|
||||
|
||||
// Spot status is shown by COLOURING THE TEXT, never by a pill or a badge.
|
||||
|
||||
Reference in New Issue
Block a user