feat(spots): give a new county its own colour, from a shared marker table
A new county and a new park both drew --success, so the two were the same green in the cluster list and, since the band map copied it, in the band map too. County takes violet; POTA keeps green, the association being worth something. Violet is a chart hue rather than a semantic token because every token was already spoken for: red, orange and yellow are the entity statuses, blue is "callsign already worked", green is now POTA. It is defined in both the light and dark chart groups, so all eleven themes have it. Changed in BOTH panels at once — separating them in one place would have left the two views contradicting each other about the same fact, which is worse than sharing a colour. To make that impossible to get wrong again, the marker definitions move to lib/spotMarkers: key, colour and label in one table that the cluster list and the band map both read. That table is what a per-marker colour setting will drive, which is why it is a table and not three constants. The band map deliberately shows three of the four markers. A new PREFIX stays a cluster-list badge: the pill is 22 px tall and a fourth segment on its strip turns it into a colour code nobody reads at a glance.
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
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 { loadLocal, loadRemote, saveState, seedLocal, whenGridPrefsReady } from '@/lib/gridPrefs';
|
||||
import { useI18n } from '@/lib/i18n';
|
||||
|
||||
@@ -221,9 +222,11 @@ const makeColCatalog = (t: TFn): ColEntry[] => [
|
||||
: t('clg2.wkdCall');
|
||||
parts.push({ text: label, color: main });
|
||||
}
|
||||
if (s?.new_county) parts.push({ text: t('clg2.newCounty'), color: 'var(--success)' });
|
||||
if (s?.new_pota) parts.push({ text: t('clg2.newPota'), color: 'var(--success)' });
|
||||
if (s?.new_pfx) parts.push({ text: t('clg2.newPfx'), color: 'var(--caution)' });
|
||||
// Colours from lib/spotMarkers — shared with the band map so a marker is
|
||||
// never one colour here and another there.
|
||||
if (s?.new_county) parts.push({ text: t('clg2.newCounty'), color: markerColour('new_county') });
|
||||
if (s?.new_pota) parts.push({ text: t('clg2.newPota'), color: markerColour('new_pota') });
|
||||
if (s?.new_pfx) parts.push({ text: t('clg2.newPfx'), color: markerColour('new_pfx') });
|
||||
if (parts.length === 0) return <span style={{ color: 'var(--muted-foreground)', fontSize: 10 }}>—</span>;
|
||||
return (
|
||||
<span style={{ whiteSpace: 'nowrap' }}>
|
||||
|
||||
Reference in New Issue
Block a user