Jetpack AI: Add drop down and options to Block transformation suggestions - #112472
Conversation
… pre-built options
Jetpack Cloud Live (direct link)
Automattic for Agencies Live (direct link)
Dashboard Live (dotcom) (direct link)
|
There was a problem hiding this comment.
Pull request overview
Adds dropdown-capable block transformation suggestions (tone change + translation) to the Jetpack AI sidebar, and extends Tracks click events to include which dropdown option was chosen.
Changes:
- Introduced predefined dropdown options for “Change tone” and “Translate content” block suggestions and surfaced them via
useSuggestions. - Updated click-to-suggestion matching to resolve both the suggestion and (when applicable) the selected dropdown option.
- Extended block transformation click tracking to include an optional
option_id, with new unit tests covering exposure + tracking.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/jetpack-ai-sidebar/src/utils/tracking.ts | Adds optional optionId to block transformation click tracking payload (option_id). |
| packages/jetpack-ai-sidebar/src/index.ts | Adds dropdown options for translate/tone suggestions and matches click values to suggestion+option for tracking. |
| packages/jetpack-ai-sidebar/src/index.test.ts | Adds tests for dropdown option exposure and option_id click tracking behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
…rmation-suggestion-dropdown # Conflicts: # packages/jetpack-ai-sidebar/src/index.test.ts
- Resolve index.ts conflict: keep empty prompt (dropdown option value carries the full sentence), adopt trunk's __i18n_text_domain__ domain on the tone/translate labels - Migrate PR-added tone/translate option strings from 'jetpack' to __i18n_text_domain__ per review, matching the file-wide domain convention
The design originally recommended detecting the source language and adding "from" and "to" sections for translations. I have not added those because client does not have built in capabilities of detecting language. Skipping English would fall in the same realm. How about we create a follow up to think how to add the language detecting capability here |
- Mirror the SEO Enhancer pattern: single-word dropdown option labels use _x() with a gettext context so translators can disambiguate them - Tone labels use 'Change tone dropdown option'; language labels use 'Translate content dropdown option' - Chip labels and full-sentence option values stay __()
|
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/34304872 Some locales (Hebrew) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Hi @iamchughmayank, could you please edit the description of this PR and add a screenshot for our translators? Ideally it'd include all of the following strings:
Thank you in advance! |


Proposed Changes
option_id) on the block-transformation click event so the picked tone/language is attributed in tracking.Note
In the post editor the Big Sky provider previously overrode these suggestions — it registers ahead of this Sidebar and wins the first-by-id provider merge, so its plain versions replaced the dropdowns.
Automattic/big-sky-plugin#6122makes Big Sky defer them when this Sidebar is enabled, so the dropdown versions surface. The two changes are needed together.Companion big sky: https://github.com/Automattic/big-sky-plugin/pull/6122
Why are these changes being made?
Block transformations are the only Jetpack AI Sidebar suggestions still surfaced as a single free-text prompt. The others (SEO Enhancer, Generate Excerpt, AI Editorial Review, Optimize Title) already offer curated options. This brings Change tone and Translate content to parity — discoverable presets instead of an open prompt.
Testing Instructions
update/give-jetpack-ai-suggestion-precedence(Automattic/big-sky-plugin#6122) and sync it to your sandbox.widgets.wp.com.The dropdowns are a post-editor feature — the Sidebar only exposes them there.
Pre-merge Checklist