fix(#41,#42,#43): numeric amount input, clickable DateField, search-based category picker #47

Merged
admin merged 1 commits from fix/41-42-43-form-input-fixes into main 2026-06-28 14:59:29 +00:00
Owner

Summary

  • #41setAmount in both Add/Edit ScreenModels now pipes through a new String.sanitizeAmountInput() (digits + at most one .), so KeyboardType.Decimal can no longer be bypassed via paste or hardware keys.
  • #42DateField is wrapped in a Box.clickable; the entire row (label, text, icon) opens the date picker. Inner OutlinedTextField stays readOnly = true; the trailing IconButton is replaced with a plain Icon since the Box now owns the click. Both Add/Edit screens get the fix for free.
  • #43CategoryDropdownField is replaced by a new CategoryPickerField that opens a new generic ListSearchDialog (search bar, scrollable list, leading color swatch, trailing checkmark on the selected row). The dialog mirrors the ListSearchPreferenceWidget UX but is decoupled from the Preference machinery. ListSearchPreferenceWidget is unchanged.

Test plan

  • ./gradlew assembleDebug — BUILD SUCCESSFUL
  • ./gradlew :app:testDebugUnitTest — BUILD SUCCESSFUL
  • ./gradlew :app:lintDebug — no new errors in changed files (only pre-existing LocalContextGetResourceValueCall in ExpenseListScreen.kt:124)
  • Manual: in Add Expense and Add Recurring, type letters/symbols in the Amount field → input is rejected, only digits and a single . land in state
  • Manual: tap anywhere on the Date field (label, text, or calendar icon) → date picker opens
  • Manual: tap the Category field → search dialog opens with swatch + name, typing in the search bar filters live, tapping a row selects it and closes the dialog

Closes #41, Closes #42, Closes #43

## Summary - **#41** — `setAmount` in both Add/Edit ScreenModels now pipes through a new `String.sanitizeAmountInput()` (digits + at most one `.`), so `KeyboardType.Decimal` can no longer be bypassed via paste or hardware keys. - **#42** — `DateField` is wrapped in a `Box.clickable`; the entire row (label, text, icon) opens the date picker. Inner `OutlinedTextField` stays `readOnly = true`; the trailing `IconButton` is replaced with a plain `Icon` since the Box now owns the click. Both Add/Edit screens get the fix for free. - **#43** — `CategoryDropdownField` is replaced by a new `CategoryPickerField` that opens a new generic `ListSearchDialog` (search bar, scrollable list, leading color swatch, trailing checkmark on the selected row). The dialog mirrors the `ListSearchPreferenceWidget` UX but is decoupled from the `Preference` machinery. `ListSearchPreferenceWidget` is unchanged. ## Test plan - [x] `./gradlew assembleDebug` — BUILD SUCCESSFUL - [x] `./gradlew :app:testDebugUnitTest` — BUILD SUCCESSFUL - [x] `./gradlew :app:lintDebug` — no new errors in changed files (only pre-existing `LocalContextGetResourceValueCall` in `ExpenseListScreen.kt:124`) - [ ] Manual: in Add Expense and Add Recurring, type letters/symbols in the Amount field → input is rejected, only digits and a single `.` land in state - [ ] Manual: tap anywhere on the Date field (label, text, or calendar icon) → date picker opens - [ ] Manual: tap the Category field → search dialog opens with swatch + name, typing in the search bar filters live, tapping a row selects it and closes the dialog Closes #41, Closes #42, Closes #43
admin added 1 commit 2026-06-28 14:55:46 +00:00
#41: pipe amount input through sanitizeAmountInput() (digits + single
decimal) in both AddEditExpenseScreenModel and AddEditRecurringScreenModel
so KeyboardType.Decimal is no longer bypassable via paste or hardware keys.

#42: wrap DateField's OutlinedTextField in a Box.clickable so the whole
row (label, text, icon) opens the date picker, not just the trailing icon.

#43: replace CategoryDropdownField with a new CategoryPickerField that
opens a generic ListSearchDialog (search bar, scrollable list, swatch,
checkmark on selected row), decoupled from the Preference machinery.
ListSearchPreferenceWidget is unchanged.
admin merged commit a5a1422c47 into main 2026-06-28 14:59:29 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/ledgerr#47