Make Worked All States (WAS) award real, with the states still needed#666
Merged
Merged
Conversation
The Logbook's WAS award was a placeholder: AwardsTab derived its worked count from DXCC entities (dxccEntities * 50 / 340), so the number shown had nothing to do with which US states the operator had actually contacted. FT8AF already resolves a QSO's US state from its Maidenhead grid (UsStateLookup), so real WAS progress can be computed straight from the logbook. This adds a pure WorkedAllStates helper (workedStates / neededStates / neededStatesPreview, with DC excluded) and wires it in: - Stats tab gains a real Worked All States progress bar (x / 50). - Awards tab's WAS card now shows the true worked count and, below the bar, a capped preview of the states still needed -- the at-a-glance list a WAS chaser actually wants. Chasing WAS is one of the most popular FT8 activities for the large US operator base, so an honest, actionable WAS tracker is a noticeable win. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #666 +/- ##
============================================
- Coverage 36.70% 36.67% -0.04%
Complexity 211 211
============================================
Files 222 223 +1
Lines 27479 27548 +69
Branches 3395 3406 +11
============================================
+ Hits 10087 10104 +17
- Misses 17147 17198 +51
- Partials 245 246 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Implements real Worked All States (WAS) award tracking in the Logbook by deriving distinct worked US states from logged Maidenhead grids, and surfaces the remaining needed states directly in the Awards UI.
Changes:
- Add pure WAS helper utilities (
workedStates,neededStates,neededStatesPreview) with a canonical 50-state list (excluding DC). - Wire WAS progress into Logbook stats/awards, including a capped “states needed” chip preview on the WAS award card.
- Add plain-JVM unit tests covering state collection, ordering, DC/unresolved exclusion, locale-insensitive uppercasing, and preview capping.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/ui/logbook/WorkedAllStates.kt | Adds pure helper logic for computing worked/needed WAS states and a capped preview list. |
| ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/ui/logbook/LogbookScreen.kt | Computes WAS from QSO grids via UsStateLookup, displays WAS progress, and renders remaining-state chips on the WAS award card. |
| ft8af/app/src/main/res/values/strings_compose.xml | Adds strings for the WAS label and the “states needed” header. |
| ft8af/app/src/test/kotlin/radio/ks3ckc/ft8af/ui/logbook/WorkedAllStatesTest.kt | Adds unit tests validating the WAS helpers’ correctness and edge cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uppercasing the grid with the default locale could mis-resolve under the Turkish locale (lower-case 'i' -> dotted 'İ'), missing the ASCII keys. Normalize at the lookup source so every caller is locale-safe, and add a Turkish-locale regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…77-4a53-9dbf-055c4fc7e70b # Conflicts: # ft8af/app/src/main/res/values/strings_compose.xml
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.
What & why
Working all 50 US states (WAS) is one of the most popular pursuits in FT8, especially for the large US operator base. FT8AF's Logbook already had a WAS award card — but it was fake:
AwardsTabcomputed the "worked" count from DXCC entities:So the number a user saw had nothing to do with which states they'd actually contacted. This PR makes WAS real and, more importantly, shows the operator which states they still need.
How
FT8AF already resolves a QSO's US state from its Maidenhead grid (
UsStateLookup, backed by theus_grid_states.jsonasset). This PR adds a small, pure helper next to the existing logbook heatmap logic:WorkedAllStates.ktWAS_STATES— the 50 states (DC deliberately excluded; it isn't a WAS state).workedStates(grids, gridToState)— distinct worked states, grid→state resolution injected as a lambda so it unit-tests without an Android context.neededStates(worked)— the states still needed, in canonical order.neededStatesPreview(remaining, max)— caps the on-card chip list so a fresh log never renders all 50.Wiring:
x / 50).+Nchip when there are more).The count is derived from worked QSOs, consistent with how the existing DXCC / CQ-zone / ITU-zone stats already work.
User benefit
Open the Logbook → Awards and you can immediately see "37/50, still need MT ND WY SD…" instead of a meaningless placeholder number. That's a genuine, everyday tool for the huge base of US FT8 operators chasing WAS.
Tests
New
WorkedAllStatesTest(15 cases, plain-JVM — no Robolectric needed): the 50-state list, distinct collection, DC/unresolved-grid exclusion, dedup, locale-insensitive upper-casing, needed-set ordering, and the preview cap/overflow split. Fullradio.ks3ckc.ft8af.ui.logbook.*suite passes;compileDebugKotlin/processDebugResourcessucceed with the new Compose UI and string resources.Assumptions
🤖 Generated with Claude Code