AI Launchpad: add a "Create your first gallery" task for photography and portfolio sites#50166
AI Launchpad: add a "Create your first gallery" task for photography and portfolio sites#50166Copons wants to merge 11 commits into
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! |
Code Coverage SummaryCoverage changed in 6 files. Only the first 5 are listed here.
1 file is newly checked for coverage.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
There was a problem hiding this comment.
Pull request overview
Adds a synthetic “Create your first gallery” onboarding task to the AI Launchpad tailored task list for portfolio / visual-work sites, with a client-side gallery-pattern page creator and a server-side publish listener to mark the task complete. Also adjusts the CTA busy-state behavior to avoid a brief “spinner flash” before navigation.
Changes:
- Inject a synthetic
add_gallery_pagetask read-side (tailored view only) and derive its completion/in-progress state from marker-meta drafts + thelaunchpad_checklist_tasks_statusesoption. - Add a gallery pattern-page variant that filters patterns to gallery, falls back to a bare gallery block, and strips redundant “Gallery” headings.
- Add PHP + JS test coverage for injection, completion, and pattern variant selection; include a changelog entry.
Reviewed changes
Copilot reviewed 12 out of 12 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 | Injects add_gallery_page for portfolio/visual niches; computes completion/in-progress and inserts before launch tasks. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/class-ai-launchpad-gallery-page-listener.php | Registers marker meta and completes the synthetic task on first publish of a marked gallery page. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/ai-launchpad.php | Loads the new gallery listener as part of the AI Launchpad feature bootstrap. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/lib/pattern-page.ts | Adds gallery variant selection, gallery fallback HTML, and redundant-heading stripping; tags created pages with variant-specific marker meta. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/lib/pattern-page.test.mts | Tests selectPatternPage() behavior for gallery/about variants, fallback, and heading stripping. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/model.ts | Routes add_gallery_page through the pattern-page flow and passes a pattern variant to the create-page handler. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/model.test.mts | Tests CTA kind routing and variant propagation for gallery vs about pattern-page tasks. |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/task-card.tsx | Adds a specific CTA label for add_gallery_page (“Create gallery”). |
| projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/tailored-list.tsx | Fixes CTA spinner behavior by keeping busy state through window.location.href navigation. |
| projects/packages/jetpack-mu-wpcom/tests/php/features/ai-launchpad/AI_Launchpad_REST_Test.php | Adds tests for gallery-task injection rules, ordering, completion, in-progress behavior, and ?all_tasks=1 exclusion. |
| projects/packages/jetpack-mu-wpcom/tests/php/features/ai-launchpad/AI_Launchpad_Gallery_Page_Listener_Test.php | New test suite validating marker-meta registration and completion behavior on publish/eligibility. |
| projects/packages/jetpack-mu-wpcom/changelog/add-ai-launchpad-gallery-task | Changelog entry for the new synthetic gallery task. |
Use a fixed "Gallery" title instead of the PTK pattern's own name, drop an in-pattern heading that just repeats the title, and give the empty-gallery fallback the layout classes core serializes so the editor doesn't flag it.
The get-started handler cleared the busy state in a finally block that ran immediately after window.location.href was set, so the button flashed back to its label before the browser unloaded. Return on the navigating path and only clear busy when we stay on the page.
b693df4 to
d60a111
Compare
8a19824 to
d60a111
Compare
Fixes #
Proposed changes
Adds the AI Launchpad's first synthetic task: a "Create your first gallery" task that photography/portfolio sites get in their tailored onboarding list. It opens the editor pre-filled with a niche-scored gallery pattern and completes on publish, mirroring the About-page task. The task is never in the shared launchpad catalog or the AI
TASK_MENU— it's injected read-side, so the shared catalog stays untouched.AI_Launchpad_REST):should_offer_gallery_task()offersadd_gallery_pagewhen the inferred goal isportfolioor the niche matches a small visual-work keyword set;insert_before_launch_task()splices it in just before the launch task. Only in the tailored view (not?all_tasks=1).AI_Launchpad_Gallery_Page_Listener): marker meta_wpcom_ai_launchpad_gallery_pageon the created page; on first publish it writes the completion directly tolaunchpad_checklist_tasks_statuses(the synthetic id isn't in the shared catalog, sowpcom_mark_launchpad_task_complete()would drop it). In-progress "Continue…" reopens the existing draft.pattern-page.ts): agalleryvariant filters the PTK library to the Gallery category, scores by niche, and falls back to a bare gallery block. The page gets a fixed "Gallery" title (not the pattern's own name), and any in-pattern heading that just repeats the title is stripped so "Gallery" isn't shown twice.finallythat ran right afterwindow.location.hrefwas set, so the button briefly flashed back to its label before navigating. It now holds the spinner through the page unload for every create-post/page CTA.Related product discussion/links
trunkonce that merges.Does this pull request change what data or activity we track or use?
No. The task reuses the existing AI Launchpad tracking; no new data is collected.
Testing instructions