Skip to content

Fix/activity filter#300

Open
swedishfrenchpress wants to merge 6 commits intomainfrom
fix/activity-filter
Open

Fix/activity filter#300
swedishfrenchpress wants to merge 6 commits intomainfrom
fix/activity-filter

Conversation

@swedishfrenchpress
Copy link
Copy Markdown
Collaborator

Summary

Replaces the expandable filter bar (#298) with overflow-menu actions and a date-filter bottom sheet. Drops the "Pending only" mode in favor of a binary Show/Hide pending toggle.

Example

04251004.mp4

Changes

  • Overflow menu: Show/Hide pending, Filter by date, Export to CSV.
  • Date sheet: All time, Last 7 days, Last 30 days, This month, Custom range (launches MaterialDatePicker).
  • Active-filter chip under the balance shows current state (e.g. Mar 15 – Apr 20 · Including pending). Tap or X clears all filters.
  • MaterialDatePicker themed light with brand accent, dialog mode (was generic dark fullscreen).
  • Migration: SharedPreferences filter_state: Inthide_pending: Boolean on first launch.

Testing + QA

  • [x ] Toggle pending from overflow → chip and list update.
  • [ x ] Pick a preset → chip shows date range; persists across relaunch. -
  • [ x ] Tap chip X → filters reset.
  • [ x ] Custom range → picker is light, dialog mode, brand accent.
  • [ x ] Export to CSV still works.

swedishfrenchpress and others added 5 commits April 25, 2026 09:36
Removes the expandable filter bar (#298) and folds its actions into
the existing three-dots overflow on the activity screen. Pending
toggle is now binary (Show/Hide pending); the obscure pending-only
mode is dropped. Date filter opens a bottom sheet with presets
(All time, Last 7/30 days, This month, Custom range).

Active filter state surfaces as a subtitle under the toolbar title
(e.g. "Mar 15 - Apr 20 · Pending shown") instead of duplicating
state in inline buttons.

Migrates legacy SharedPreferences key `filter_state` (Int) to
`hide_pending` (Boolean) once on first launch. Bottom sheet uses
setFragmentResult so selections survive rotation.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- Apply ThemeOverlay.Numo.MaterialCalendar to MaterialDatePicker so it
  uses the brand accent on a light surface in dialog mode, instead of
  the default fullscreen with the dark calendar grid.
- Move the active-filter caption out of the toolbar (which forced the
  title to shift vertically when it appeared) into the balance section
  under the sat amount. Title no longer moves; the list reflows below
  the indicator instead, which reads as content rather than chrome
  jitter.
- Tap the indicator to clear all filters (pending hidden, dates reset).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Replaces the bare caption with a Material Chip (outlined, brand-divider
stroke). The close icon makes the dismiss affordance explicit instead
of relying on a hidden ripple. Tapping the chip body or the close icon
both clear all filters.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Targeted copy pass on strings touched in the recent filter refactor:

- history_subtitle_pending_shown: "Pending shown" → "Including pending"
  (active voice; reads as an active filter, not a debug status).
- history_filter_date_range_format: en dash for date ranges.
- history_filter_date_all: "All Time" → "All time" (sentence case for
  consistency with the rest of the bottom sheet).
- history_filter_date_picker_title: "Select Date Range" → "Choose dates"
  (sentence case + tighter).
- history_menu_export_activity: "Export Activity" → "Export to CSV"
  (matches the existing success toast and is more specific about the
  outcome).

Scope intentionally limited to strings we introduced or actively use in
the filter refactor. Pre-existing copy elsewhere on the screen
(toolbar title, balance label, empty state, dialogs, row titles)
left untouched.

Translations in es/ja/ko/pt are now slightly out of sync semantically
(notably for export and date picker title); a follow-up translator
pass will reconcile.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Android XML strips leading/trailing whitespace from string resources
unless the value is wrapped in double quotes. The previous separator
" · " was being compiled down to "·", producing chip text like
"Apr 25·Including pending" with no breathing room between segments.
Wrapping the value in quotes preserves the spaces verbatim.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The "pending only" filter mode was removed in this PR. The test that
asserted the legacy filter_state=2 still produced a pending-only list
now fails as designed.

Repurposed it to assert the migration path we shipped: legacy
filter_state=2 maps to hide_pending=false (show all transactions),
the legacy key is removed from prefs, and the new key is written.
This gives regression coverage on the one-time migration code in
migrateLegacyFilterStateIfNeeded() rather than just deleting the test.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

❌ Patch coverage is 24.08759% with 104 lines in your changes missing coverage. Please review.
✅ Project coverage is 22.20%. Comparing base (5329fcd) to head (31ae660).

Files with missing lines Patch % Lines
...eams/numo/feature/history/DateFilterBottomSheet.kt 0.00% 56 Missing ⚠️
...ms/numo/feature/history/PaymentsHistoryActivity.kt 40.74% 45 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #300      +/-   ##
============================================
- Coverage     22.31%   22.20%   -0.11%     
+ Complexity      854      848       -6     
============================================
  Files           150      151       +1     
  Lines         19491    19547      +56     
  Branches       2490     2475      -15     
============================================
- Hits           4349     4340       -9     
- Misses        14580    14658      +78     
+ Partials        562      549      -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant