Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented May 22, 2023

Part of #9785

Description

This PR adds a new view to celebrate when a product is created for the first time. This view contains a button to share the new product too. To make it more fun, the view also has confetti when first presented - this is handled by a new library.

The AddProductCoordinator was updated with a new param isFirstProduct, used to decide whether to show the celebratory view after a product is successfully created.

The coordinator is updated in two places to ensure that we celebrate the first product from store onboarding and the empty view of the Products tab.

Testing instructions

  • Make sure that you have access to a store with the checklist for creating the first product not done yet.
  • Tap the onboarding item to create the first product for the store and publish the product from the product form.
  • After the product is published or saved as draft, you should see that a new view is presented to celebrate the new product. In Xcode console, notice Tracks event: first_created_product_shown.
  • Tap "Share Product", a share sheet should be presented with the correct product URL. In Xcode console, notice Tracks event: first_created_product_share_tapped.
  • Navigate to the Products tab and remove the newly created product. The empty view should then be displayed.
  • Tap "Add Product" to create a new product. When the product is published or saved as draft, the celebratory screen should be presented again.

Screenshots

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-05-22.at.16.43.26.mp4

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

@itsmeichigo itsmeichigo added type: task An internally driven task. feature: add/edit products Related to adding or editing products. labels May 22, 2023
@itsmeichigo itsmeichigo added this to the 13.8 milestone May 22, 2023
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 22, 2023

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr9790-be7f1ea on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@itsmeichigo itsmeichigo marked this pull request as ready for review May 22, 2023 09:49
@selanthiraiyan selanthiraiyan self-assigned this May 22, 2023
Copy link
Contributor

@selanthiraiyan selanthiraiyan 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 and the confetti looks nice. 🎉

I left a few non-blocking nits/questions.

🚢


private extension FirstProductCreatedHostingController {
enum Localization {
static let cancel = NSLocalizedString("Cancel", comment: "Button to dismiss the first created product screen")
Copy link
Contributor

Choose a reason for hiding this comment

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

Super nit: IMO, "Cancel" might make it challenging to understand whether sharing will be cancelled by tapping this button. (After initiating share) WDYT about using "Close"?

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 the button title to "Dismiss" in 022a58f 👍

super.init(rootView: FirstProductCreatedView())
rootView.onSharingProduct = { [weak self] in
guard let self else { return }
SharingHelper.shareURL(url: productURL, from: self.view, in: self)
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Is it possible to pass onCompletion block to SharingHelper and dismiss this screen from 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.

We don't get a callback when the user submitted any content in the share sheet, so it's not technically possible to handle onCompletion.

Copy link
Contributor

Choose a reason for hiding this comment

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

@peril-woocommerce
Copy link

Messages
📖

This PR contains changes to Tracks-related logic. Please ensure the following are completed:
PR Author

  • The PR must be assigned the Tracks label
    PR Reviewer
  • The tracks events must be validated in the Tracks system.
  • Verify the internal tracks spreadsheet has also been updated.

Generated by 🚫 dangerJS

@itsmeichigo itsmeichigo enabled auto-merge May 23, 2023 01:33
@itsmeichigo itsmeichigo merged commit f166b90 into trunk May 23, 2023
@itsmeichigo itsmeichigo deleted the feat/9785-celebrate-first-product branch May 23, 2023 02:00
hafizrahman added a commit to woocommerce/woocommerce-android that referenced this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: add/edit products Related to adding or editing products. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants