WOOA7S-2209: Premium Analytics: Show the generic empty state in chart widgets - #52794
Conversation
|
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: The Jetpack plugin has different release cadences depending on the platform:
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. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add corresponding changelog entries for the affected plugins.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates Premium Analytics chart widgets to use the shared generic empty state while preserving the email-selection prompt.
Changes:
- Removes widget-specific empty messages and icons.
- Updates tests and Storybook stories.
- Adds a package changelog entry.
| File | Change |
|---|---|
projects/packages/premium-analytics/widgets/wordads-chart-tabs/stories/wordads-chart-tabs-widget.stories.tsx |
Updates empty-state story documentation. |
projects/packages/premium-analytics/widgets/wordads-chart-tabs/render.tsx |
Uses the generic empty state. |
projects/packages/premium-analytics/widgets/total-visitors/render.tsx |
Removes the custom empty state. |
projects/packages/premium-analytics/widgets/total-visitors/__tests__/total-visitors.test.tsx |
Updates empty-state expectations. |
projects/packages/premium-analytics/widgets/total-views/render.tsx |
Removes the custom empty state. |
projects/packages/premium-analytics/widgets/total-views/__tests__/total-views.test.tsx |
Updates empty-state expectations. |
projects/packages/premium-analytics/widgets/top-platforms/stories/top-platforms-widget.stories.tsx |
Updates empty-state story documentation. |
projects/packages/premium-analytics/widgets/top-platforms/render.tsx |
Uses the generic empty state. |
projects/packages/premium-analytics/widgets/subscribers-chart/stories/subscribers-chart-widget.stories.tsx |
Updates empty-state story documentation. |
projects/packages/premium-analytics/widgets/subscribers-chart/render.tsx |
Removes the custom empty state. |
projects/packages/premium-analytics/widgets/popular-hours/render.tsx |
Uses the generic empty state. |
projects/packages/premium-analytics/widgets/popular-hours/__tests__/popular-hours.test.tsx |
Updates empty-state expectations. |
projects/packages/premium-analytics/widgets/popular-days/render.tsx |
Uses the generic empty state. |
projects/packages/premium-analytics/widgets/popular-days/__tests__/popular-days.test.tsx |
Updates empty-state expectations. |
projects/packages/premium-analytics/widgets/email-time-series/render.tsx |
Preserves the no-email-selection prompt. |
projects/packages/premium-analytics/widgets/email-time-series/__tests__/email-time-series.test.tsx |
Updates timeline assertions. |
projects/packages/premium-analytics/widgets/devices/stories/devices-widget.stories.tsx |
Updates empty-state story documentation. |
projects/packages/premium-analytics/widgets/devices/render.tsx |
Uses the generic empty state. |
projects/packages/premium-analytics/changelog/update-pa-generic-empty-state-charts |
Documents the package change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
louwie17
left a comment
There was a problem hiding this comment.
Thanks @Nikschavan, this tested well and code looks good! On a local Docker site with January 2005 selected, Devices and Top platforms now show the magnifier and "We couldn’t find results for this time period." next to the list widgets, and switching back to the last 30 days draws the charts again. Our site 403s the devices endpoints, so I stubbed those responses in the browser to get both the empty and the data case.
One small heads-up, not a blocker: #52795 touches the same email timeline, subscribers chart and WordAds lines, and it adds two new tests to total views/visitors that still expect "No views in this period." / "No visitors in this period.". Whichever lands second will need those assertions switched to the generic copy, even if the rebase itself goes through cleanly. Also, once #52795 moves the email timeline's period case into the chart, the hasSelection ? undefined : … branch here only ever sees the no-selection side, so we could simplify it to always pass the prompt then. Fine as a follow up.
LGTM 🚀
88a2741 to
7bbf5a2
Compare
Chart widgets had their own message and icon for a period with no data, like the list widgets did before. Devices, top platforms, popular days and hours, the WordAds chart, total views and visitors, the subscribers chart and the email timeline now fall through to the same magnifier and "We couldn’t find results for this time period." The email timeline keeps its "Open an email report…" prompt for when no email is picked. Part of WOOA7S-2209.
Site owners read the plugin changelogs, not the package one, so the entry also goes to each plugin that ships Premium Analytics.
Since #52717, wpcomsh no longer ships the Premium Analytics package; the Jetpack entry covers WoA sites.
7bbf5a2 to
0943731
Compare
…isitors tests Trunk replaced the per-widget empty copy with the shared "We couldn’t find results for this time period." message in #52794, so the zero-filled range tests now look for that text.
…isitors tests Trunk replaced the per-widget empty copy with the shared "We couldn’t find results for this time period." message in #52794, so the zero-filled range tests now look for that text.

Fixes WOOA7S-2209
Proposed changes
emptycopy and icon and fall through to the generic state fromChartEmptyState.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
update/pa-generic-empty-state-charts.I checked Devices and the list widgets on the Traffic tab of my local site with an empty period and with data. I did not check popular days, popular hours, the WordAds chart or the email timeline in a browser; unit tests cover popular days and hours and both email timeline cases, and the WordAds chart only has its story.