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

Product Selector - Reset filters after completing selection or dismissal #14764

Open
wants to merge 8 commits into
base: trunk
Choose a base branch
from

Conversation

selanthiraiyan
Copy link
Contributor

@selanthiraiyan selanthiraiyan commented Dec 25, 2024

Closes: #14624

Description

When you apply filters in the product selector screen the main product list screen is affected as the applied core data predicate changes are received by the main product list screen as well.

To avoid the above issue, this PR starts resetting the filters once the product selection process is complete using the saved product settings.

Steps to reproduce

Prerequisites

  • Use a Woo store with more than 100 products.
  • You can create a JN store and generate 100+ products using Woo Smooth generator.
  • Using the smooth generator helps to generate products with different types, status and category. (Helps with testing filters)

Products list

  1. Login into the app if needed
  2. Navigate to Products tab
  3. Tap "Filter"
  4. Apply any filter and ensure that products are filtered correctly.
  5. Navigate to the Orders tab
  6. Tap "+" -> "Add products"
  7. Tap "Filter"
  8. Apply a filter that is different from the main product list screen.
  9. Ensure that products are filtered correctly.
  10. Select a product and create an order.
  11. Navigate back to the Products tab and ensure that the product list and filters are correct. (They shouldn't be impacted by the filters applied in the product selector screen.)
  12. Repeat steps from 5 to 9
  13. Dismiss the product selector screen without selecting a product.
  14. Navigate back to the Products tab and ensure that the product list and filters are correct. (They shouldn't be impacted by the filters applied in the product selector screen.)

Testing information

  • Tested that filters applied in product selector don't impact product list screen.
  • Tested that filtering works as expected in product list and product selector screens.

Screenshots

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-12-25.at.10.34.28.mp4

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

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

@selanthiraiyan selanthiraiyan changed the title Product Selector - Reset filters after completing selection/dismissal Product Selector - Reset filters after completing selection or dismissal Dec 25, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 25, 2024

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

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14764-5220e95
Version21.3
Bundle IDcom.automattic.alpha.woocommerce
Commit5220e95
App Center BuildWooCommerce - Prototype Builds #12291
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@selanthiraiyan selanthiraiyan added feature: product list Related to the product list. type: bug A confirmed bug. labels Dec 25, 2024
@selanthiraiyan selanthiraiyan added this to the 21.4 milestone Dec 25, 2024
@selanthiraiyan selanthiraiyan marked this pull request as ready for review December 25, 2024 05:18
@itsmeichigo itsmeichigo self-assigned this Dec 25, 2024
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

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

Thank you for the fix! When testing I found that the product selector can be dragged to dismiss, in which case the filter is not updated. We should handle that case also:

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2024-12-25.at.15.11.57.mp4

@selanthiraiyan
Copy link
Contributor Author

When testing I found that the product selector can be dragged to dismiss, in which case the filter is not updated. We should handle that case also:

Thanks for reporting this, @itsmeichigo!

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-12-25.at.18.25.57.mp4

On a simulator running iOS 17.4, I cannot swipe and dismiss the product selector. Also, I see that the interactiveDismissDisabled is used here.

Could you please share in which simulator version you tested this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: product list Related to the product list. type: bug A confirmed bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Product] Filters selected in product selector screen affects product list screen
3 participants