Skip to content

SEO: add an AI tab and move the AI SEO Enhancer setting#49408

Draft
angelablake wants to merge 1 commit into
add/jetpack-seo-content-tabfrom
add/jetpack-seo-ai-tab
Draft

SEO: add an AI tab and move the AI SEO Enhancer setting#49408
angelablake wants to merge 1 commit into
add/jetpack-seo-content-tabfrom
add/jetpack-seo-ai-tab

Conversation

@angelablake
Copy link
Copy Markdown
Contributor

@angelablake angelablake commented Jun 4, 2026

Stacked on #49351 (SEO Content tab) so the test artifact shows the whole product. The diff here is AI-only. When #49351 merges, this rebases onto trunk.

Proposed changes

Adds an AI tab to the Jetpack SEO dashboard and moves the existing AI SEO Enhancer setting onto it.

This re-scopes what was originally planned as the larger "AI tab" PR: it stands up the tab shell and ports the one setting that already exists, so the bigger AI features (llms.txt, AI-crawler controls) can be built on top of it separately by their own efforts.

Why now

  1. The AI SEO Enhancer toggle (ai_seo_enhancer_enabled — "Automatically generate SEO title, SEO description, and image alt text for new posts") currently lives only on the legacy SEO Traffic page. It needs a home on the new admin before that page is eventually removed.
  2. Creating the tab + route gives follow-up AI work (llms.txt generation, AI-crawler management) a place to land its settings.

What this PR does

  • New "AI" tab alongside Overview and Settings (_inc/app.tsx). The tab itself is not plan-gated — it stays visible on all hosting, since free AI settings will be added to it later.
  • Initializer::get_ai_data() bootstraps a seo.ai slice onto the page (window.JetpackScriptData.seo.ai) with the enhancer's enabled state and whether it's available. Availability mirrors the legacy gate: the ai_seo_enhancer_enabled feature filter must be on (the feature still depends on AI being available) and the site's plan must support the ai-seo-enhancer feature (Current_Plan::supports(), guarded by class_exists as it's provided by the host plugin).
  • AI screen (_inc/screens/ai/) renders the enhancer toggle only when available (parity with the legacy page); otherwise it shows a neutral placeholder so the tab isn't blank. The toggle saves on change through the existing /jetpack/v4/settings endpoint (ai_seo_enhancer_enabled) — no new REST — with the same "Updating settings…"→"Settings saved." snackbar as the Settings tab, reverting on error. State is lifted to the page root so it survives tab switches.

This is additive: the legacy Traffic-page toggle is left in place and removed later when the old page is retired. Generation itself is entirely editor/AI-Assistant side, so there is no PHP generation logic to move — only the persisted toggle and its plan-gate.

Other information

  • Have you written new tests for your changes? — Initializer::get_ai_data() contract test (shape + unavailable without a supporting plan) in the SEO package suite.
  • Have you added a changelog entry?

Does this pull request change what data or activity we track or use?

No. It relocates an existing setting's UI; no new options or telemetry.

Testing instructions

  1. Apply this branch (Jetpack Beta) and open the Jetpack SEO admin page. Confirm an AI tab appears next to Overview and Settings.
  2. On a site whose plan supports the AI SEO Enhancer, confirm the AI SEO Enhancer toggle renders on the AI tab, reflects the current value, and that toggling it persists (reload — the new value sticks) with the save snackbar.
  3. Confirm the value stays in sync with the legacy Traffic-page toggle (changing one is reflected by the other), since both write the same ai_seo_enhancer_enabled option.
  4. On a site without a supporting plan, confirm the AI tab is still visible and shows the placeholder (no toggle), matching the legacy page hiding the setting.

The SEO dashboard is behind the rsm_jetpack_seo feature flag; enable it on the test site to reach the page.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

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 (Jetpack), and enable the add/jetpack-seo-ai-tab branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/jetpack-seo-ai-tab

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

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 Jun 4, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented Jun 4, 2026

Code Coverage Summary

No summary data is available for parent commit 9fa7f1d, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for 9fa7f1d is available.

Full summary · PHP report · JS report

@angelablake angelablake force-pushed the add/jetpack-seo-ai-tab branch from cb8dbe1 to 3cc4b34 Compare June 4, 2026 19:18
@angelablake angelablake changed the base branch from trunk to add/jetpack-seo-content-tab June 4, 2026 19:18
…-1683)

Stand up an AI tab in the SEO dashboard and relocate the AI SEO Enhancer toggle
(auto-generate SEO title/description/alt-text for new posts) from the legacy
Traffic page onto it. Additive only — the legacy toggle stays until PR #5b
removes the old page.

- New 'ai' tab in app.tsx (always visible — free AI settings will be added here
  later by separate llms.txt / AI-crawler work).
- get_ai_data() bootstraps seo.ai script-data: the enhancer's enabled state plus
  availability, which mirrors the legacy gate (the ai_seo_enhancer_enabled feature
  filter AND Current_Plan::supports('ai-seo-enhancer'); Current_Plan guarded by
  class_exists as it's host-plugin-provided).
- AiScreen renders the enhancer toggle only when available; useAiForm saves on
  change through the existing /jetpack/v4/settings endpoint (no new REST), with
  the same snackbar + revert-on-error as Settings. Lifted to the page root so the
  value survives tab switches.
- Tests: get_ai_data() contract (shape + unavailable without a supporting plan).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@angelablake angelablake force-pushed the add/jetpack-seo-ai-tab branch from 3cc4b34 to 71ad180 Compare June 4, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Seo [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. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant