-
Notifications
You must be signed in to change notification settings - Fork 220
Ensure the content of the patterns is also AI-generated #10997
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: 0 B Total Size: 1.47 MB ℹ️ View Unchanged
|
…esHelper and rename to PatternUpdater
…nt option: if it doesn't exist, fetch the default content from the default dictionary instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work @albarin ! 🎉
Tested with a handful of patterns and confirmed the content is being generated as expected.
I left a note regarding translations for the AI-generated & default content: my suggestion is to tackle this next, as it is critical to have translatable content in patterns.
Also, I've pushed this change 6676e32 to ensure the content for a given pattern_slug
actually exists within the wc_blocks_patterns_content
option: if it doesn't exist, fetch the default content from the patterns dictionary instead.
?> | ||
|
||
<!-- wp:heading {"level":3,"align":"wide"} --> | ||
<h3 class="wp-block-heading alignwide"><?php esc_html_e( 'Fresh & tasty goods', 'woo-gutenberg-products-block' ); ?></h3> | ||
<h3 class="wp-block-heading alignwide"><?php echo esc_html( $content['titles'][0]['default'] ); ?></h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will have to create a separate issue to handle translations for AI-generated content in patterns and also, if the user didn't enable AI on their store, the default content coming from the patterns dictionary should still be translatable.
); | ||
} | ||
|
||
$responses = Requests::request_multiple( $requests, array( 'timeout' => $timeout ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a great idea to make the requests run in parallel: this should save us a lot of time during the onboarding :)
What
Update all patterns to ensure all the texts are populated with AI-generated content. The text should dynamically change depending on what the user decides to add as a description for their business on their AI settings screen and also during the upcoming onboarding screen.
Why
Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
Create a new JN install with both Jetpack and Woocommerce installed and activated.
Install and activate WooCommerce Blocks from this zip file: woocommerce-gutenberg-products-block.zip
In your wp-admin, you should see the following section for Jetpack:
Featured Category Triple
pattern (or any other woocommerce-blocks pattern).Featured Category Triple
pattern againScreenshots or screencast
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog
N/A