AI Launchpad: rework the sell goal to lead with store setup#50178
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
There was a problem hiding this comment.
Pull request overview
This pull request updates the AI Launchpad sell goal so store setup is always the lead-in, and WooCommerce-gated commerce tasks remain visible as a locked “roadmap” preview until WooCommerce is active. The change is implemented read-side in AI_Launchpad_REST (leaving the shared catalog untouched), with UI support for a new disabled task state and expanded PHPUnit/Jest coverage.
Changes:
- Inject two synthetic lead tasks for sell: Install WooCommerce (to-do → activate → complete) and Set up your store (completes when WooCommerce onboarding profiler is completed/skipped).
- Keep WooCommerce-gated commerce tasks in the tailored list as disabled preview cards (no CTA/skip, lock icon, expandable subtitle + hint) while WooCommerce is inactive.
- Reorder the sell fallback and tailor prompt guidance to be store-first, with new tests covering disabled-task behavior and side-effect avoidance.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/class-ai-launchpad-rest.php | Adds store-task injection for sell, introduces disabled-preview behavior for Woo tasks when WooCommerce is inactive. |
| projects/packages/jetpack-mu-wpcom/tests/php/features/ai-launchpad/AI_Launchpad_REST_Test.php | Adds PHPUnit coverage for new sell flow, disabled previews, and side-effect-free reads. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/model.ts | Extends task model with disabled, updates actionability and auto-expand logic to skip disabled previews. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/model.test.mts | Adds Jest tests for disabled behavior in isTaskActionable and nextIncompleteId. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/task-card.tsx | Renders disabled tasks as locked preview cards; adds CTA labels for new synthetic tasks. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/style.scss | Adds muted styling for disabled cards and a hint line style. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/lib/prompts.ts | Updates sell-goal hard rule to keep commerce tasks ordered store-first. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/lib/fallback.ts | Reorders deterministic sell fallback task IDs to lead with store customization. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/lib/fallback.test.mts | Adds coverage asserting updated sell fallback ordering. |
| projects/packages/jetpack-mu-wpcom/changelog/add-ai-launchpad-store-setup-task | Adds changelog entry describing the new sell goal sequencing and roadmap preview behavior. |
| if ( ! function_exists( 'is_plugin_active' ) ) { | ||
| require_once ABSPATH . 'wp-admin/includes/plugin.php'; | ||
| } | ||
| $woo_active = is_plugin_active( 'woocommerce/woocommerce.php' ); | ||
|
|
There was a problem hiding this comment.
No change needed: this calls WordPress core’s global is_plugin_active(), which already returns true for network-activated plugins (it ORs is_plugin_active_for_network() internally). Additionally, AI Launchpad only runs on WoA/Atomic sites, which are single-site, not multisite networks.
b693df4 to
d60a111
Compare
Leads the sell sequence with an "install WooCommerce" task (CTA to the wp-admin plugin-install search); completes live once WooCommerce is active, so the visibility-gated woo_* tasks surface only after the store exists.
Reorder the sell fallback list and tailoring prompt store-first (customize store, then products, then payments), and add the "Set up store" CTA label.
Make the store and gallery synthetic tasks mutually exclusive by goal (a sell site with a visual niche no longer gets an off-target gallery task), drop the store task once WooCommerce is active instead of pinning a completed lead card, and inline the single-use goal predicate.
Replace the single store task with two single-concern lead tasks: an "Install the WooCommerce plugin" task (to-do / in-progress-when-inactive / complete-when-active) and a "Set up your store" task that appears once WooCommerce is active and completes when the core profiler is finished or skipped. All states read live from the plugin and woocommerce_onboarding_profile options.
Give the install task a distinct "Activate WooCommerce" CTA in its installed-but-inactive state instead of the draft-oriented "Continue", and simplify the lead injection to a plain array_merge (dropping the now-redundant insert_lead_task helper).
…Commerce is active
A disabled woo preview kept flowing through is_task_complete(), whose WooCommerce callback marks the task complete as a side effect — a persistent write during a read — and produced a completed flag the card rendered as done. Disabled tasks now short-circuit to completed=false with no CTA path, and the card checks disabled before completed.
d6d4480 to
562901e
Compare
Proposed changes
Reworks the AI Launchpad "sell" goal so it leads with store setup and shows the full commerce roadmap instead of collapsing to a couple of tasks on a fresh site.
woo_*commerce tasks that the catalog visibility gate would otherwise drop are kept as a disabled preview of the roadmap (muted, lock icon, expandable to the subtitle + an "Available once WooCommerce is active." hint, no CTA/Skip). They become actionable once WooCommerce is active.sellfallback list and the tailoring prompt to lead store-first.Synthetic tasks are injected read-side in
AI_Launchpad_REST; the shared launchpad catalog is untouched.This is the third and last of the AI Launchpad first-pass design-feedback follow-ups, stacked on the gallery-task PR (#50166). Merge order: #50127 → #50166 → this.
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
The AI Launchpad is behind a feature flag and off in production; test on an Atomic site where it's enabled (e.g. a WoA dev site with the mu-wpcom build synced).
sell), with WooCommerce not active.woocommerce_task_list_tracked_completed_tasks, the task still renders as a locked preview (not "done"), and loading the list does not writelaunchpad_checklist_tasks_statuses.