Skip to content

[PoC] Premium Analytics: render the widget footer as dashboard actions - #53890

Closed
retrofox wants to merge 39 commits into
trunkfrom
update/pa-widget-chrome-actions
Closed

retrofox wants to merge 39 commits into
trunkfrom
update/pa-widget-chrome-actions

Conversation

@retrofox

@retrofox retrofox commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Part of WOOA7S-2085 (WOOA7S-2174, tasks B1 to B5). The whole change in one PR, to try the complete approach; the four stacked PRs below hold the same commits in reviewable units.

Proposed changes

The dashboard renders the footer

Every widget drew its own footer inside the body: WidgetFooter, a ReportLink and an ExporterCsvDownloadButton. @wordpress/widget-dashboard 0.9.0 renders a widget's actions in the card chrome instead, placed by relevance: high as text links in a footer strip, medium as compact affordances beside them. This PR moves the seventeen widgets with a footer onto that, and retires the toolkit components.

Media: a card footer before and after, on 1x1 and 1x2 tiles.

In four steps

  1. The host links capability (Premium Analytics: provide the host links capability to the dashboard stages #53878). DashboardWidgetHostProvider, from packages/routing, wraps the dashboard in the four stages: an action href that targets a dashboard route mounts the router link, with the dashboard's dates and tab, so the navigation stays client-side.
  2. The widgets declare their footer (Premium Analytics: show View all and the CSV download as widget actions #53881). useReportActions( { report, section, csv } ) in the toolkit and the SDK declares view-all and download-csv, and the seventeen widgets replace their inline footer with it. The footer strip is pinned to 44px until Widget Dashboard: the footer strip changes height with the affordances it holds WordPress/gutenberg#85231 lands.
  3. The toolkit drops the inline footer (Premium Analytics: retire the inline widget footer #53885). WidgetFooter, ReportLink, ExporterCsvDownloadButton and the Leaderboard footer prop go; the widget contract moves to 2.0.0, and Ads, VideoPress and WooCommerce Stats register against it.
  4. The manifest declares the link (Premium Analytics: declare the View all link in widget.json #53889). The thirteen widgets with a fixed report declare view-all in widget.json; the rest keep declaring it at runtime.

What changes on screen

The divider runs edge to edge, the strip is shorter, the link is underlined at rest, and the body loses its bottom padding. WordAds earnings history shows "Adjustments (N)" as text in place of the badge. The two most-commented widgets lose the accessible names that told their links apart. The close-up stories no longer show the footer, since it is chrome.

Media: View all opening a report without a reload.

Lands after #53850

The "View all" label of the thirteen manifests reaches the translation catalog through the gettext stubs of #53850; until that lands, it renders in English on those widgets.

Related product discussion/links

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

No.

Testing instructions

Tests

cd projects/packages/premium-analytics
pnpm run test
composer phpunit
pnpm run typecheck
cd ../ads && pnpm run typecheck
cd ../videopress && pnpm run typecheck && pnpm run test

Build

jetpack build --deps packages/premium-analytics
jetpack build packages/ads
jetpack build packages/videopress

The footer

Every widget that linked to its report shows "View all" at the start of the card footer and the download icon at its end, under a full-width divider, and every footer has the same height. "View all" opens the report without a page reload and keeps the dashboard's dates, and the comparison when it is on. The download icon is disabled while the file is generated and saves the report's CSV, scoped the way the widget is drilled.

Locations opens the tab its granularity selects, and Top posts switches the tab with its view. On a post page, UTM insights shows no footer. WordAds earnings history shows "Adjustments (N)" at the end of the footer only when the report has adjustments. Subscribers list shows "Manage subscribers", which opens the Newsletter subscribers page with a page load. The Ads section and the Top videos widget still register.

The Network tab

The wpcom/v2/widget-modules response carries actions: [ { id: "view-all", … } ] on the thirteen types with a fixed report, and actions: null on the rest. A click on "View all" fires only the report's REST requests, with no document load; a click on the download icon fires the export request alone.

Tiles in Storybook

In any widget's WidgetDashboardWithWidget story, the footer renders on the 1x1 and 1x2 tiles through the widgetWidth and widgetHeight controls.

widget action hrefs on a dashboard route mount the router link
accept JSON values inside p; the host link hands them over parsed
the host renders View all and the CSV download in the card footer
15 widgets declare View all and the CSV download to the host
Adjustments (N) rides as the trailing action when the report has any
useReportActions is new in the SDK
WidgetFooter, ReportLink, ExporterCsvDownloadButton and Leaderboard.footer
the SDK drops three exports; Ads and VideoPress register against 2.x
stopgap for WordPress/gutenberg#85231: a compact control grows the strip
a static action href gets the dashboard dates and tab; its own params win
13 widgets with a fixed report; the per-instance ones stay at runtime
stopgap for WordPress/gutenberg#85231: a compact control grows the strip

(cherry picked from commit a49a114)
@retrofox retrofox added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] In Progress labels Oct 20, 2026
@retrofox retrofox self-assigned this Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 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), and enable the update/pa-widget-chrome-actions branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/pa-widget-chrome-actions

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 commented Oct 20, 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:

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.


Premium Analytics 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.

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Cannot generate coverage summary while tests are failing. 🤐

Please fix the tests, or re-run the Code coverage job if it was something being flaky.

Full summary · PHP report · JS report

@retrofox retrofox changed the title Premium Analytics: render the widget footer as dashboard actions [PoC] Premium Analytics: render the widget footer as dashboard actions Oct 21, 2026
the matcher and the route link belong in @wordpress/route
…t-links

# Conflicts:
#	projects/packages/premium-analytics/routes/dashboard/stage.tsx
routing exports only the provider; the matcher stays internal
name the action id in the errors; one SCSS pin explains the other; the Locations comment sits on its JSX again
…into update/pa-widget-json-view-all

# Conflicts:
#	projects/packages/premium-analytics/packages/routing/src/widget-host/__tests__/dashboard-widget-host-provider.test.tsx
#	projects/packages/premium-analytics/routes/widget-host.tsx
#	projects/packages/premium-analytics/widgets/emails/widget.json
the provider takes a useLinkSearch hook; the toolkit supplies the window and tab
…hrome-actions

# Conflicts:
#	projects/packages/premium-analytics/packages/widgets-toolkit/src/components/detail-page/detail-page-layout.module.scss
the router would carry a hash, the matcher declines by choice; 1.0 and 1e3 parse as the router does
…ter-actions

# Conflicts:
#	projects/packages/premium-analytics/packages/routing/src/dashboard-href/index.ts
#	projects/packages/premium-analytics/packages/routing/src/dashboard-href/match-dashboard-href.test.ts
#	projects/packages/premium-analytics/packages/routing/src/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant