feat(search): offer every stored mode in the mode filter (JS8/FST4/JT65/Q65/Olivia/…)#242
Merged
Conversation
…65/Q65/PSK63/Olivia/…) The search mode dropdown hard-coded a 12-entry list that, among digital modes, only knew FT4/FT8/PSK31/MFSK. But ADIF import promotes a WSJT-X / fldigi SUBMODE to the effective mode (resolveAdifMode in @/lib/adif), so a QSO can land in the log as JS8, FST4, JT65, JT9, Q65, PSK63, Olivia or Contestia — none of which the dropdown offered, leaving those contacts unfilterable by mode. Introduce a canonical mode list at @/lib/modes (mirroring @/lib/bands: a server-imports-free single source of truth) and point the search filter at it. Matching is already case-insensitive on the server (UPPER(mode) = UPPER($n)), so the uppercase values match stored data. Guarded by tests/modes.spec.ts, in the same spirit as bands.spec.ts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
patrickrb
added a commit
that referenced
this pull request
Jul 24, 2026
The Quick Log card and the full new-contact form both hard-coded an 8-mode menu (SSB/CW/FT8/FT4/RTTY/PSK31/AM/FM). Search already offers the full canonical mode list (#242) and ADIF import promotes submodes like JS8/FST4/JT65/Q65/PSK63/Olivia — so an operator could import or filter those modes but could not *log* one without editing the QSO afterward. Both forms now draw their menu from the canonical AMATEUR_MODES, exactly as they already do for AMATEUR_BANDS. The per-mode RST default heuristic (duplicated and drifting between the two forms) is centralized as modes.defaultRstForMode, preserving the classification each form used. Co-authored-by: Optio Agent <optio-agent@noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The Search page's Mode filter drew from a hard-coded 12-entry list
(
['AM','FM','FT8','MFSK','RTTY','SSB','CW','FT4','PSK31','DMR','DSTAR','YSF']).Among digital modes it only knew FT4/FT8/PSK31/MFSK.
But Nextlog can store many more modes than that. ADIF import promotes a
WSJT-X / fldigi SUBMODE to the effective mode (
resolveAdifModein@/lib/adif, added in #240) — so a run logged under the genericMFSK/PSKparent lands in the log as
JS8,FST4,JT65,JT9,Q65,PSK63,OLIVIA,CONTESTIA, etc. None of those appeared in the dropdown, so thoseQSOs were unfilterable by mode — the exact class of drift bug #241 fixed
for the band filter.
Solution
Introduce a canonical mode list at
src/lib/modes.ts— a server-imports-freesingle source of truth, mirroring
src/lib/bands.ts(AMATEUR_BANDS) — andpoint the search filter at it via
AMATEUR_MODES. The list covers the modesthe logging forms offer, the popular weak-signal digital modes, keyboard/FSK
modes, SSTV, and the digital-voice modes, ordered so everyday modes sit at the
top of the dropdown.
Mode matching is already case-insensitive on the server
(
UPPER(mode) = UPPER($n)in@/lib/contact-search), so the uppercase valuesmatch whatever import/logging stored. No API or schema change; every mode the
old list offered is retained (no regression).
Testing
tests/modes.spec.tsguards the source of truth (no duplicates,canonical uppercase, covers logging-form modes, covers the import-promoted
submodes, retains the legacy list, and keeps the everyday modes at the top) —
same spirit as
tests/bands.spec.ts.npx playwright test tests/modes.spec.ts tests/bands.spec.ts→ 10 passed.npm run typecheck→ clean.npm run lint→ clean.npm run build→ succeeds (/searchcompiles); the only build failure seenlocally was an offline Google-Fonts fetch, unrelated to this change.
Future follow-up
new-contact,QuickLogCard) still offer their ownshorter 8-mode menu; a later sweep could source them from
AMATEUR_MODEStoo (kept out of scope here to avoid touching RST-default logic).
filter-chips-demopage keeps its own copy of the old list — it's ademo, not product surface, so it was left untouched.
🤖 Generated with Claude Code