fix(awards): the band matrix stops pretending 70cm is the top band
The columns were the intersection of the award's bands with a fixed list that ended at 70cm, so a band the award genuinely covers could not appear whatever it said. DDFM is worked well into the microwaves and had no 23cm column, and nothing anywhere would have produced one. The intersection is now taken against every band in frequency order, the same list internal/award already sorts its own band counts by. The classic HF-plus-2m-and-70cm set stays as the fallback for an award with no band list and no contacts yet — the full list would be twenty-nine columns of mostly nothing.
This commit is contained in:
@@ -29,7 +29,23 @@ type AwardResult = {
|
||||
type AwardStatRow = { label: string; cells: number[]; total: number; grand_total: number };
|
||||
type AwardStats = { code: string; bands: string[]; rows: AwardStatRow[] };
|
||||
|
||||
// Fixed band columns for the matrix view (Log4OM-style).
|
||||
// Every band the matrix can show, in the order they belong in.
|
||||
//
|
||||
// The columns are the intersection of this with what the award covers, so a
|
||||
// band missing HERE cannot appear at all whatever the award says — which is how
|
||||
// DDFM, a French award worked well into the microwaves, ended at 70cm with no
|
||||
// 23cm column and no way to ask for one.
|
||||
//
|
||||
// Mirrors bandOrder in internal/award — the same list in frequency order. The
|
||||
// two are kept apart because they answer different questions (that one sorts an
|
||||
// award's own band counts, this one lays out columns), but a band added to one
|
||||
// belongs in the other.
|
||||
const ALL_BANDS = ['2190m','630m','160m','80m','60m','40m','30m','20m','17m','15m','12m','10m',
|
||||
'6m','4m','2m','1.25m','70cm','33cm','23cm','13cm','9cm','6cm','3cm','1.25cm','6mm','4mm','2.5mm','2mm','1mm'];
|
||||
|
||||
// What to show when there is nothing to narrow it down: an award with no band
|
||||
// list and no contacts yet. The classic set — the whole of ALL_BANDS would be
|
||||
// twenty-nine columns of mostly nothing.
|
||||
const GRID_BANDS = ['160m','80m','60m','40m','30m','20m','17m','15m','12m','10m','6m','2m','70cm'];
|
||||
|
||||
// Per-band status for a reference, highest first.
|
||||
@@ -196,7 +212,9 @@ export function AwardsPanel({ onEditQSO, onAwardsChanged, onPaperQSL }: {
|
||||
|
||||
const gridBands = useMemo(() => {
|
||||
if (awardBands.size === 0) return GRID_BANDS;
|
||||
const filtered = GRID_BANDS.filter((b) => awardBands.has(b));
|
||||
// Filtered from ALL_BANDS, so a band the award covers gets its column even
|
||||
// when it is one the classic set never listed.
|
||||
const filtered = ALL_BANDS.filter((b) => awardBands.has(b));
|
||||
return filtered.length ? filtered : GRID_BANDS;
|
||||
}, [awardBands]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user