feat(spot): put the award references in the spot comment
After the mode, which is the order a cluster line is read in: "CW POTA FR-11553". Two sources, because the QSO can be at either stage. While it is being typed the entry panel holds the references as "CODE@REF;CODE@REF"; once logged they live on the row as the materialised award_refs. The Send Spot window takes the entry's when there are any and falls back to the last logged QSO — the same fallback the callsign and frequency defaults already use — and picking a QSO from the Latest list fills in that QSO's own. A self-spot is the opposite case and gets its own builder: it announces OUR station, so it carries MY_POTA_REF and friends. Using the QSO's award references there would spot us with the park number of the station we just worked, announcing us from somewhere we are not. Both cap at the 30 characters a cluster node keeps, and add a reference whole or not at all — a truncated park number is worse than none, since nobody can act on it, and it still costs everyone who reads the spot. Only the comment we BUILD is held to that; what the operator types is their own business.
This commit is contained in:
+18
-1
@@ -55,7 +55,7 @@ import {
|
||||
QSLViaRepairStatus, RepairQSLVia, DismissQSLViaRepair,
|
||||
} from '../wailsjs/go/main/App';
|
||||
import { Combobox } from '@/components/ui/combobox';
|
||||
import { applyAwardRefs } from '@/lib/awardRefs';
|
||||
import { applyAwardRefs, parseAwardRefs as parseManualRefs, spotRefList } from '@/lib/awardRefs';
|
||||
import { EventsOn, BrowserOpenURL, WindowMinimise, WindowToggleMaximise, WindowIsMaximised, Quit } from '../wailsjs/runtime/runtime';
|
||||
import type { adif as adifModels, lookup as lookupModels, cat as catModels } from '../wailsjs/go/models';
|
||||
import type { QSOForm, WorkedBeforeView, StationSettingsForm, ListsSettingsForm, ModePresetForm } from '@/types';
|
||||
@@ -2086,6 +2086,19 @@ export default function App() {
|
||||
const [showScp, setShowScp] = useState(() => localStorage.getItem('opslog.showScp') !== '0');
|
||||
const [showBeamOnMap, setShowBeamOnMap] = useState(() => localStorage.getItem('opslog.showBeamOnMap') !== '0');
|
||||
|
||||
// Award references offered to the Send Spot window, as cluster-ready strings.
|
||||
//
|
||||
// The entry panel holds them as "CODE@REF;CODE@REF" while the QSO is being
|
||||
// typed; once it is logged they live on the row as the materialised award_refs
|
||||
// object. Take the entry's when there is one — spotting usually happens with
|
||||
// the station still in the field — and fall back to the last logged QSO, which
|
||||
// is where the callsign and frequency defaults come from too.
|
||||
const spotEntryRefs = useMemo(() => {
|
||||
const entry = spotRefList(parseManualRefs(details.award_refs ?? ''));
|
||||
if (entry.length) return entry;
|
||||
return spotRefList(parseAwardRefs(qsos[0]?.award_refs));
|
||||
}, [details.award_refs, qsos]);
|
||||
|
||||
// Award code → scanned field (e.g. POTA→pota_ref, WWFF→wwff). Used to route
|
||||
// picked award references to the QSO field/extras each award actually reads.
|
||||
const awardFieldRef = useRef<Record<string, string>>({});
|
||||
@@ -7216,6 +7229,9 @@ export default function App() {
|
||||
: (qsos[0]?.freq_hz ? Math.round((qsos[0].freq_hz / 1000) * 10) / 10 : 0)
|
||||
}
|
||||
defaultMode={mode || qsos[0]?.mode || ''}
|
||||
// Award references: the ones on the QSO being entered, else those already
|
||||
// logged for the last QSO — the same source the callsign above falls back to.
|
||||
defaultRefs={spotEntryRefs}
|
||||
targetName={
|
||||
clusterServers
|
||||
.filter((s) => s.enabled)
|
||||
@@ -7226,6 +7242,7 @@ export default function App() {
|
||||
freqKHz: q.freq_hz ? Math.round((q.freq_hz / 1000) * 10) / 10 : 0,
|
||||
mode: q.mode ?? '',
|
||||
band: q.band,
|
||||
refs: spotRefList(parseAwardRefs(q.award_refs)),
|
||||
}))}
|
||||
onSend={async (call, freqKHz, comment) => {
|
||||
await SendClusterSpot(call, freqKHz, comment);
|
||||
|
||||
Reference in New Issue
Block a user