POTA: show mode, ago time, long-press for UTC in contact list - #787
POTA: show mode, ago time, long-press for UTC in contact list#787patrickrb wants to merge 2 commits into
Conversation
Update the per-contact row shown on the Activate tab (during an
activation) and on the historical activation detail screen so the
timestamp is a relative "5m ago" readout that stays fresh via a 30s
tick, and long-pressing the time surfaces a Toast with the original UTC
readout. Also add the QSO mode alongside band/grid on the second line
so the operator can tell at a glance which mode each contact was worked
on when the log carries a mix (FT8, MFSK, etc.).
Extracts the time-formatting decisions into three internal helpers so
the row remains a thin Composable wrapper:
- parseQsoUtcMs — mirrors PotaQsoWindow's HHMMSS normalization
(variable-width time_on, dropped leading zero) to turn qso_date +
time_on into a GMT epoch.
- formatQsoTimeAgo — buckets into just now / seconds / minutes /
hours / days, clamping negative deltas to "just now" so clock skew
can't produce "-2m ago".
- formatQsoTimeUtc — the HH:MMz long-press readout (formerly the
only display).
Closes #783
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #787 +/- ##
============================================
+ Coverage 21.66% 23.50% +1.84%
- Complexity 149 226 +77
============================================
Files 163 184 +21
Lines 20877 23736 +2859
Branches 3128 3664 +536
============================================
+ Hits 4523 5580 +1057
- Misses 16167 17895 +1728
- Partials 187 261 +74
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.
🟡 Changes recommended
Invalid and variable-width timestamps can produce incorrect displays, and new metadata formatting lacks required tests.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates POTA contact rows with mode metadata, relative timestamps, periodic refreshes, and long-press UTC display.
Changes:
- Shows
MODE · BAND · GRID. - Adds relative/UTC timestamp helpers and 30-second refreshes.
- Adds unit coverage for timestamp formatting.
File summaries
| File | Description |
|---|---|
PotaScreen.kt |
Implements updated contact rows and time handling. |
PotaQsoTimeFormattingTest.kt |
Tests timestamp parsing and formatting. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Closes #783
What changed
Reworks the per-contact row shown on the POTA Activate tab (during an activation) and on the historical activation detail screen:
MODE · BAND · GRID(any blank fields are dropped).just now/45s ago/5m ago/2h ago/3d ago. The label re-renders every 30s via a sharednowMstick so it doesn't stay stuck at whatever it said when the list first drew.HH:MMzUTC readout, matching the request in the issue.The composable stays a thin wrapper — the timestamp decisions are extracted into three testable
internalhelpers inPotaScreen.kt:parseQsoUtcMs(qsoDate, timeOn)— mirrorsPotaQsoWindow's HHMMSS normalization (variable-widthtime_on, dropped leading zero from ADIF imports) to build a GMT epoch. Returnsnullfor un-datable rows.formatQsoTimeAgo(qsoMs, nowMs)— buckets by seconds/minutes/hours/days. Clamps negative deltas tojust nowso device-clock skew (device slightly behind rig time, imported future timestamp) can't render-2m ago.formatQsoTimeUtc(timeOn)— theHH:MMzlong-press readout (formerly the only display, still the fallback whenqso_dateisn't parseable).Backed by 20 new unit tests in
PotaQsoTimeFormattingTest.How to test
Unit tests:
(Full suite:
./gradlew testDebugUnitTest— 1685 tests, all pass.)On device:
cmd.exe /c "gradlew.bat installDebug"(Windows) or./gradlew assembleDebug && adb install -r app/build/outputs/apk/debug/app-debug.apk(macOS).MODE · BAND · GRIDon the second line, and the right-side time reads e.g.just now/5m ago.HH:MMz.