Add deep-linking for SOTAcat integration#198
Open
jeffkowalski wants to merge 5 commits intoham2k:mainfrom
Open
Add deep-linking for SOTAcat integration#198jeffkowalski wants to merge 5 commits intoham2k:mainfrom
jeffkowalski wants to merge 5 commits intoham2k:mainfrom
Conversation
Add deep-linking URL scheme to enable companion app integration (e.g., SOTAcat) for chase, spot, and S2S scenarios. URL scheme: com.ham2k.polo://qso?params... Parameters (all camelCase, my/their prefix for clarity): - myRef: Our activation reference (e.g., K-1234) - mySig: Our activation type (sota, pota, wwff, gma, wca, zlota) - myCall: Our callsign - theirRef: Their activation reference (e.g., W6/CT-006) - theirSig: Their activation type - theirCall: Their callsign - freq: Frequency in Hz - mode: Operating mode (CW, SSB, etc.) - time: Timestamp in milliseconds At least one ref pair (myRef+mySig or theirRef+theirSig) required. Use cases: 1. Chase: theirRef+theirSig only - creates generic operation 2. Spot: myRef+mySig only - opens/creates matching activation 3. S2S/P2P: both ref sets - opens our activation, pre-fills their ref Files: - DeepLinkUtils.js: Pure functions (parseDeepLinkURL, buildSuggestedQSO) - DeepLinkHandler.js: React hooks (useDeepLinkHandler, DeepLinkListener) - DeepLinkHandler.spec.js: 44 unit tests - App.jsx: Mounts DeepLinkListener in NavigationContainer - AndroidManifest.xml: Intent-filter for com.ham2k.polo scheme Includes commented placeholder for IOTA (not yet supported in Polo). Tested with: npm test -- --testPathPattern=DeepLinkHandler
- Prevent re-processing of initial cold-start URL when handleDeepLink dependencies change - Add _replace marker support in deepMergeState for clean object replacement instead of recursive merging - Fix queue mutation bug (was mutating Redux state directly) - Exclude suggestedQSO from closure spread to prevent stale data - Use hunting types (pota, sota) instead of activation types for chase QSO refs
SOTAcat sends frequency in Hz, but app stores internally in kHz. parseFrequency() now divides by 1000 to convert properly. Fixes incorrect ADIF exports (7245.000000 → 7.245000 MHz) and wrong band derivation (submm → 40m).
Add host="qso" to deep-link intent-filter so MainActivity only handles qso:// URLs, leaving sota:// for OAuth RedirectUriReceiverActivity.
When a deep link set freq/mode, the first QSO used it correctly but submitting reverted to the previous freq. This happened because the blank QSO (with stale freq) was queued when switching to the deep-linked QSO, then popped back after submit, overriding the new VFO. Two fixes: 1. Don't queue blank QSOs when a deep-linked suggested QSO is arriving (the blank has no user data worth preserving) 2. Update VFO Redux state when a deep link arrives so the freq persists even if the user wipes the suggested QSO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds deep-link handling so companion apps like SOTAcat can send spotted stations directly into Polo for logging. A deep link pre-fills a suggested QSO with frequency, mode, and reference info, navigating the user straight to the logging screen.
URL format
com.ham2k.polo://qso?<parameters>Example:
com.ham2k.polo://qso?myRef=W6/NC-371&mySig=sota&theirRef=W6/CT-006&theirSig=sota&freq =7032000&mode=CW&theirCall=N0CALLParameters (at least one ref pair required):
myRef/mySig— our activation reference and type (finds or creates a matching operation)theirRef/theirSig— their reference and type (added as a hunt ref on the QSO)freq— frequency in Hz (converted to kHz internally)mode— operating mode (CW, SSB, etc.)theirCall/myCall— callsignstime— timestamp in msSupported types:
sota,pota,wwff,gma,wca,zlotaChanges
New files:
src/deep-linking/DeepLinkUtils.js— pure functions:parseDeepLinkURL(),buildSuggestedQSO(), frequency Hz-to-kHz conversionsrc/deep-linking/DeepLinkHandler.js—useDeepLinkHandler()hook with cold/warm start handling,findOrCreateOperation(),DeepLinkListenercomponentsrc/deep-linking/DeepLinkHandler.spec.js— 51 unit tests covering URL parsing, type mapping, frequency conversion, and QSO buildingsrc/deep-linking/index.js— barrel exportsModified files:
AndroidManifest.xml— intent-filter forcom.ham2k.poloscheme withandroid:host="qso"(scoped to avoid catching OAuth redirects)App.jsx— mount<DeepLinkListener />inside NavigationContainerOperationScreen.jsx— inject suggested QSO into logging state via Redux with_replacesemantics; update VFO with deep-link freq/mode/bandOpLoggingTab.jsx— split-view suggested QSO handling deferred to OperationScreenLoggingPanel.jsx— prevent queuing blank QSOs when a suggested QSO is arriving;suggestedQSOexcluded from closure spread insetQSOto prevent stalereintroduction; queue copy-before-pop to avoid Redux mutation
uiSlice.js—_replacemarker support indeepMergeStatefor atomic state replacementTests performed
myRef— verify matching operation is found or createdtheirRefonly (chase mode) — verify generic operation created