Skip to content

Conversation

@irfano
Copy link
Contributor

@irfano irfano commented Nov 6, 2025

Part of WOOMOB-1239

Description

This adds the active booking filter count to the title of the root filter list page.

Test Steps

  1. Log in with a CIAB store.
  2. Go to Bookings.
  3. Go to the All tab.
  4. Tap the Filters button.
  5. Select Booking type.
  6. Select a type.
  7. Navigate back.

Images/gif

Before After
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

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.
Copy link
Contributor

Copilot AI left a 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 updatedBookingFilters property from ViewModel to BookingFilterListUiState for better encapsulation
  • Added dynamic title property to BookingFilterListUiState that displays filter count when filters are active
  • Updated string resource from bookings_filters_count_title to bookings_filters_title_with_count and changed format specifier from %d to %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>
Copy link

Copilot AI Nov 6, 2025

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.

Copilot uses AI. Check for mistakes.
@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App NameWooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit8762dd1
Direct Downloadwoocommerce-wear-prototype-build-pr14919-8762dd1.apk

@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit8762dd1
Direct Downloadwoocommerce-prototype-build-pr14919-8762dd1.apk

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 57.89474% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.34%. Comparing base (a62c55a) to head (8762dd1).
⚠️ Report is 16 commits behind head on trunk.

Files with missing lines Patch % Lines
...oid/ui/bookings/filter/BookingFilterListUiState.kt 57.89% 8 Missing ⚠️
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.
📢 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.

@AdamGrzybkowski AdamGrzybkowski self-assigned this Nov 7, 2025
Copy link
Contributor

@AdamGrzybkowski AdamGrzybkowski left a comment

Choose a reason for hiding this comment

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

Looks good!

@AdamGrzybkowski AdamGrzybkowski merged commit 3692a44 into trunk Nov 7, 2025
28 of 29 checks passed
@AdamGrzybkowski AdamGrzybkowski deleted the issue/WOOMOB-1239-show-filter-count-on-booking-filters branch November 7, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants