Skip to content
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

[Tablet Support M2] Issue 10863 - Fix order list reload on search view expand #10883

Merged

Conversation

jd-alexander
Copy link
Contributor

@jd-alexander jd-alexander commented Feb 21, 2024

Closes: #10863

Description

The issue encountered in the OrderListFragment was that the order list would not show any results after a search query didn't find items and it was cleared.

The solution implemented in the onQueryTextChange method now ensures that viewModel.loadOrders() is only invoked when there is an actual change in the search query from a non-empty to an empty string. This means that the full list of orders is reloaded only when the user clears the search input.

Testing instructions

  1. Go to orders list for a store that has some orders
  2. Search for something that will return a result
  3. Use X is search bar to clear search results
  4. Edit order in right pane
  5. Notice that going back to the order's list shows all the items.

Images/gif

Search-Fix-New.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.

Ensure orders are reloaded only when the search query is cleared, not when the search view is expanded. This prevents unnecessary reloads and improves user experience.
@jd-alexander jd-alexander added type: bug A confirmed bug. category: tablet Specific to tablet devices such as a Galaxy Tab or an iPad. labels Feb 21, 2024
@jd-alexander jd-alexander added this to the 17.5 milestone Feb 21, 2024
@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 Name WooCommerce Android
FlavorJalapeno
Build TypeDebug
Commit21a28dd
Direct Downloadwoocommerce-prototype-build-pr10883-21a28dd.apk

@malinajirka malinajirka self-assigned this Feb 22, 2024
@malinajirka malinajirka self-requested a review February 22, 2024 06:48
Copy link
Contributor

@malinajirka malinajirka left a comment

Choose a reason for hiding this comment

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

Thanks @jd-alexander! I wasn't able to reproduce the issues described in the github ticket with this PR 🥳 .

@malinajirka malinajirka merged commit bece44d into issue/10568-nav-host-fragment Feb 22, 2024
16 of 20 checks passed
@malinajirka malinajirka deleted the issue-10863/fix-search-clear-reload branch February 22, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: tablet Specific to tablet devices such as a Galaxy Tab or an iPad. type: bug A confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants