Skip to content

Conversation

@irfano
Copy link
Contributor

@irfano irfano commented Nov 15, 2025

Closes WOOMOB-1464

Description

This adds handling for loading and error states when fetching team members on the Team Member filter 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 Team member

Tip for creating "first load" case

Use DELETE FROM BookingResources command in "App Inspection → Database Inspector → New Query" tab.

Tip for the API error case

Temporarily_hardcode_siteId_for_Bookings_resources_request.patch: Use this patch to break site parameter when fetching resource.

Images/gif

Loading.webm
Error.webm
  • 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.

@irfano irfano added this to the 23.8 milestone Nov 15, 2025
@irfano irfano changed the title Issue/woomob 1464 team member filter error loading [Bookings] Error and loading states for Team member filter screen Nov 15, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 15, 2025

📲 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
Commitd119b59
Direct Downloadwoocommerce-wear-prototype-build-pr14980-d119b59.apk

bookingsRepository.observeResources().distinctUntilChanged().collect { resources ->
_uiState.update { current -> current.copy(teamMembers = listOf(TeamMember.any) + resources) }
_uiState.update { current ->
current.copy(isLoading = resources.isEmpty(), teamMembers = listOf(TeamMember.any) + resources)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to use isLoading = resources.isEmpty() here because observeResources() returns empty resources when the database is empty.

Column(modifier = Modifier.fillMaxWidth()) {
SkeletonView(
modifier = Modifier
.size(62.dp, 64.dp)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took these sizes from the sample screen in Figma.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 15, 2025

📲 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
Commitd119b59
Direct Downloadwoocommerce-prototype-build-pr14980-d119b59.apk

@irfano irfano force-pushed the issue/WOOMOB-1464-team-member-filter-error-loading branch from 0cecaf1 to d119b59 Compare November 15, 2025 00:52
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 17.46032% with 52 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.45%. Comparing base (0bf397d) to head (d119b59).

Files with missing lines Patch % Lines
...s/filter/teammember/BookingTeamMemberFilterPage.kt 0.00% 47 Missing ⚠️
...commerce/android/ui/bookings/BookingsRepository.kt 0.00% 4 Missing ⚠️
...ter/teammember/BookingTeamMemberFilterViewModel.kt 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14980      +/-   ##
============================================
- Coverage     38.46%   38.45%   -0.01%     
- Complexity    10233    10236       +3     
============================================
  Files          2155     2155              
  Lines        122175   122230      +55     
  Branches      16818    16826       +8     
============================================
+ Hits          46996    47007      +11     
- Misses        70412    70456      +44     
  Partials       4767     4767              

☔ 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants