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 Creation AI v2] Add Starting information screen #13171

Merged
merged 20 commits into from
Jun 27, 2024

Conversation

selanthiraiyan
Copy link
Contributor

Part of: #13104

Description

As part of the Product Creation AI v2 work this PR Adds initial version for "Starting information" screen.

Changes

  • Remove the previous feature flag using for Product Creation AI v1.
  • View and ViewModel for Starting information" screen.
  • Show "Starting information" screen after checking feature flag.
  • Hide the progress bar after checking feature flag.
  • Navigate to product preview screen from "Starting information" screen.

Steps to reproduce

  1. Create a JN site with Jetpack AI plugin
  2. Turn on productCreationAIv2M1 feature flag
  3. Build and run the app
  4. Navigate to the products tab
  5. Tap + button on top right
  6. Tap "Create a product with AI"
  7. Validate that the new "Starting information" screen is displayed.
  8. Stop the app.
  9. Disable the productCreationAIv2M1 feature flag and build and run the app.
  10. Repeat steps 4 to 6.
  11. Validate that the previous "Add product name" screen is displayed.

Testing information

Test the product creation with AI flow works as before when productCreationAIv2M1 feature flag turned off.

Screenshots

productCreationAIv2M1 false productCreationAIv2M1 true
Simulator Screenshot - iPhone 15 Pro Max - 2024-06-26 at 21 20 10 Simulator Screenshot - iPhone 15 Pro Max - 2024-06-26 at 21 21 12

  • 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 Jun 26, 2024
@selanthiraiyan selanthiraiyan added this to the 19.3 milestone Jun 26, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Jun 26, 2024

1 Warning
⚠️ This PR is assigned to the milestone 19.3. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 26, 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 Numberpr13171-af63414
Version19.2
Bundle IDcom.automattic.alpha.woocommerce
Commitaf63414
App Center BuildWooCommerce - Prototype Builds #9771
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 June 26, 2024 16:11
@selanthiraiyan selanthiraiyan mentioned this pull request Jun 26, 2024
3 tasks
@itsmeichigo itsmeichigo self-assigned this Jun 27, 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.

This works as expected. I found an issue with back navigation from the Preview screen, which shows a deprecated screen, but please feel free to handle that in a separate PR.

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-27.at.12.12.04.mp4

@@ -23,6 +24,7 @@ final class AddProductWithAIContainerViewModel: ObservableObject {

let siteID: Int64
let source: AddProductCoordinator.Source
let featureFlagService: FeatureFlagService
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: is this for use later or redundant? I don't see it being used in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I have started using this featureFlagService now.

Comment on lines 42 to 44
private(set) lazy var startingInfoViewModel: ProductCreationAIStartingInfoViewModel = {
.init(siteID: siteID)
}()
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: we should migrate away from .init(...) as a direct init would perform better.

Suggested change
private(set) lazy var startingInfoViewModel: ProductCreationAIStartingInfoViewModel = {
.init(siteID: siteID)
}()
private(set) lazy var startingInfoViewModel = ProductCreationAIStartingInfoViewModel(siteID: siteID)

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 1874e8b

Image(systemName: Layout.UsePackagePhoto.cameraSFSymbol)
.renderingMode(.template)
.fontWeight(.semibold)
.foregroundColor(Color(.brand))
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: I'd suggest using Color.accentColor just in case we decide to change the accent color or brand color to be different. We should use brand color only for components that are directly related to our branding IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, Huong! Updated in 11e6e9a

Comment on lines 149 to 170
enum Localization {
static let title = NSLocalizedString(
"Starting information",
comment: "Title on the starting info screen."
)
static let subtitle = NSLocalizedString(
"Tell us about your product, what it is and what makes it unique, then let the AI work its magic.",
comment: "Subtitle on the starting info screen."
)
static let placeholder = NSLocalizedString(
"For example: Black cotton t-shirt, soft fabric, durable stitching, unique design",
comment: "Placeholder text on the product features field"
)
static let readTextFromPhoto = NSLocalizedString(
"Read text from product photo",
comment: "Upload package photo button on the text field"
)
static let continueText = NSLocalizedString(
"Continue",
comment: "Continue button on the starting info screen."
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we follow the latest naming style for localized strings with separate keys and values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Done in 1307d5d

@selanthiraiyan
Copy link
Contributor Author

Thanks for the review, Huong! 🙇

I found an issue with back navigation from the Preview screen, which shows a deprecated screen, but please feel free to handle that in a separate PR.

Good catch. I have fixed this in c88adcc

I am enabling auto-merge now. Kindly add comments, if any.

@selanthiraiyan selanthiraiyan merged commit b9aacc5 into trunk Jun 27, 2024
22 checks passed
@selanthiraiyan selanthiraiyan deleted the feat/13104-starting-info-view branch June 27, 2024 09:00
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants