Skip to content

AI Launchpad: add a "Create your first gallery" task for photography and portfolio sites#50166

Open
Copons wants to merge 11 commits into
trunkfrom
dotcom-17737-ai-launchpad-add-a-create-your-first-gallery-task-for
Open

AI Launchpad: add a "Create your first gallery" task for photography and portfolio sites#50166
Copons wants to merge 11 commits into
trunkfrom
dotcom-17737-ai-launchpad-add-a-create-your-first-gallery-task-for

Conversation

@Copons

@Copons Copons commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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.

  • Injection (AI_Launchpad_REST): should_offer_gallery_task() offers add_gallery_page when the inferred goal is portfolio or 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).
  • Completion (AI_Launchpad_Gallery_Page_Listener): marker meta _wpcom_ai_launchpad_gallery_page on the created page; on first publish it writes the completion directly to launchpad_checklist_tasks_statuses (the synthetic id isn't in the shared catalog, so wpcom_mark_launchpad_task_complete() would drop it). In-progress "Continue…" reopens the existing draft.
  • Pattern selection (pattern-page.ts): a gallery variant 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.
  • CTA spinner fix: the get-started handler cleared its busy state in a finally that ran right after window.location.href was 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

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

  • On an AI-onboarded paid/Atomic site, enable the AI Launchpad and ensure the inferred niche/goal is visual (e.g. niche "photography", or goal "portfolio").
  • Go to wp-admin → AI Launchpad. Confirm a "Create your first gallery" task appears before the launch task.
  • Click Create gallery — the spinner should hold until the editor opens on a gallery page titled "Gallery" with a gallery pattern (no duplicate "Gallery" heading).
  • Publish the page, return to the AI Launchpad, and confirm the task shows as completed.
  • Save a gallery draft without publishing, reload the list, and confirm the task shows "Continue…" and reopens that draft rather than creating a new one.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (WordPress.com Site Helper), and enable the dotcom-17737-ai-launchpad-add-a-create-your-first-gallery-task-for branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin dotcom-17737-ai-launchpad-add-a-create-your-first-gallery-task-for

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jul 2, 2026
@Copons Copons marked this pull request as ready for review July 2, 2026 10:43
@Copons Copons added the [Status] Needs Review This PR is ready for review. label Jul 2, 2026
@jp-launch-control

jp-launch-control Bot commented Jul 2, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 6 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/lib/pattern-page.ts 0/225 (0.00%) 0.00% 79 💔
projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/model.ts 0/280 (0.00%) 0.00% 3 ❤️‍🩹
projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/tailored-list.tsx 0/282 (0.00%) 0.00% 2 ❤️‍🩹
projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/js/tailored-list/task-card.tsx 0/155 (0.00%) 0.00% 2 ❤️‍🩹
projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/ai-launchpad.php 6/92 (6.52%) -0.07% 1 ❤️‍🩹

1 file is newly checked for coverage.

File Coverage
projects/packages/jetpack-mu-wpcom/src/features/ai-launchpad/class-ai-launchpad-gallery-page-listener.php 24/40 (60.00%) 💚

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_page task read-side (tailored view only) and derive its completion/in-progress state from marker-meta drafts + the launchpad_checklist_tasks_statuses option.
  • 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.

Base automatically changed from dotcom-17736-ai-launchpad-filter-the-themes-picker-by-the-users-goalniche to trunk July 2, 2026 16:30
Copons added 11 commits July 2, 2026 17:31
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.
@Copons Copons force-pushed the dotcom-17737-ai-launchpad-add-a-create-your-first-gallery-task-for branch from b693df4 to d60a111 Compare July 2, 2026 16:33
@Copons Copons force-pushed the dotcom-17737-ai-launchpad-add-a-create-your-first-gallery-task-for branch from 8a19824 to d60a111 Compare July 2, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[mu wpcom Feature] Ai Launchpad [Package] Jetpack mu wpcom WordPress.com Features [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] Needs Review This PR is ready for review. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants