Export QSOs: date-range filter uses a Material date picker (typing still works) - #627
Merged
Merged
Conversation
The From/To date-range fields in the Export QSOs sheet were plain numeric EditTexts requiring a hand-typed YYYYMMDD value with no calendar UI and no validation. This adds a MaterialDatePicker behind a trailing calendar icon on each field while keeping the field fully editable by keyboard. - Tapping the calendar icon opens a Material date picker; a valid YYYYMMDD already in the field is preselected, otherwise today. - Selecting a date fills the field as YYYYMMDD; typed entry still works and a field can be cleared back to empty (empty = no bound, unchanged). - On Share / Save, a non-empty field that is not a strict YYYYMMDD date is rejected with a ToastMessage instead of running a broken query. - The value handed to ShareLogs remains a YYYYMMDD string (or null), so the query-layer date contract is unchanged. Date parse/validate/format logic is extracted to package-private static helpers on ExportLogSheet and covered by ExportLogSheetDateTest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This pull request updates the Android Export QSOs dialog to support selecting an optional date range via a Material date picker while keeping the existing typed YYYYMMDD workflow (and the downstream ShareLogs date-string contract) intact.
Changes:
- Added a calendar affordance to the “From” / “To” date fields and wired it to a
MaterialDatePickerwith UTC-based parse/format helpers. - Added strict upfront validation for non-empty date inputs before running Share/Save exports.
- Added pure-JVM unit tests covering date validation/parsing/formatting behaviors and edge cases.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ft8af/app/src/main/java/com/k1af/ft8af/ui/ExportLogSheet.java | Adds date-picker wiring, strict YYYYMMDD validation, and UTC parse/format helpers used by both picker and typed input paths. |
| ft8af/app/src/main/res/layout/dialog_export_log.xml | Updates the export dialog date inputs with trailing calendar icon, hint/copy adjustments, and input constraints (maxLength=8). |
| ft8af/app/src/main/res/drawable/ic_calendar_today.xml | Introduces a calendar vector drawable used as the date-field trailing icon. |
| ft8af/app/src/test/java/com/k1af/ft8af/ui/ExportLogSheetDateTest.java | Adds JVM unit tests for the new date helper methods (validation, parsing, formatting, round-trip). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review: the trailing calendar icon is a touch-only hit
target on the EditText's compound drawable, so TalkBack users could not
activate the picker. Register a ViewCompat custom accessibility action
("Open calendar date picker") on each field so the picker path is
operable via accessibility services, not just touch.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7 tasks
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.
Summary
The Export QSOs sheet's date-range filter ("From" / "To") was two plain numeric
EditTextfields where the user had to hand-type a date asYYYYMMDD— no calendar, no validation. This adds a Material date picker behind a trailing calendar icon on each field while keeping the field fully editable by keyboard, so both input methods stay in sync and both emit the exactYYYYMMDDstring the query layer expects.What changed
dialog_export_log.xml— each date field gets a trailingdrawableEndcalendar icon (ic_calendar_today.xml, new vector),maxLength=8, updated hint (YYYYMMDD) and label copy (From (optional)/To (optional)), plus a content description. The fields stay editable (notfocusable=false).ExportLogSheet.javaMaterialDatePicker(shown via the hostingFragmentActivity'sFragmentManager). A validYYYYMMDDalready in the field is preselected; otherwise today.YYYYMMDD. Typed entry still works; a field can be cleared back to empty (empty = no bound, unchanged behavior).YYYYMMDDcalendar date is rejected up front withToastMessage.show(...)instead of running a broken query.ShareLogs.doShareLogs(...)/downQSLTableToFile(...)remains aYYYYMMDDstring (ornullwhen empty) — theShareLogsdate contract is untouched.Testable logic
Per the repo's testing rule, the parse/validate/format decisions are extracted to package-private static helpers on
ExportLogSheet(isValidOptionalDate,parseYyyyMmddUtc,formatYyyyMmddUtc) so the UI wrapper stays thin. All conversions are UTC to matchMaterialDatePicker.todayInUtcMilliseconds(). Validation is strict (real calendar dates only — rejects Feb 30, month 13, wrong length, non-numeric, and year-0 via a format round-trip).Tests
New
ExportLogSheetDateTest(14 cases, pure JVM, no Robolectric needed) covering empty/null= valid, well-formed dates, whitespace tolerance, wrong length, non-numeric, impossible month/day, leap-day correctness, year-zero rejection, UTC-midnight parsing, formatting, and round-tripping.Acceptance criteria
YYYYMMDD.YYYYMMDDstill filters viaq.qso_date >= ?/<= ?.ShareLogsis unchanged in format.Notes / assumptions
dialog_export_log.xml,ExportLogSheet.java, the new icon drawable, and the new test.ShareLogsis untouched.🤖 Generated with Claude Code