fix(flex): send the spot-click zoom after the tune, not alongside it

Double-clicking a cluster spot tuned the slice and zoomed the panadapter in
the same breath. On a cross-band jump SmartSDR moves the panadapter itself to
follow the slice, and that follow lands after — and overrides — a zoom sent in
the same instant, so the width the operator configured never appeared. A spot
clicked ON the panadapter never hit this, because the radio had already tuned
before our zoom arrived; the two paths now behave the same. The Chase new
panel's pick is sequenced identically.
This commit is contained in:
2026-08-29 02:45:07 +02:00
parent 29267a865c
commit ea6fb1c29c
2 changed files with 17 additions and 9 deletions
+13 -7
View File
@@ -3304,11 +3304,16 @@ export default function App() {
noteManualEdit();
}
if (s.band) setBand(s.band);
if (catState.connected) tuneRigCAT(s.freq_hz, m);
// The panadapter width follows the MODE of the spot, when the option is on.
// AFTER the tune, deliberately: a view change must never delay the frequency
// change the operator is waiting for. A no-op on any backend but a Flex.
FlexZoomForSpot(m ?? '', s.freq_hz ?? 0).catch(() => {});
// A no-op on any backend but a Flex. Sequenced AFTER the tune settles, not
// fired alongside it: on a cross-band jump SmartSDR moves the panadapter
// itself to follow the slice, and that follow lands after — and overrides —
// a zoom sent in the same instant. (A spot clicked ON the panadapter never
// hit this: the radio had already tuned before our zoom arrived.)
const zoom = () => FlexZoomForSpot(m ?? '', s.freq_hz ?? 0).catch(() => {});
if (catState.connected) {
void tuneRigCAT(s.freq_hz, m).then(() => window.setTimeout(zoom, 300));
} else zoom();
if (m) applyModeFromSpot(m);
onCallsignInput(s.dx_call, { force: true });
applySpotRefs((s as any).pota_ref, (s as any).sota_ref);
@@ -7421,9 +7426,10 @@ export default function App() {
entry, and the rig onto the frequency it was decoded on. */}
<ChaseNewPanel onPick={(sp) => {
onCallsignInput(sp.call, { force: true });
if (sp.freq_hz) void tuneRigCAT(sp.freq_hz, sp.mode);
// And the panadapter width too: same gesture as any other spot click.
if (sp.freq_hz) FlexZoomForSpot(sp.mode ?? '', sp.freq_hz).catch(() => {});
// And the panadapter width too — after the tune settles, for the
// same SmartSDR pan-follow reason as handleSpotClick.
if (sp.freq_hz) void tuneRigCAT(sp.freq_hz, sp.mode).then(() =>
window.setTimeout(() => FlexZoomForSpot(sp.mode ?? '', sp.freq_hz ?? 0).catch(() => {}), 300));
}} onClose={() => { setShowChaseNew(false); writeUiPref('opslog.showChaseNew', '0'); }} />
</div>
)}