Skip to content

Add callsign/grid/band search to the Logbook Recent tab#677

Merged
patrickrb merged 1 commit into
devfrom
optio/task-e30c9f2b-244f-4cb9-b8dd-5d41fa8c551a
Jul 24, 2026
Merged

Add callsign/grid/band search to the Logbook Recent tab#677
patrickrb merged 1 commit into
devfrom
optio/task-e30c9f2b-244f-4cb9-b8dd-5d41fa8c551a

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

What & why

The Logbook Recent tab listed every logged QSO with no way to search. Answering the everyday operator question — "have I worked this station before, and on what band?" — meant scrolling the entire log. This PR adds a search box above the recent list that filters the log as you type.

Users notice this immediately: tap Logbook → Recent, type a partial call, and the list narrows to matching contacts.

Behavior

  • Case-insensitive substring match (so "PA" finds both PA3XYZ and W1PA) across the fields an operator actually searches a log by:
    • callsign (primary)
    • grid (e.g. FN42)
    • band (e.g. 40M)
    • DXCC entity (e.g. Japan)
    • stored location / "where"
  • A blank query shows the full list (no filtering).
  • A clear (✕) button resets the query.
  • When records exist but nothing matches, a distinct "No matching QSOs" state is shown with the search box still in place, so the query can be refined or cleared.
  • The query lives in a rememberSaveable, so it survives rotation/recomposition but resets when you leave the Logbook — matching the expectation that search is a transient "find this contact" action, not a persisted filter.

Design

Per the project convention (Composables can't be unit-tested directly), all match logic is extracted into a pure top-level internal fun filterQsoRecords(records, query); the search bar (LogSearchBar) is a thin Compose wrapper that just calls it. Sorting is unchanged — the filtered list still flows through the existing sortQsosByDateTimeDesc.

Tests

New LogbookSearchTest (pure JVM, no Robolectric) covering: blank/whitespace query passthrough, callsign prefix + mid-string substring, case-insensitivity, match by grid/band/DXCC/where, query trimming, no-match empty result, empty log, and null optional fields.

./gradlew :app:testDebugUnitTest --tests "radio.ks3ckc.ft8af.ui.logbook.*"  → BUILD SUCCESSFUL

:app:compileDebugKotlin also passes. No decoder/TX/protocol code touched.

Scope

Focused, additive, UI-only. Nothing outside the Recent tab changes.

The Recent tab listed every logged QSO with no way to search, so answering
the everyday question "have I worked this station before, and on what band?"
meant scrolling the whole log. Add a search box above the recent list that
filters as you type.

The match is a case-insensitive substring over the fields an operator actually
searches a log by — callsign (primary), grid, band, DXCC entity, and the stored
location — so a partial call ("K1A"), a grid ("FN42"), a band ("40M"), or a
country all narrow the list. A clear (✕) button resets it, and a distinct
"no matching QSOs" state keeps the search box in place so the query can be
refined. The match logic is extracted into a pure, unit-tested filterQsoRecords
helper; the search bar is a thin Compose wrapper over it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 12.82051% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.71%. Comparing base (d5686e7) to head (106dd68).

Files with missing lines Patch % Lines
...lin/radio/ks3ckc/ft8af/ui/logbook/LogbookScreen.kt 12.82% 68 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #677      +/-   ##
============================================
- Coverage     36.73%   36.71%   -0.03%     
- Complexity      197      211      +14     
============================================
  Files           216      219       +3     
  Lines         26882    27168     +286     
  Branches       3284     3340      +56     
============================================
+ Hits           9876     9975      +99     
- Misses        16781    16957     +176     
- Partials        225      236      +11     
Flag Coverage Δ
android 15.38% <12.82%> (+0.35%) ⬆️
native 9.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...lin/radio/ks3ckc/ft8af/ui/logbook/LogbookScreen.kt 7.49% <12.82%> (+0.89%) ⬆️

... and 13 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@patrickrb
patrickrb merged commit 593720c into dev Jul 24, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant