-
Notifications
You must be signed in to change notification settings - Fork 137
Issue/woomob 1745 add pagination to fetch all the available bookable products #15120
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
base: trunk
Are you sure you want to change the base?
Issue/woomob 1745 add pagination to fetch all the available bookable products #15120
Conversation
Ensure we display all available bookable products from filter screen. This will make search functionality faster and avoid unnecessary network requests
📲 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.
|
Bookable products of type Event won't be supported for now.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #15120 +/- ##
============================================
- Coverage 38.53% 38.53% -0.01%
- Complexity 10397 10401 +4
============================================
Files 2173 2173
Lines 123725 123763 +38
Branches 17050 17059 +9
============================================
+ Hits 47676 47689 +13
- Misses 71238 71262 +24
- Partials 4811 4812 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 implements pagination to fetch all available bookable-service products and updates the UI strings to reflect that only service bookings (not events) are currently supported.
Key changes:
- Adds pagination logic to load all bookable products in batches using a larger page size (100) to minimize network requests
- Updates UI text from "Service / Event" to just "Service" across filters and search fields
- Introduces a loading state with skeleton UI while fetching products
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| BookingServiceEventFilterViewModel.kt | Adds loadAllBookingProducts() method with pagination logic to fetch all bookable services, updates initial state to show loading |
| BookingServiceEventFilterUiState.kt | Adds isLoading boolean property to track product loading state |
| BookingServiceEventFilterPage.kt | Adds skeleton loading UI that displays when loading products and before any data is available |
| ProductListRepository.kt | Makes pageSize parameter configurable in fetchProductList() to support larger page sizes for specific use cases |
| strings.xml | Updates string resources from "Service / Event" to "Service" only for filter titles and search hints |
| BookingFilterListUiState.kt | Updates title resource reference to use the new "Service" string |
| ObserveBookingsTabVisibilityTest.kt | Updates test to include the new pageSize parameter in mock verification |
| BookingServiceEventFilterViewModelTest.kt | Adds test to verify loading state is true when ViewModel initializes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...com/woocommerce/android/ui/bookings/filter/productname/BookingServiceEventFilterViewModel.kt
Show resolved
Hide resolved
...com/woocommerce/android/ui/bookings/filter/productname/BookingServiceEventFilterViewModel.kt
Show resolved
Hide resolved
...com/woocommerce/android/ui/bookings/filter/productname/BookingServiceEventFilterViewModel.kt
Outdated
Show resolved
Hide resolved
…s/filter/productname/BookingServiceEventFilterViewModel.kt Co-authored-by: Copilot <[email protected]>
Closes WOOMOB-1745
Description
These changes ensure that we load all available bookable-service products when opening the Booking > filters > Service screen.
Additionally it updates the
Service / Eventproduct item toServiceonly, given event type bookings won't supported for now.Test Steps
bookable-serviceproductsServicefilterswc-adminadd a couple more bookable servicesServicefilter again and check the new bookable services are displayedImages/gif
Screen_recording_20251217_163322.mp4