Skip to content

Blaze: Ship the Blaze Ads dashboard as a wp-build page in Jetpack - #55566

Open
enejb wants to merge 2 commits into
trunkfrom
add/blaze-ads-dashboard
Open

enejb wants to merge 2 commits into
trunkfrom
add/blaze-ads-dashboard

Conversation

@enejb

@enejb enejb commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Fixes #

Proposed changes

The Blaze Ads dashboard (Jetpack → Blaze Ads) no longer loads its app from WordPress.com (widgets.wp.com/blaze-dashboard). It is now a wp-build page bundled with packages/blaze, built the same way as Activity Log, and it joins the Jetpack admin shell.

  • Code moved from wp-calypso into packages/blaze/src/dashboard. This includes the promote-post-i2 screens, the promote-post data hooks, lib/promote-post and the BlazePress widget wrapper. Calypso's setup screens (disconnected, private or ineligible site) are not ported: the dashboard only registers once the site and user are connected. Behavior and routes are unchanged; existing links such as admin.php?page=advertising#!/advertising/posts/promote/post-1/<site> keep working.
  • Same endpoints. Requests still go to jetpack/v4/blaze-app/..., now through apiFetch. The campaign creation widget still loads from dsp.wp.com/widget.js.
  • Calypso plumbing replaced by a small compat/ layer: config, a hashbang router, a read-only site/user store, Tracks, and a wpcom.req-compatible request client. No Redux, i18n-calypso or calypso-router.
  • UI on WordPress components.
    • The page uses AdminPage from @automattic/jetpack-components (same header and footer as the other Jetpack dashboards).
    • Calypso UI pieces are replaced by @wordpress/ui equivalents: Tabs, Notice, EmptyState, Badge, Button, Dialog/AlertDialog, Popover, Tooltip, InputControl, SelectControl, Skeleton and Link. The status/type filters use ToggleGroupControl from @wordpress/components.
    • Calypso's color-studio tokens, typography and layout CSS are gone; styles use --wpds-* tokens.
  • Translations. Strings use @wordpress/i18n with the jetpack-blaze domain. The remote widget's own strings are registered verbatim so its translateFn still finds them.
  • PHP.
    • Dashboard loads the wp-build page under the same advertising slug, with the same config data (now window.jetpackBlazeDashboardConfig). It falls back to the remote dashboard only when the build output is missing.
    • Blaze::init() registers the page as an admin shell member.

Related product discussion/links

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

No. The same Tracks events are recorded (calypso_dsp_*, calypso_page_view with the DSP origin), now pushed to the Tracks queue that jp-tracks loads (@automattic/jetpack-analytics drops events that don't start with jetpack_).

Testing instructions

Use a site with Jetpack connected and Blaze available (Jurassic Ninja works). Build the package with jp build --deps packages/blaze or the Jetpack plugin.

  • Go to Jetpack → Blaze Ads.
    • The page uses the standard Jetpack header (logo, "Blaze Ads", subtitle with "Learn more", Promote button) and footer.
    • The Performance card shows placeholders, then totals.
    • Ready to promote / Campaigns / Payments tabs sit under the card, with Credits on the right when the site has credits.
  • Switch tabs; the URL hash changes (#!/advertising/campaigns/<site>), and Back/Forward work.
  • Search and filter the posts and campaigns lists.
  • Click Promote on a post. The full-screen campaign widget opens. Click Back → "Yes, quit" to return to the list.
  • Open a deep link such as wp-admin/admin.php?page=advertising#!/advertising/posts/promote/post-1/<your-site>. It opens the widget directly, as before.
  • Optional, admin shell: enable it (add_filter( 'jetpack_admin_shell_enabled', '__return_true' );). Open Activity Log, then Blaze Ads from the menu. Blaze opens without a page load, and switching back and forth keeps the selected tab.

Run the rehearsals below from Tools → Rehearsal on any JN site. Each fails on trunk at its first step, because the dashboard there is the remote Calypso build, and passes on this branch.

Rehearsal: Blaze Ads: Dashboard lists posts ready to promote

Rehearsal 6b33de7 · 6 steps · covers packages/blaze
Last run: Passed in Playwright on WordPress 7.1.5 · Theme: Twenty Twenty-Four 1.6 · Akismet Anti-spam: Spam Protection 5.7.2 · Jetpack 16.5-a.5, run #54, 2026-11-27.
View or install this rehearsal · JSON · Playwright test (links work while fortunately-brave-hoverfly.jurassic.ninja exists)

Rehearsal JSON
{
    "format": 2,
    "requires": [
        "jetpack"
    ],
    "covers": [
        "packages/blaze"
    ],
    "viewport": "desktop",
    "timeout": 30000,
    "steps": [
        {
            "goto": "/wp-admin/admin.php?page=advertising"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app .promote-post-i2__page",
            "toContainText": "Blaze Ads"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app [role=tab][aria-selected=true]",
            "toContainText": "Ready to promote"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app tr:has-text(\"Hello world!\")",
            "toContainText": "Promote"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app .campaigns-total-stats__container",
            "toContainText": "Total ad views"
        },
        {
            "expectNoConsoleErrors": true
        }
    ]
}

Rehearsal: Blaze Ads: Tabs switch between posts, campaigns and payments

Rehearsal 118f566 · 11 steps · covers packages/blaze
Last run: Passed in Playwright on WordPress 7.1.5 · Theme: Twenty Twenty-Four 1.6 · Akismet Anti-spam: Spam Protection 5.7.2 · Jetpack 16.5-a.5, run #56, 2026-11-27.
View or install this rehearsal · JSON · Playwright test (links work while fortunately-brave-hoverfly.jurassic.ninja exists)

Rehearsal JSON
{
    "format": 2,
    "requires": [
        "jetpack"
    ],
    "covers": [
        "packages/blaze"
    ],
    "viewport": "desktop",
    "timeout": 30000,
    "steps": [
        {
            "goto": "/wp-admin/admin.php?page=advertising"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app [role=tab][aria-selected=true]",
            "toContainText": "Ready to promote"
        },
        {
            "click": "#jetpack-blaze-dashboard-wp-admin-app [role=tab]:has-text(\"Campaigns\")"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app [role=tab][aria-selected=true]",
            "toContainText": "Campaigns"
        },
        {
            "expectText": "Recently published",
            "in": "#jetpack-blaze-dashboard-wp-admin-app .promote-post-i2__page-body"
        },
        {
            "click": "#jetpack-blaze-dashboard-wp-admin-app [role=tab]:has-text(\"Payments\")"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app [role=tab][aria-selected=true]",
            "toContainText": "Payments"
        },
        {
            "expectText": "Current site",
            "in": "#jetpack-blaze-dashboard-wp-admin-app .promote-post-i2__page-body"
        },
        {
            "click": "#jetpack-blaze-dashboard-wp-admin-app [role=tab]:has-text(\"Ready to promote\")"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app tr:has-text(\"Hello world!\")",
            "toBeVisible": true
        },
        {
            "expectNoConsoleErrors": true
        }
    ]
}

Rehearsal: Blaze Ads: Promote opens the campaign widget and quitting returns to the list

Rehearsal 3c22777 · 9 steps · covers packages/blaze
Last run: Passed in Playwright on WordPress 7.1.5 · Theme: Twenty Twenty-Four 1.6 · Akismet Anti-spam: Spam Protection 5.7.2 · Jetpack 16.5-a.5, run #55, 2026-11-27.
View or install this rehearsal · JSON · Playwright test (links work while fortunately-brave-hoverfly.jurassic.ninja exists)

Rehearsal JSON
{
    "format": 2,
    "requires": [
        "jetpack"
    ],
    "covers": [
        "packages/blaze"
    ],
    "viewport": "desktop",
    "timeout": 30000,
    "steps": [
        {
            "goto": "/wp-admin/admin.php?page=advertising"
        },
        {
            "click": "#jetpack-blaze-dashboard-wp-admin-app tr:has-text(\"Hello world!\") button:has-text(\"Promote\")"
        },
        {
            "expect": ".blazepress-widget__header-bar",
            "toContainText": "Jetpack powered"
        },
        {
            "expect": ".blazepress-widget__widget-container",
            "toContainText": "Get started",
            "timeout": 45000
        },
        {
            "click": ".blazepress-widget__header-bar button:has-text(\"Back\")"
        },
        {
            "expect": ".blazepress-widget__cancel-dialog",
            "toContainText": "Are you sure you want to quit?"
        },
        {
            "click": ".blazepress-widget__cancel-dialog button:has-text(\"Yes, quit\")"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app tr:has-text(\"Hello world!\")",
            "toBeVisible": true
        },
        {
            "expectNoConsoleErrors": {
                "ignore": [
                    "dsp\\.wp\\.com",
                    "stripe"
                ]
            }
        }
    ]
}

Rehearsal: Blaze Ads: Searching the posts list filters it

Rehearsal 68e8337 · 6 steps · covers packages/blaze
Last run: Passed in Playwright on WordPress 7.1.5 · Theme: Twenty Twenty-Four 1.6 · Akismet Anti-spam: Spam Protection 5.7.2 · Jetpack 16.5-a.5, run #57, 2026-11-27.
View or install this rehearsal · JSON · Playwright test (links work while fortunately-brave-hoverfly.jurassic.ninja exists)

Rehearsal JSON
{
    "format": 2,
    "requires": [
        "jetpack"
    ],
    "covers": [
        "packages/blaze"
    ],
    "viewport": "desktop",
    "timeout": 30000,
    "steps": [
        {
            "goto": "/wp-admin/admin.php?page=advertising"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app tr:has-text(\"Sample Page\")",
            "toBeVisible": true
        },
        {
            "fill": "#jetpack-blaze-dashboard-wp-admin-app input[type=search]",
            "value": "Hello"
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app tr:has-text(\"Sample Page\")",
            "toHaveCount": 0
        },
        {
            "expect": "#jetpack-blaze-dashboard-wp-admin-app tr:has-text(\"Hello world!\")",
            "toBeVisible": true
        },
        {
            "expectNoConsoleErrors": true
        }
    ]
}

@enejb enejb added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. [Package] Blaze Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code labels Nov 27, 2026
@enejb enejb self-assigned this Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 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 (Jetpack or WordPress.com Site Helper), and enable the add/blaze-ads-dashboard branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/blaze-ads-dashboard
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/blaze-ads-dashboard

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 added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: December 8, 2026
    • Code freeze: December 7, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

jp-launch-control Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/packages/blaze/src/class-dashboard.php 65/152 (42.76%) -40.80% 75 💔
projects/packages/blaze/src/class-blaze.php 208/288 (72.22%) -1.56% 10 💔

Full summary · PHP report · JS report

Coverage check overridden by Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code .

- Remove the setup screens and their images: the dashboard only registers once the site and user are connected, so need_setup is never set.
- Send Tracks events through the jp-tracks queue; jetpack-analytics drops calypso_* events, so none were recorded.
- Stop refetching on window focus while the admin shell hides the dashboard, and load the gridicons sprite only when the campaign widget opens.
- Recompute the router's active state from the URL instead of pairing shell events.
- Share the dashboard-enabled check between the menu and the shell member.
- Trim unused footer, logo, page view tracker, blank canvas and state helpers, and reuse the build script in build-production.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Package] Blaze [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh [Status] Needs Review This PR is ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant