fix(watchlist): judge generic DATA spots at digital-class grain; tidy the toolbar wrap

7.0589 falls in the band plan's generic [7.04-7.1] DATA segment — an F/H
DXpedition off the standard dials — and 'DATA' is in nobody's log, so the spot
read NEW MODE / Needed while the FT8 contact sat right there. A generic mode
cannot be matched exactly; it is now judged at digital-class grain — worked if
ANY digital mode of that call is logged on that band — against a second
class-folded slot set built beside the exact one (shared when the grouping
option already folds them). DXHunter answers this with a finer frequency table,
which fails on exactly these off-dial expeditions; the class rule cannot.

The toolbar also wraps as a whole with tighter gaps instead of dropping its
last filter chip onto a lone second line.
This commit is contained in:
2026-08-29 00:43:30 +02:00
parent 7322e2ab66
commit 9172f504e5
3 changed files with 43 additions and 9 deletions
+27 -3
View File
@@ -11,6 +11,7 @@ import (
"strings"
"time"
"hamlog/internal/qso"
"hamlog/internal/watchlist"
wruntime "github.com/wailsapp/wails/v2/pkg/runtime"
@@ -99,6 +100,21 @@ func (a *App) WatchlistWorkedSlots(queries []WatchlistSlotQuery) []bool {
}
return up + "|" + b
}
// A spot whose mode the band plan could only call "DATA" (an F/H DXpedition
// off the standard dials, a comment with no mode) cannot be matched exactly:
// "DATA" is in nobody's log. Such a spot is judged at digital-CLASS grain —
// worked if ANY digital mode of that call is logged on that band. Claiming
// NEW MODE because the label differs from FT8 was the reported bug.
generic := func(m string) bool {
switch strings.ToUpper(strings.TrimSpace(m)) {
case "", "DATA", "DIG", "DIGI", "DIGITAL":
return true
}
return false
}
digKey := func(call, band string) string {
return strings.ToUpper(strings.TrimSpace(call)) + "|" + strings.ToLower(strings.TrimSpace(band)) + "|DIG"
}
needToday := false
for _, q := range queries {
if q.Contest {
@@ -113,15 +129,23 @@ func (a *App) WatchlistWorkedSlots(queries []WatchlistSlotQuery) []bool {
if err == nil {
for _, r := range rows {
today[slotKey(r.Callsign, r.Band, r.Mode)] = true
today[digKey(r.Callsign, r.Band)] = qso.ModeClass(r.Mode) == "DIG" || today[digKey(r.Callsign, r.Band)]
}
}
}
for i, q := range queries {
key := slotKey(q.Call, q.Band, q.Mode)
if q.Contest {
out[i] = today[key]
if generic(q.Mode) {
out[i] = today[digKey(q.Call, q.Band)]
} else {
out[i] = today[slotKey(q.Call, q.Band, q.Mode)]
}
} else if generic(q.Mode) {
if idx.workedCallSlotsDig != nil {
_, out[i] = idx.workedCallSlotsDig[digKey(q.Call, q.Band)]
}
} else if idx.workedCallSlots != nil {
_, out[i] = idx.workedCallSlots[key]
_, out[i] = idx.workedCallSlots[slotKey(q.Call, q.Band, q.Mode)]
}
}
return out