Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Oct 30, 2025

Part of WOOMOB-1240

Description

This PR adds the search capability on the Service / Event filter for bookings. Tests for SyncableListSelectorViewModel have also been added.

Test Steps

  1. Log in to a CIAB store with existing bookings.
  2. Navigate to Booking tab > All > Filter > Service / Event.
  3. Confirm that a search bar is now available at the top.
  4. Enter any keyword and confirm that the list is updated with search results.
  5. Enter keywords that don't match any products. Confirm that the empty state is displayed.

Screenshots

Simulator.Screen.Recording.-.iPad.mini.A17.Pro.-.2025-10-30.at.17.35.39.mov

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@itsmeichigo itsmeichigo added this to the 23.6 milestone Oct 30, 2025
@itsmeichigo itsmeichigo added the type: task An internally driven task. label Oct 30, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 30, 2025

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

App NameWooCommerce iOS Prototype
Build Numberpr16294-ebae5bf
Version23.5
Bundle IDcom.automattic.alpha.woocommerce
Commitebae5bf
Installation URL2ndrv9odgk2d0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review October 30, 2025 10:39
Base automatically changed from woomob-1240-customer-multiple-selection to trunk October 30, 2025 10:43
@RafaelKayumov RafaelKayumov self-assigned this Oct 30, 2025
Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

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

  1. Not related to the PR: The top divider of the top cell interferes with the header bottom line. Probably the bottom divider of the bottom cell is not needed either:
Снимок экрана 2025-10-31 в 00 09 11
  1. I'm not sure if I fully understand the product search results and keywords logic. But trying just the substrings of service names in search gives unexpected results. For example if testing in our shared CIAB site and entering the "Ro" search term I can see both "Room Rental" and "Hair Salon Appointment". Entering "P" also reveals both results. "Re" also both results.

} else {
// Keep base predicate if search predicate is not available
resultsController.predicate = syncable.createPredicate()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good and readable. How about making it shorter?

var predicates = [syncable.createPredicate()]
if !query.isEmpty, let searchPredicate = syncable.createSearchPredicate(keyword: query) {
    predicates.append(searchPredicate)
}
resultsController.predicate = NSCompoundPredicate(andPredicateWithSubpredicates: predicates)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much better - done in ebae5bf.

@itsmeichigo itsmeichigo modified the milestones: 23.6, 23.7 Oct 31, 2025
@itsmeichigo
Copy link
Contributor Author

itsmeichigo commented Oct 31, 2025

Thanks for the feedback!

Not related to the PR: The top divider of the top cell interferes with the header bottom line. Probably the bottom divider of the bottom cell is not needed either

Eagle eyes 👀 Fixed in f7ba545.

I'm not sure if I fully understand the product search results and keywords logic. But trying just the substrings of service names in search gives unexpected results. For example if testing in our shared CIAB site and entering the "Ro" search term I can see both "Room Rental" and "Hair Salon Appointment". Entering "P" also reveals both results. "Re" also both results.

The logic is that we assign results from remote with the keywords that yield the response. Your observation is correct, but I see the same thing in the remote responses via Proxyman. This suggests a bug in the backend code, I'll raise the issue in the channel asking the devs. This seems to be an issue with the product search - we're currently leaving search_fields field empty. According to the API doc, we would need to set the field to name only if we want to match only names. I'll need to confirm with the team the expected behavior and update the search behavior accordingly - but I'll do that in a separate PR.

This PR is ready for another look.

Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

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

LGTM. Thx for the update.

@itsmeichigo itsmeichigo merged commit 9129e60 into trunk Oct 31, 2025
14 checks passed
@itsmeichigo itsmeichigo deleted the woomob-1240-search-bookable-products branch October 31, 2025 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants