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:
2026-08-09 21:12:28 +02:00
parent 4dd2c3b997
commit ae06495f91
4 changed files with 77 additions and 30 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
"version": "0.24.1", "version": "0.24.1",
"date": "", "date": "",
"en": [ "en": [
"Band map: new POTA, new county and already-worked callsign are shown at last. The band map only ever coloured the entity status — new DXCC, new band, new slot, worked — and ignored the other three markers, even though it was already receiving them: a new park on an entity you have worked looked like any other worked spot. They now appear on the pill's left strip, in the same colours the DX-cluster list uses, so a fact is not blue in one panel and green in the next. They stack rather than replace: a worked entity that is also a new park shows both, the way the cluster list already spells them out side by side.", "Band map: new POTA, new county and already-worked callsign are shown at last. The band map only ever coloured the entity status — new DXCC, new band, new slot, worked — and ignored the other three markers, even though it was already receiving them: a new park on an entity you have worked looked like any other worked spot. They now appear on the pill's left strip, in the same colours the DX-cluster list uses, so a fact is not blue in one panel and green in the next. They stack rather than replace: a worked entity that is also a new park shows both, the way the cluster list already spells them out side by side. A new county is now violet instead of sharing green with a new park — in BOTH panels, since the two would otherwise disagree; the marker colours moved to one shared table, which is also what a per-marker colour setting will drive.",
"Recent QSOs: the Max box can be lowered again. It could not be emptied — clearing it put the old number straight back — so going from a large figure down to a small one was a fight against the field, and looked like the setting refusing to stick. Type freely now and press Enter (or click away) to apply. The value was already saved and travels with your data folder; only the box was in the way.", "Recent QSOs: the Max box can be lowered again. It could not be emptied — clearing it put the old number straight back — so going from a large figure down to a small one was a fight against the field, and looked like the setting refusing to stick. Type freely now and press Enter (or click away) to apply. The value was already saved and travels with your data folder; only the box was in the way.",
"Memory: the awards cache is given back once you stop using it. Opening the Awards panel loads the whole logbook into memory and kept it there for the rest of the session — a few tens of megabytes on a small log, but several hundred on a large one, and it was never released because the cache only expired when the logbook changed. It is now dropped after fifteen minutes without use, and the memory returned to Windows. Fifteen minutes on purpose: working through your awards keeps it warm, since reloading a large log takes seconds. The log also records the heap size each time the cache is built or released, so a memory report can be answered with a figure instead of a guess.", "Memory: the awards cache is given back once you stop using it. Opening the Awards panel loads the whole logbook into memory and kept it there for the rest of the session — a few tens of megabytes on a small log, but several hundred on a large one, and it was never released because the cache only expired when the logbook changed. It is now dropped after fifteen minutes without use, and the memory returned to Windows. Fifteen minutes on purpose: working through your awards keeps it warm, since reloading a large log takes seconds. The log also records the heap size each time the cache is built or released, so a memory report can be answered with a figure instead of a guess.",
"Performance: the DX-cluster console no longer drags the whole interface down. Every line of traffic — spots, MOTD, everything — was applied to the screen one at a time, and an RBN feed alone sends hundreds a second: that meant two copies of a 2000-line buffer and a redraw for each one, whether the console was open or not. Lines are now grouped and applied five times a second. The difference is most visible on an older PC, where this alone could make the app crawl.", "Performance: the DX-cluster console no longer drags the whole interface down. Every line of traffic — spots, MOTD, everything — was applied to the screen one at a time, and an RBN feed alone sends hundreds a second: that meant two copies of a 2000-line buffer and a redraw for each one, whether the console was open or not. Lines are now grouped and applied five times a second. The difference is most visible on an older PC, where this alone could make the app crawl.",
@@ -11,7 +11,7 @@
"Band map: the width can be dragged. Both the map docked beside the tables and the per-band cards in the Band map tab were locked at a fixed width, so an operator watching a busy band could not give the map more room — nor take it back for the log. Grab the edge to resize, double-click it to go back to the default. The width is remembered and travels with your data folder, like the other layout settings. In the tab, one width applies to every card: they sit side by side, and columns of different widths read as a mistake." "Band map: the width can be dragged. Both the map docked beside the tables and the per-band cards in the Band map tab were locked at a fixed width, so an operator watching a busy band could not give the map more room — nor take it back for the log. Grab the edge to resize, double-click it to go back to the default. The width is remembered and travels with your data folder, like the other layout settings. In the tab, one width applies to every card: they sit side by side, and columns of different widths read as a mistake."
], ],
"fr": [ "fr": [
"Band map : nouveau POTA, nouveau comté et indicatif déjà contacté sont enfin visibles. La band map ne colorait que le statut d'entité — nouveau DXCC, nouvelle bande, nouveau créneau, contacté — et ignorait les trois autres marqueurs alors qu'elle les recevait déjà : un nouveau parc sur une entité déjà travaillée ressemblait à n'importe quel spot contacté. Ils apparaissent désormais sur la bande latérale de la pastille, dans les couleurs de la liste du cluster DX, pour qu'un même fait ne soit pas bleu dans un panneau et vert dans l'autre. Ils s'empilent au lieu de se remplacer : une entité contactée qui est aussi un nouveau parc affiche les deux, comme la liste du cluster les énumère déjà côte à côte.", "Band map : nouveau POTA, nouveau comté et indicatif déjà contacté sont enfin visibles. La band map ne colorait que le statut d'entité — nouveau DXCC, nouvelle bande, nouveau créneau, contacté — et ignorait les trois autres marqueurs alors qu'elle les recevait déjà : un nouveau parc sur une entité déjà travaillée ressemblait à n'importe quel spot contacté. Ils apparaissent désormais sur la bande latérale de la pastille, dans les couleurs de la liste du cluster DX, pour qu'un même fait ne soit pas bleu dans un panneau et vert dans l'autre. Ils s'empilent au lieu de se remplacer : une entité contactée qui est aussi un nouveau parc affiche les deux, comme la liste du cluster les énumère déjà côte à côte. Un nouveau comté passe en violet au lieu de partager le vert avec un nouveau parc — dans les DEUX panneaux, sinon ils se contrediraient ; les couleurs des marqueurs sont désormais dans une table unique, celle-là même que pilotera l'option de couleur à venir.",
"QSO récents : la case Max se laisse enfin baisser. Impossible de la vider — l'effacer y remettait aussitôt l'ancien nombre — donc passer d'un grand chiffre à un petit était un combat contre le champ, et donnait l'impression que le réglage ne tenait pas. Tape librement puis Entrée (ou clique ailleurs) pour appliquer. La valeur était déjà enregistrée et voyage avec ton dossier de données ; c'était la case qui bloquait.", "QSO récents : la case Max se laisse enfin baisser. Impossible de la vider — l'effacer y remettait aussitôt l'ancien nombre — donc passer d'un grand chiffre à un petit était un combat contre le champ, et donnait l'impression que le réglage ne tenait pas. Tape librement puis Entrée (ou clique ailleurs) pour appliquer. La valeur était déjà enregistrée et voyage avec ton dossier de données ; c'était la case qui bloquait.",
"Mémoire : le cache des diplômes est rendu quand tu ne t'en sers plus. Ouvrir le panneau Diplômes charge tout le journal en mémoire et l'y gardait jusqu'à la fermeture — quelques dizaines de Mo sur un petit journal, plusieurs centaines sur un gros, et jamais libérés puisque le cache n'expirait qu'au changement du journal. Il est désormais abandonné après quinze minutes sans usage, et la mémoire rendue à Windows. Quinze minutes volontairement : parcourir tes diplômes le garde chaud, recharger un gros journal coûtant plusieurs secondes. Le journal technique note aussi la taille du tas à chaque construction ou libération, pour qu'un signalement de mémoire se réponde avec un chiffre plutôt qu'une supposition.", "Mémoire : le cache des diplômes est rendu quand tu ne t'en sers plus. Ouvrir le panneau Diplômes charge tout le journal en mémoire et l'y gardait jusqu'à la fermeture — quelques dizaines de Mo sur un petit journal, plusieurs centaines sur un gros, et jamais libérés puisque le cache n'expirait qu'au changement du journal. Il est désormais abandonné après quinze minutes sans usage, et la mémoire rendue à Windows. Quinze minutes volontairement : parcourir tes diplômes le garde chaud, recharger un gros journal coûtant plusieurs secondes. Le journal technique note aussi la taille du tas à chaque construction ou libération, pour qu'un signalement de mémoire se réponde avec un chiffre plutôt qu'une supposition.",
"Performance : la console du cluster DX ne plombe plus toute l'interface. Chaque ligne de trafic — spots, MOTD, tout — était appliquée à l'écran une par une, et un flux RBN en envoie à lui seul des centaines par seconde : cela faisait deux copies d'un tampon de 2000 lignes et un redessin pour chacune, que la console soit ouverte ou non. Les lignes sont désormais groupées et appliquées cinq fois par seconde. La différence se voit surtout sur un PC ancien, où cela suffisait à faire ramer l'application.", "Performance : la console du cluster DX ne plombe plus toute l'interface. Chaque ligne de trafic — spots, MOTD, tout — était appliquée à l'écran une par une, et un flux RBN en envoie à lui seul des centaines par seconde : cela faisait deux copies d'un tampon de 2000 lignes et un redessin pour chacune, que la console soit ouverte ou non. Les lignes sont désormais groupées et appliquées cinq fois par seconde. La différence se voit surtout sur un PC ancien, où cela suffisait à faire ramer l'application.",
+28 -25
View File
@@ -3,6 +3,7 @@ import { Minus, Plus, Crosshair, X, PanelLeft, PanelRight } from 'lucide-react';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import { useI18n } from '@/lib/i18n'; import { useI18n } from '@/lib/i18n';
import { spotStatusKey, inferSpotMode, spotModeCategory } from '@/lib/spot'; import { spotStatusKey, inferSpotMode, spotModeCategory } from '@/lib/spot';
import { SPOT_MARKERS, activeMarkers } from '@/lib/spotMarkers';
// BandMap — vertical spectrum panel inspired by Log4OM. // BandMap — vertical spectrum panel inspired by Log4OM.
// - Full band is always visible; zoom changes pixels-per-kHz, scroll // - Full band is always visible; zoom changes pixels-per-kHz, scroll
@@ -36,27 +37,28 @@ type SpotStatusEntry = {
new_pfx?: boolean; new_pfx?: boolean;
}; };
// Extra markers, ORTHOGONAL to the entity status: a spot can be a worked entity // The extra markers are ORTHOGONAL to the entity status: a spot can be a worked
// AND a new park. The cluster grid stacks them as separate badges rather than // entity AND a new park. The cluster list stacks them as separate badges instead
// letting one replace another, so the map stacks them too — as segments of the // of letting one replace another, so the map stacks them too — as segments of
// pill's left accent bar, which until now only repeated the pill's own colour // the pill's left accent bar, which until now only repeated the pill's own
// and carried no information of its own. // colour and carried no information of its own.
// //
// Colours are the cluster grid's, deliberately: the same fact must not be blue // Their colours come from lib/spotMarkers, shared with the cluster list: the
// in one panel and green in the next. NOTE that a new county and a new park // same fact must not be violet in one panel and green in the next.
// share --success there, so they share it here. // The map shows three of the four. A new PREFIX is left to the cluster list: the
const EXTRA_MARKERS: { key: 'new_pota' | 'new_county' | 'worked_call'; cls: string; label: string }[] = [ // pill is 22 px tall, and a fourth segment turns the strip into a colour code
{ key: 'new_pota', cls: 'bg-success', label: 'bmp.legendNewPota' }, // nobody can read at a glance. Add it here the day the strip earns more room.
{ key: 'new_county', cls: 'bg-success', label: 'bmp.legendNewCounty' }, const BMP_MARKERS = SPOT_MARKERS.filter((m) => m.key !== 'new_pfx');
{ key: 'worked_call', cls: 'bg-info', label: 'bmp.legendWorkedCall' }, const markersFor = (e: SpotStatusEntry | undefined) =>
]; activeMarkers(e).filter((m) => m.key !== 'new_pfx');
// markersFor returns the extra markers active on a spot, in a fixed order so // The legend spells the markers out; the cluster list's badges are abbreviated
// the bar reads the same way every time. // ("NEW CTY") because they sit in a narrow cell, and there is room here.
function markersFor(e: SpotStatusEntry | undefined): typeof EXTRA_MARKERS { const BMP_MARKER_LABEL: Record<string, string> = {
if (!e) return []; new_pota: 'bmp.legendNewPota',
return EXTRA_MARKERS.filter((m) => !!e[m.key]); new_county: 'bmp.legendNewCounty',
} worked_call: 'bmp.legendWorkedCall',
};
interface Props { interface Props {
band: string; band: string;
@@ -599,7 +601,7 @@ export function BandMap({ band, spots, spotStatus, currentFreqHz, onSpotClick, o
'hover:translate-x-0.5 hover:shadow', 'hover:translate-x-0.5 hover:shadow',
style.pill, style.pill,
)} )}
title={`${p.spot.dx_call}${entry?.country ? ' · ' + entry.country : ''} · ${p.spot.freq_khz.toFixed(1)} kHz · ${statusLabel(st, t)}${markersFor(entry).map((m) => ' · ' + t(m.label)).join('')}${p.spot.comment ? ' · ' + p.spot.comment : ''}${p.spot.spotter ? ' · de ' + p.spot.spotter : ''}`} title={`${p.spot.dx_call}${entry?.country ? ' · ' + entry.country : ''} · ${p.spot.freq_khz.toFixed(1)} kHz · ${statusLabel(st, t)}${markersFor(entry).map((m) => ' · ' + t(BMP_MARKER_LABEL[m.key])).join('')}${p.spot.comment ? ' · ' + p.spot.comment : ''}${p.spot.spotter ? ' · de ' + p.spot.spotter : ''}`}
> >
{/* Left accent strip. With no extra marker it repeats the status {/* Left accent strip. With no extra marker it repeats the status
colour, exactly as before; otherwise it splits into one colour, exactly as before; otherwise it splits into one
@@ -610,7 +612,7 @@ export function BandMap({ band, spots, spotStatus, currentFreqHz, onSpotClick, o
if (marks.length === 0) return <span className={cn('w-1 shrink-0', style.bar)} aria-hidden />; if (marks.length === 0) return <span className={cn('w-1 shrink-0', style.bar)} aria-hidden />;
return ( return (
<span className="w-1 shrink-0 flex flex-col" aria-hidden> <span className="w-1 shrink-0 flex flex-col" aria-hidden>
{marks.map((m) => <span key={m.key} className={cn('flex-1', m.cls)} />)} {marks.map((m) => <span key={m.key} className="flex-1" style={{ background: m.colour }} />)}
</span> </span>
); );
})()} })()}
@@ -633,10 +635,11 @@ export function BandMap({ band, spots, spotStatus, currentFreqHz, onSpotClick, o
<LegendDot cls="bg-warning" label={t('bmp.legendNewBand')} /> <LegendDot cls="bg-warning" label={t('bmp.legendNewBand')} />
<LegendDot cls="bg-caution" label={t('bmp.legendNewSlot')} /> <LegendDot cls="bg-caution" label={t('bmp.legendNewSlot')} />
<LegendDot cls="bg-muted-foreground/30" label={t("bmp.legendWorked")} /> <LegendDot cls="bg-muted-foreground/30" label={t("bmp.legendWorked")} />
{/* The stacked markers, same colours as the cluster grid. */} {/* The stacked markers, straight from the shared table so the legend
<LegendDot cls="bg-success" label={t('bmp.legendNewPota')} /> cannot drift from what the pills actually draw. */}
<LegendDot cls="bg-success" label={t('bmp.legendNewCounty')} /> {BMP_MARKERS.map((m) => (
<LegendDot cls="bg-info" label={t('bmp.legendWorkedCall')} /> <LegendDot key={m.key} colour={m.colour} label={t(BMP_MARKER_LABEL[m.key])} />
))}
{/* Sub-band shading, so the wash behind the pills is never colour-alone. */} {/* Sub-band shading, so the wash behind the pills is never colour-alone. */}
<span className="mx-0.5 opacity-40">|</span> <span className="mx-0.5 opacity-40">|</span>
<LegendDot colour={SEG_CW} label={t("bmp.legendCW")} /> <LegendDot colour={SEG_CW} label={t("bmp.legendCW")} />
+6 -3
View File
@@ -12,6 +12,7 @@ import {
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
import { Checkbox } from '@/components/ui/checkbox'; import { Checkbox } from '@/components/ui/checkbox';
import { cleanSpotter, inferSpotMode, spotStatusKey } from '@/lib/spot'; import { cleanSpotter, inferSpotMode, spotStatusKey } from '@/lib/spot';
import { markerColour } from '@/lib/spotMarkers';
import { loadLocal, loadRemote, saveState, seedLocal, whenGridPrefsReady } from '@/lib/gridPrefs'; import { loadLocal, loadRemote, saveState, seedLocal, whenGridPrefsReady } from '@/lib/gridPrefs';
import { useI18n } from '@/lib/i18n'; import { useI18n } from '@/lib/i18n';
@@ -221,9 +222,11 @@ const makeColCatalog = (t: TFn): ColEntry[] => [
: t('clg2.wkdCall'); : t('clg2.wkdCall');
parts.push({ text: label, color: main }); parts.push({ text: label, color: main });
} }
if (s?.new_county) parts.push({ text: t('clg2.newCounty'), color: 'var(--success)' }); // Colours from lib/spotMarkers — shared with the band map so a marker is
if (s?.new_pota) parts.push({ text: t('clg2.newPota'), color: 'var(--success)' }); // never one colour here and another there.
if (s?.new_pfx) parts.push({ text: t('clg2.newPfx'), color: 'var(--caution)' }); 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>; if (parts.length === 0) return <span style={{ color: 'var(--muted-foreground)', fontSize: 10 }}></span>;
return ( return (
<span style={{ whiteSpace: 'nowrap' }}> <span style={{ whiteSpace: 'nowrap' }}>
+41
View File
@@ -0,0 +1,41 @@
// The "extra" spot markers — the ones ORTHOGONAL to the entity status.
//
// A spot's entity status (new DXCC / new band / new slot / worked) answers one
// question. These answer others that can be true at the same time: the park is
// new even if the entity is worked, the county is new even if the band is not.
// Both the DX-cluster list and the band map show them, and they have to agree —
// the same fact must not be green in one panel and violet in the next, so the
// colours live HERE and nowhere else. This is also the table a per-marker colour
// setting will drive, which is why it is a table rather than three constants.
//
// Colour choices:
// POTA green — parks; the association is worth keeping
// county violet — a chart hue, because every semantic token was already
// spoken for: red, orange and yellow are the entity
// statuses, blue is "callsign worked", green is POTA
// worked blue — matches the WKD-CALL badge the cluster list has always used
// prefix yellow — unchanged
export type SpotMarkerKey = 'new_pota' | 'new_county' | 'new_pfx' | 'worked_call';
export type SpotMarker = {
key: SpotMarkerKey;
colour: string; // a CSS colour — a var() reference, so it follows the theme
labelKey: string; // i18n key, short form (badge / legend)
};
// Order is the display order, in both panels.
export const SPOT_MARKERS: SpotMarker[] = [
{ key: 'new_pota', colour: 'var(--success)', labelKey: 'clg2.newPota' },
{ key: 'new_county', colour: 'var(--chart-5)', labelKey: 'clg2.newCounty' },
{ key: 'new_pfx', colour: 'var(--caution)', labelKey: 'clg2.newPfx' },
{ key: 'worked_call', colour: 'var(--info)', labelKey: 'clg2.wkdCall' },
];
export const markerColour = (key: SpotMarkerKey): string =>
SPOT_MARKERS.find((m) => m.key === key)?.colour ?? 'var(--muted-foreground)';
// activeMarkers returns the markers set on a status entry, in display order.
export function activeMarkers(e: Record<string, unknown> | undefined): SpotMarker[] {
if (!e) return [];
return SPOT_MARKERS.filter((m) => !!e[m.key]);
}