Skip to content

POTA: show mode, ago time, long-press for UTC in contact list - #787

Open
patrickrb wants to merge 2 commits into
devfrom
optio/task-13bef2d4-980e-4999-bd27-84226dff2445
Open

POTA: show mode, ago time, long-press for UTC in contact list#787
patrickrb wants to merge 2 commits into
devfrom
optio/task-13bef2d4-980e-4999-bd27-84226dff2445

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

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 is now shown alongside band and grid on the second line, so a mixed-mode log (FT8, MFSK, SSB, etc.) makes it obvious which mode each contact was worked on. Line reads MODE · BAND · GRID (any blank fields are dropped).
  • Time is now an "ago" readoutjust now / 45s ago / 5m ago / 2h ago / 3d ago. The label re-renders every 30s via a shared nowMs tick so it doesn't stay stuck at whatever it said when the list first drew.
  • Long-pressing the time column pops a Toast with the original HH:MMz UTC readout, matching the request in the issue.

The composable stays a thin wrapper — the timestamp decisions are extracted into three testable internal helpers in PotaScreen.kt:

  • parseQsoUtcMs(qsoDate, timeOn) — mirrors PotaQsoWindow's HHMMSS normalization (variable-width time_on, dropped leading zero from ADIF imports) to build a GMT epoch. Returns null for un-datable rows.
  • formatQsoTimeAgo(qsoMs, nowMs) — buckets by seconds/minutes/hours/days. Clamps negative deltas to just now so device-clock skew (device slightly behind rig time, imported future timestamp) can't render -2m ago.
  • formatQsoTimeUtc(timeOn) — the HH:MMz long-press readout (formerly the only display, still the fallback when qso_date isn't parseable).

Backed by 20 new unit tests in PotaQsoTimeFormattingTest.

How to test

Unit tests:

cd ft8af && ./gradlew testDebugUnitTest --tests radio.ks3ckc.ft8af.ui.pota.PotaQsoTimeFormattingTest

(Full suite: ./gradlew testDebugUnitTest — 1685 tests, all pass.)

On device:

  1. Install: cmd.exe /c "gradlew.bat installDebug" (Windows) or ./gradlew assembleDebug && adb install -r app/build/outputs/apk/debug/app-debug.apk (macOS).
  2. Open POTA → Activate. Start an activation and log a QSO (or open a past activation with contacts from History).
  3. Verify the contact row shows MODE · BAND · GRID on the second line, and the right-side time reads e.g. just now / 5m ago.
  4. Long-press the time — a Toast shows the UTC HH:MMz.
  5. Leave the screen open ~1 min and verify the "ago" advances (it ticks every 30s).

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

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.54237% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.50%. Comparing base (c2f63e8) to head (08d8f85).
⚠️ Report is 544 commits behind head on dev.

Files with missing lines Patch % Lines
...in/kotlin/radio/ks3ckc/ft8af/ui/pota/PotaScreen.kt 52.54% 25 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
android 17.03% <52.54%> (+3.89%) ⬆️
native 9.93% <ø> (ø)

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

Files with missing lines Coverage Δ
...in/kotlin/radio/ks3ckc/ft8af/ui/pota/PotaScreen.kt 5.22% <52.54%> (+4.31%) ⬆️

... and 69 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/ui/pota/PotaScreen.kt Outdated
Comment thread ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/ui/pota/PotaScreen.kt Outdated
Comment thread ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/ui/pota/PotaScreen.kt
Comment thread ft8af/app/src/test/kotlin/radio/ks3ckc/ft8af/ui/pota/PotaQsoTimeFormattingTest.kt Outdated
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.

2 participants