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

[HACK week] Product form - Action buttons to mark/remove as favorite #12284

Draft
wants to merge 30 commits into
base: trunk
Choose a base branch
from

Conversation

selanthiraiyan
Copy link
Contributor

@selanthiraiyan selanthiraiyan commented Mar 15, 2024

Part of: #12274

Description

Show action buttons in product form to mark/remove a product as a favorite. We will show favorite products in the product list screen in a future PR.

Changes

  • Feature flag to allow marking a product as favorite.
  • Use case to store favorite product list into user defaults.
  • Add action buttons to mark/remove a product as favorite.

Testing instructions

  • Login into the app
  • Navigate to Products tab
  • Open any product
  • Tap "…" from the action sheet tap "Mark as favorite"
  • From Xcode log ensure that product_detail_mark_as_favorite_tapped event is tracked
  • Navigate back/Quit the app
  • Open the same product again from the Products tab
  • Tap "…" from the action sheet
  • You should see "Remove from favorite" option. Tap on it to remove the product from favorite list.
  • From Xcode log ensure that product_detail_remove_from_favorite_tapped event is tracked
  • Reopen the product and validate that you see "Mark as favorite"
  • Switch stores and ensure that the product marked as favorite is still marked as favorite.
  • Log out and log into the same store again. Validate that the favorite products list is cleared after logout.

Screenshots

Simulator Screen Recording - iPhone 15 Pro - 2024-03-15 at 11 13 16


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

@selanthiraiyan selanthiraiyan added the feature: add/edit products Related to adding or editing products. label Mar 15, 2024
@selanthiraiyan selanthiraiyan added this to the 17.9 milestone Mar 15, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Mar 15, 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 Numberpr12284-e3d872c
Version19.0
Bundle IDcom.automattic.alpha.woocommerce
Commite3d872c
App Center BuildWooCommerce - Prototype Builds #9620
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@selanthiraiyan selanthiraiyan marked this pull request as ready for review March 16, 2024 11:29
@dangermattic
Copy link
Collaborator

dangermattic commented Mar 16, 2024

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖

This PR contains changes to Tracks-related logic. Please ensure (author and reviewer) the following are completed:

  • The tracks events must be validated in the Tracks system.
  • Verify the internal Tracks spreadsheet has also been updated.
  • Please consider registering any new events.
  • The PR must be assigned the category: tracks label.

Generated by 🚫 Danger

@selanthiraiyan selanthiraiyan added the category: tracks Related to analytics, including Tracks Events. label Mar 16, 2024
@hafizrahman hafizrahman self-assigned this Mar 18, 2024
Copy link
Contributor

@hafizrahman hafizrahman left a comment

Choose a reason for hiding this comment

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

This works as expected, nice work. I understand everything is local data, but am curious if it's feasible to keep favorites even after logging out. Most users probably expect that to happen, not knowing the technical limitation.

I tried looking into Core to see if there is a built-in feature for this. The closest I found is the "Favorite" feature:
Screenshot 2024-03-18 at 14 26 58

This also affects how products are shown on the site itself, though, and if I understand correctly, this feature we're building is just for product management. In the future if we revisit this feature, I wonder if we can take into account this "Featured" functionality (e.g: by adding "Featured" option in the "Sort by" selector in the app).

@bozidarsevo bozidarsevo modified the milestones: 17.9, 18.0 Mar 21, 2024
@selanthiraiyan selanthiraiyan removed this from the 18.0 milestone Mar 27, 2024
@selanthiraiyan
Copy link
Contributor Author

Thanks for the review, Hafiz! Marking it as draft to address feedback about using userdefaults in #12287.

@selanthiraiyan selanthiraiyan marked this pull request as draft March 27, 2024 03:57
@selanthiraiyan
Copy link
Contributor Author

selanthiraiyan commented Jun 14, 2024

I tried looking into Core to see if there is a built-in feature for this. The closest I found is the "Favorite" feature:

Thanks for the input, @hafizrahman!

Yes, I took a look at this before starting work and learned that this feature in core is used to feature the product to the users (customers).

Our "Favorite product" feature's goal is to allow merchants to favorite products for easy management.

They are different features and our feature will be mobile only (with no backend support from core) at least for now.

@selanthiraiyan
Copy link
Contributor Author

selanthiraiyan commented Jun 14, 2024

👋 again @hafizrahman,

I have revisited this PR and pushed changes to,

  • Stop using user defaults to store favorite product information.
  • Use GeneralStoreSettings and AppSettingsStore to store the favorite products information.
  • Add unit tests.

Please take another look at the PR when you can. Thank you!

@selanthiraiyan selanthiraiyan marked this pull request as ready for review June 14, 2024 03:33
@selanthiraiyan selanthiraiyan added this to the 19.2 milestone Jun 14, 2024
@selanthiraiyan
Copy link
Contributor Author

Sorry, Hafiz! I am marking this PR as a draft until I find time to address the feedback from this child PR. #12287 (comment)

@selanthiraiyan selanthiraiyan marked this pull request as draft June 18, 2024 08:00
@Ecarrion Ecarrion modified the milestones: 19.2, 19.3 Jun 21, 2024
@malinajirka malinajirka modified the milestones: 19.3, 19.4 Jun 28, 2024
@iamgabrielma iamgabrielma removed this from the 19.4 milestone Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: tracks Related to analytics, including Tracks Events. feature: add/edit products Related to adding or editing products.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants