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:
2026-08-10 11:44:21 +02:00
parent f6f5235a8b
commit a3815c24a1
9 changed files with 169 additions and 16 deletions
+8
View File
@@ -266,6 +266,10 @@ const en: Dict = {
'clu.selfSpot': 'Self-spot while I log', 'clu.selfSpotEvery': 'at most every', 'clu.selfSpotMinutes': 'min',
'clu.selfSpotHint': 'Announces YOU on the master cluster when you log a QSO — the spot carries your station callsign and the frequency you just worked on, so callers find you without waiting for someone else to spot you. Sent on the first QSO of a frequency, then no more often than the gap below. Five minutes is the floor: a self-spot is traffic every user of the node sees.',
'clu.freeNodes': 'Free public nodes:',
'clu.muteWorked': 'No colour or badge on stations already worked',
'clu.muteWorkedHint': '(they stay in the list, just quiet — leaves the colour for what is left to do)',
'clu.slotHighlight': 'Colour the stations not worked on this band and mode',
'clu.slotHighlightHint': '(by callsign, whatever the entity status says)',
'clu.workedSameSlot': 'Already worked only on the same slot',
'clu.workedSameSlotHint': '— a spot shows "worked" only if you worked that call on the SAME band and mode, not just anywhere. Combines with digital-mode grouping (Settings → General): with it on, a call worked on 20m FT8 also counts as worked for a 20m FT4 spot; with it off, FT8 and FT4 are separate slots.',
// Backup panel
@@ -682,6 +686,10 @@ const fr: Dict = {
'clu.selfSpot': "M'auto-spotter quand j'enregistre", 'clu.selfSpotEvery': 'au plus toutes les', 'clu.selfSpotMinutes': 'min',
'clu.selfSpotHint': "Annonce TON indicatif sur le cluster maître quand tu enregistres un QSO — le spot porte l'indicatif de station et la fréquence que tu viens de travailler, pour qu'on te trouve sans attendre que quelqu'un te spotte. Envoyé au premier QSO d'une fréquence, puis pas plus souvent que l'intervalle ci-dessous. Cinq minutes est le plancher : un auto-spot est du trafic que voient tous les utilisateurs du nœud.",
'clu.freeNodes': 'Nœuds publics gratuits :',
'clu.muteWorked': 'Aucune couleur ni badge sur les stations déjà contactées',
'clu.muteWorkedHint': '(elles restent dans la liste, simplement discrètes — la couleur reste pour ce qui est à faire)',
'clu.slotHighlight': 'Colorer les stations non contactées sur cette bande et ce mode',
'clu.slotHighlightHint': "(par indicatif, quel que soit le statut de l'entité)",
'clu.workedSameSlot': 'Déjà contacté seulement sur le même slot',
'clu.workedSameSlotHint': '— un spot n\'affiche « contacté » que si vous avez contacté cet indicatif sur la MÊME bande et le MÊME mode, pas juste n\'importe où. Se combine avec le groupage des modes numériques (Réglages → Général) : activé, un indicatif contacté en 20m FT8 compte aussi comme contacté pour un spot 20m FT4 ; désactivé, FT8 et FT4 sont des slots distincts.',
'bk.hintMysql': "À la fermeture (1×/jour) OpsLog sauvegarde le SQLite local (config) ET exporte le log MySQL partagé en ADIF — opslog-log-<date>.adi — pour protéger tes contacts même s'ils sont sur le serveur. La rotation garde les N derniers de chaque.",
+65
View File
@@ -0,0 +1,65 @@
// Two operator options that change how a spot LOOKS, shared by the DX-cluster
// list and the band map so the two panels can never disagree about the same
// spot — the lesson already learnt with the marker colours.
//
// muteWorked — a station already worked gets no colour and no badge. It
// stays in the list, it simply stops competing for attention.
// slotHighlight — a callsign not yet worked on THIS band and mode is coloured,
// whatever the entity says. For an operator filling slots, a
// common entity on a new band+mode is the whole point, and the
// entity-level status calls it "worked".
//
// They compose deliberately: mute what is done, light up what is not.
export type SpotDisplayOptions = { muteWorked: boolean; slotHighlight: boolean };
export function readSpotDisplayOptions(): SpotDisplayOptions {
try {
return {
muteWorked: localStorage.getItem('opslog.clusterMuteWorked') === '1',
slotHighlight: localStorage.getItem('opslog.clusterSlotHighlight') === '1',
};
} catch {
return { muteWorked: false, slotHighlight: false };
}
}
type Entry = {
status?: string;
worked_call?: boolean;
worked_slot?: boolean;
new_county?: boolean;
new_pota?: boolean;
new_pfx?: boolean;
} | undefined;
// bringsNothingNew: the entity is resolved and worked, and no other dimension
// (county, park, prefix) is new. Same test the cluster list already used to dim
// a row — muting reuses it rather than inventing a second notion of "done".
//
// Note what is NOT muted: a status of new-band / new-slot survives, because
// having worked that callsign once on another band says nothing about the band
// in front of you.
function bringsNothingNew(s: Entry): boolean {
if (!s || !s.status) return false; // unresolved — never hide, it would flicker
if (s.status === 'new' || s.status === 'new-band' || s.status === 'new-mode' || s.status === 'new-slot') return false;
return !(s.new_pota || s.new_county || s.new_pfx);
}
// applySpotDisplay rewrites a status entry per the options, so every consumer —
// colour, badge, status text — follows from one decision instead of each panel
// re-deriving it.
export function applySpotDisplay<T extends Entry>(s: T, o: SpotDisplayOptions): T {
if (!s) return s;
if (o.muteWorked && bringsNothingNew(s)) {
// Strip everything that paints: the row keeps its data, loses its emphasis.
return { ...s, status: '', worked_call: false } as T;
}
if (o.slotHighlight && s.worked_slot === false) {
// Not worked on this band+mode. If the entity check found nothing new, say
// so with the slot status rather than leaving the spot colourless — that is
// exactly the row this option exists to surface.
if (!s.status || s.status === 'worked') return { ...s, status: 'new-slot' } as T;
}
return s;
}
+2
View File
@@ -39,6 +39,8 @@ const PORTABLE_KEYS = [
'opslog.clusterModeFilter', 'opslog.clusterSearch', 'opslog.clusterHideWorked',
'opslog.activeTab', // last selected tab
'opslog.mainSplit', // Main tab: width share of the left pane (percent)
'opslog.clusterMuteWorked', // cluster/band map: no colour or badge on worked spots
'opslog.clusterSlotHighlight', // cluster/band map: colour calls not worked on this band+mode
'opslog.bandMapWidth', // docked band map: column width (px)
'opslog.bandMapTabWidth', // Band map tab: shared card width (px)
// NOTE: 'hamlog.awardColsShown' and the grid column layouts are NOT listed here.