Repository navigation
Conversation
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)
|
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. 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. |
Code Coverage SummaryCannot generate coverage summary while tests are failing. 🤐 Please fix the tests, or re-run the Code coverage job if it was something being flaky. |
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
…o update/pa-widget-footer-actions
name the action id in the errors; one SCSS pin explains the other; the Locations comment sits on its JSX again
… into update/pa-retire-widget-footer
…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
…o update/pa-widget-footer-actions
… into update/pa-retire-widget-footer
…into update/pa-widget-json-view-all
…into update/pa-widget-chrome-actions
…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
… into update/pa-retire-widget-footer
…into update/pa-widget-json-view-all
…into update/pa-widget-chrome-actions
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, aReportLinkand anExporterCsvDownloadButton.@wordpress/widget-dashboard0.9.0 renders a widget's actions in the card chrome instead, placed byrelevance:highas text links in a footer strip,mediumas 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
DashboardWidgetHostProvider, frompackages/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.useReportActions( { report, section, csv } )in the toolkit and the SDK declaresview-allanddownload-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.WidgetFooter,ReportLink,ExporterCsvDownloadButtonand theLeaderboardfooterprop go; the widget contract moves to 2.0.0, and Ads, VideoPress and WooCommerce Stats register against it.view-allinwidget.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
Build
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-modulesresponse carriesactions: [ { id: "view-all", … } ]on the thirteen types with a fixed report, andactions: nullon 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
WidgetDashboardWithWidgetstory, the footer renders on the 1x1 and 1x2 tiles through thewidgetWidthandwidgetHeightcontrols.