-
Notifications
You must be signed in to change notification settings - Fork 136
[Bookings] Show filter count on filters screen #14919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bookings] Show filter count on filters screen #14919
Conversation
Moves the `updatedBookingFilters` extension property from the `BookingFilterListViewModel` file into the `BookingFilterListUiState` class.
Updates the title of the booking filters screen to display the number of currently active filters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the booking filter list UI to display a dynamic filter count in the title. The changes consolidate filter-related logic into the UI state class and update the title bar to show the number of active filters.
Key Changes
- Moved
updatedBookingFiltersproperty from ViewModel toBookingFilterListUiStatefor better encapsulation - Added dynamic title property to
BookingFilterListUiStatethat displays filter count when filters are active - Updated string resource from
bookings_filters_count_titletobookings_filters_title_with_countand changed format specifier from%dto%s
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| WooCommerce/src/main/res/values/strings.xml | Renamed string resource key and changed format specifier from %d to %s to work with UiString framework |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/filter/BookingFilterListViewModel.kt | Removed updatedBookingFilters extension property as it was moved to the UI state class |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/filter/BookingFilterListUiState.kt | Added updatedBookingFilters, updatedBookingFiltersCount, and title properties to encapsulate filter display logic |
| WooCommerce/src/main/kotlin/com/woocommerce/android/ui/bookings/filter/BookingFilterListScreen.kt | Updated toolbar title to use the new dynamic title property from UI state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <string name="bookings_filters_default_title">Filters</string> | ||
| <string name="bookings_filters_enabled_title">Filters • %d</string> | ||
| <string name="bookings_filters_count_title">Filters (%d)</string> | ||
| <string name="bookings_filters_title_with_count">Filters (%s)</string> |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string resource key has been renamed from bookings_filters_count_title to bookings_filters_title_with_count in the main strings.xml file, but the old key still exists in all localization files (values-ar, values-de, values-es, values-fr, values-he, values-id, values-it, values-ja, values-ko, values-nl, values-pt-rBR, values-ru, values-sv, values-tr, values-zh-rCN, values-zh-rTW). These localization files should also be updated to use the new key name to maintain consistency across all translations.
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #14919 +/- ##
============================================
- Coverage 38.34% 38.34% -0.01%
- Complexity 10145 10148 +3
============================================
Files 2143 2143
Lines 121273 121280 +7
Branches 16646 16646
============================================
+ Hits 46499 46500 +1
- Misses 70047 70055 +8
+ Partials 4727 4725 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
AdamGrzybkowski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Part of WOOMOB-1239
Description
This adds the active booking filter count to the title of the root filter list page.
Test Steps
Images/gif
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.