Repository navigation
Boost: Add an "Ask your agent" button to the speed score card behind a feature flag - #55586
Draft
LiamSarsfield wants to merge 5 commits into
Draft
LiamSarsfield wants to merge 5 commits into
LiamSarsfield wants to merge 5 commits into
Conversation
…a feature flag The button sits in the "Your site speed" card header when the boost-ask-your-agent flag is on and the card holds a settled, current score. It opens a dialog previewing a prompt built from the measured page and its mobile and desktop scores, with a Copy button that falls back to selecting the text when the browser blocks clipboard access. Opening the preview and copying the prompt each record one Tracks event. The flag is registered off by default and handed to the dashboard through the jetpack_boost_js_constants filter.
Build the "Ask your agent" prompt when its dialog opens and keep it until the dialog opens again. A without-Boost score that finishes measuring in between cannot change text the site owner has already copied or selected; the next open shows it. A copy that finishes after the dialog closes has no effect. When the button disappears while it or its dialog has focus, focus moves to the "Your site speed" heading instead of the page body. Adds a dashboard test that the button shows only with the flag on.
LiamSarsfield
marked this pull request as draft
November 30, 2026 13:34
Contributor
|
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! Boost 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. |
Code Coverage SummaryCoverage changed in 3 files.
3 files are newly checked for coverage.
|
…config.resolve.alias and added $lib using pluginRoot, matching the settings fixture. Syntax and diff whitespace checks passed. Webpack verification was blocked by pnpm 11.5.2; the repository requires ^12.22.0. Both CI checks remain unverified
- Record the copied event for a copy that succeeds after the dialog closed or was removed by a refresh, without changing the screen; a removal now counts as a close. - Announce a blocked copy to screen readers. - Always remove the fallback copy field, even when copying throws. - Reset the feature flag registry and filter after each flag test, and check that the constructor registers the flag. - Tidy comments and small code in the dialog and prompt builder.
The dialog can focus the prompt field on open before the click, so waiting for focus could pass before the blocked copy settled.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes BOOST-915
Proposed changes
Why are these changes being made?
Owners see scores, not next steps.
How it reaches users
Off by default behind the
boost-ask-your-agentfeature flag.Does this pull request change what data or activity we track or use?
Flag on only: Tracks events
jetpack_boost_ask_agent_preview_openedandjetpack_boost_ask_agent_prompt_copied(surface: speed_score_card).Testing instructions
Checked at 1440 and 390 wide and by keyboard on two Jurassic Ninja sites (Boost with Jetpack, Boost only). On an Atomic site at 1440 wide, the button shows and step 5 works (Copy prompt not pressed). Not checked yet: VoiceOver, due before the flag is turned on for users.
The button is absent.
wp companion feature-flag enable boost-ask-your-agent, reload.The button appears.
The prompt is copied.
Hidden until new scores arrive.
Focus returns.
Screenshots
Jurassic Ninja site with Boost and Jetpack, Jetpack → Boost. Before is a build without this change; after is this branch.
Dialog, flag on: