Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Nov 3, 2025

Part of WOOMOB-1240

Description

This PR improves the search experience on Bookings' Service/Event filter.

Previously in #16294 I got a feedback regarding the search behavior of Service/Event:

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 reason for this is that currently we're searching products without defining which fields to search. By default, this would mean matching keywords with product names, descriptions, short descriptions, SKUs, and global unique identifiers. On the Service/Event filter view, the only visible detail is product name, so returning results matching other fields might make it look like the search results are incorrect.

This PR improves the experience by asking the remote to search only by product names when filtering booking service/events. This comes with updates to the Networking and Yosemite layers to include the search_fields in the network requests.

Test Steps

  1. Log in to a CIAB store with existing bookings.
  2. Navigate to the Bookings tab > All > Filter > Service/Event.
  3. In the search bar, enter short keywords and ensure that only items with matching names are displayed in the search results.

Regression test: Since I updated the search request for POS in ProductsRemote, we need to ensure that I didn't cause any regression.

  1. Log in to a non-CIAB store on tablet.
  2. Navigate to the POS tab.
  3. Tap the Search icon for products.
  4. Enter any keywords and ensure that the results are correct.

Screenshots

Simulator.Screen.Recording.-.iPad.mini.A17.Pro.-.2025-11-03.at.16.18.31.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.7 milestone Nov 3, 2025
@itsmeichigo itsmeichigo added the type: task An internally driven task. label Nov 3, 2025
@itsmeichigo itsmeichigo changed the title Bookings: Update service/event filter to serach by name only Bookings: Update service/event filter to search by name only Nov 3, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 3, 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 Numberpr16306-1414442
Version23.5
Bundle IDcom.automattic.alpha.woocommerce
Commit1414442
Installation URL5q57fcuv9e9a0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Base automatically changed from woomob-1240-filter-api-integration to trunk November 3, 2025 09:11
@itsmeichigo itsmeichigo marked this pull request as ready for review November 3, 2025 09:21
@itsmeichigo itsmeichigo requested a review from adborbas November 3, 2025 09:21
@adborbas adborbas self-assigned this Nov 4, 2025
Copy link
Contributor

@adborbas adborbas left a comment

Choose a reason for hiding this comment

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

Had two small comments, but it works as described 👍

case .all:
case .all, .name:
let searchFields: [ProductSearchField] = {
if filter == .name {
Copy link
Contributor

Choose a reason for hiding this comment

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

This extra layer of if makes this a bit hard to read. I'd rather extract try await remote.searchProducts(for: siteID, .... to a helper functuion and do something like

switch filter {
case .all:
    products = try await searchByKeyword(searchFields: [])

case .name:
    products = try await searchByKeyword(searchFields: [.name])

case .sku:
    products = try await remote.searchProductsBySKU(
        for: siteID,
        keyword: keyword,
        pageNumber: pageNumber,
        pageSize: pageSize
    )
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 26476a9.


// Takes precedence over `search_name_or_sku` from WC 10.1+ and is combined with `search` value
parameters.updateValue([SearchField.name, SearchField.sku, SearchField.globalUniqueID], forKey: ParameterKey.searchFields)
parameters.updateValue([
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you've only updated the mapping here, but the documentation for this function seems to lag, as it still says it searches in "name, description, and short_description". Could you please update it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 1414442.

@itsmeichigo itsmeichigo merged commit 7b9070f into trunk Nov 4, 2025
14 checks passed
@itsmeichigo itsmeichigo deleted the woomob-1240-search-products-by-name branch November 4, 2025 11:45
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