feat: wheel over RST; PSK Reporter keeps the band's window
The mouse wheel steps the RST fields — one S-unit on an RST or RS, one decibel on a digital report, up for a better one — in the entry strip and in the QSO editor. The dropdown beside them lists the reports worth having to hand, not all 41 decibels, so the wheel works on the value rather than walking the list. The listener is native and non-passive: React attaches onWheel passively, where preventDefault does nothing and the panel scrolls away under the field being adjusted. PSK Reporter, whole-band scope: clicking a decode reset the report count to zero. The window there is the BAND's — every FTx report on it, filtered by target only when the analysis is drawn — and it was emptied on every target change, throwing away an hour of evidence at the moment the operator asked the question it answers. The narrow scope still clears it: there the window is one station's, and keeping it would answer the new question with the old station's evidence.
This commit is contained in:
@@ -156,3 +156,26 @@ func TestACrowdedPassbandStillGetsAnAnswer(t *testing.T) {
|
||||
t.Errorf("suggested %d Hz, want the quietest slot around 2400", got)
|
||||
}
|
||||
}
|
||||
|
||||
// Under the band-wide scope the window is the BAND's, not the target's: it is
|
||||
// every FTx report on it, filtered by target only when the analysis is drawn.
|
||||
// Clearing it on a target change threw away an hour of accumulated evidence at
|
||||
// the exact moment it was worth something — the operator clicking a decode to
|
||||
// ask "can he hear me" saw the report count drop to zero.
|
||||
func TestBandScopeKeepsItsWindowAcrossATargetChange(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
scope Scope
|
||||
keep bool
|
||||
}{{ScopeBand, true}, {ScopeTarget, false}} {
|
||||
w := &Watcher{cfg: Config{Scope: tc.scope, Logf: func(string, ...any) {}}}
|
||||
w.target, w.mode = "OLD", "FT8"
|
||||
w.spots = []spot{{TxCall: "OLD", RxCall: "F4BPO", at: time.Now()}}
|
||||
|
||||
w.dropWindowOfPreviousTarget()
|
||||
w.target = "NEW"
|
||||
|
||||
if got := len(w.spots) > 0; got != tc.keep {
|
||||
t.Errorf("%s scope: window kept = %v, want %v", tc.scope, got, tc.keep)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user