Jetpack AI: Add AI feature toggles UI - #50386
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! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
This comment was marked as outdated.
This comment was marked as outdated.
cfbb4f6 to
720d5ba
Compare
7bc3d5d to
8686b02
Compare
fa7a467 to
5b51ce2
Compare
8686b02 to
a22aa0f
Compare
c523041 to
40b87e8
Compare
778ad63 to
6a1a413
Compare
8fee8d8 to
33b0500
Compare
… config The GUI config overrides transformIgnorePatterns, shadowing the base config's @wordpress/theme exception that trunk added — so after rebasing onto current trunk, any suite importing the new design-system chain failed to parse theme's untranspiled .mjs. Mirror the exception here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…wer ones Concurrent toggle saves raced: every POST response is a full settings snapshot applied in arrival order, so a slow earlier response landing last reverted a newer save on screen — no spinner, no error, while the server held the user's choice. Saves now queue behind a ref'd promise: one request in flight at a time, advancing on settle so a failure can't block the saves behind it. Serializing beats latest-response-wins, which still shows stale data when the server processes requests out of dispatch order. Tests lock in the held-back second POST and the failure-then-success path. Also capitalizes the changelog entry per house style (review nit). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The endpoint has always reported is_connected, but the view never consumed it, so a disconnected or offline site rendered every toggle as live while no AI feature could load. Per the toggle-contract P2's gate 2, the connection ask comes first: a warning notice links to My Jetpack's connection route, saved values stay visible but inert, and the Requires upgrade badge is suppressed while the plan is unknowable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tles savingKeys is a Set, so with two queued saves for the same key the first save's cleanup re-enabled the row while the second was still in flight. Refcount pending saves per key and release a key only when its last save settles. Also lock gated-toggle inertness: not-connected and master-off toggles fire no save and no Tracks event. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Docs links (Learn more) open a new tab; wp-admin action links stay same-tab — the behaviour proposed on the design review thread. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The default Tabs.List box extends ~16px left of the label, so the active-tab underline overhung the logo/subtitle line. Switch to the minimal tabs variant plus the jp-admin-page-tabs--minimal wrapper modifier — the base-styles opt-in pair Protect, Scan, and VideoPress use — which keeps the box flush with the label and the strip aligned with the header start (verified 184/184/184 on the live page). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A connected site whose plan lacks Jetpack AI now shows a plan notice with its saved values disabled, ordered after the connection ask and before master-off. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A successful feature-settings save shows a dismissible success notice (single slot, Features tab only). First main.jsx test coverage: host-off, MCP view tracking, and the save notice. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
49d6e16 to
7a9e7b4
Compare
|
This is great, @ariskataoka! One question: I am testing this on a new JN site, and the first view I get is the upgrade notice, even tho I have the free plan. Just wanted to check if this works well on your side?
|
|
Re the upgrade path: It currently leads to https://wordpress.com/plans And it would be good to reuse the existing one that we have from the My Jetpack path: Screen.Recording.2026-08-04.at.12.10.47.movWould that be possible? Or do we have any technical nuances here? |
|
@ariskataoka I just caught up with the recommendations from the DS team. The advise is to switch feedback components from notice to snackbar. 🙏 |
|
cc @grbicsanja for awareness |
|
We can update the copy for writing assistant: "Draft, rewrite, translate, and adjust tone for your content right in the block editor." |



Fixes related to #FORNO-391
Proposed changes
feature-settingsendpoint from Jetpack AI: Add feature settings controls #50287.#/featuresetc.) rendering the wrong view on fresh loads.A few judgment calls to sanity-check in review: Features is the default landing tab now; the "Mark images as AI-generated" sub-toggle was dropped with a later re-scope (the mockups predate it); Excerpt is bundled under Writing Assistant per the backend contract — no separate row; the "Learn more" links reuse existing Jetpack AI support targets — happy to swap if design has specific destinations.
Screenshots
Features tab — default state (self-hosted, free plan)

More states: master off · Atomic/SEO · host gate · save error
Master switch off — saved values kept but greyed, links hidden
Atomic — SEO enabled with "Open SEO Settings"; AI Search "Requires upgrade" (plan entitled, Search not set up)
Host gate off (
WP_AI_SUPPORTfalse) — notice only, no upsellAI SEO available but off — row visible with "Learn more"
AI Search available (paid Search) — no badge, toggle usable, "Open Search Settings"
** Image Editor off **
Failed save — dismissible error, view stays usable

Related product discussion/links
Does this pull request change what data or activity we track or use?
One new Tracks event:
jetpack_ai_feature_toggled(feature,enabled).jetpack_mcp_settings_viewednow fires on viewing the MCP tab instead of every page load.Testing instructions
jetpack build plugins/jetpack, open Jetpack → AI.wp option get jetpack_ai_writing_assistant_enabledshould now be empty, and the toggle should still be off after a reload. Switch it back on.#/features,#/mcp,#/readas direct links, plus browser back/forward.wp option update jetpack_ai_image_editor_enabled 0, reload) — the Clip child greys but keeps its saved value and its "Try it out" link disappears. Restore withwp option delete jetpack_ai_image_editor_enabled.WP_AI_SUPPORTtofalsein wp-config — the Features tab should show just a notice, no upsell.