Skip to content

WOOA7S-2209: Premium Analytics: Show the generic empty state in chart widgets - #52794

Merged
Nikschavan merged 4 commits into
update/pa-generic-period-empty-statefrom
update/pa-generic-empty-state-charts
Sep 28, 2026
Merged

Nikschavan merged 4 commits into
update/pa-generic-period-empty-statefrom
update/pa-generic-empty-state-charts

Conversation

@Nikschavan

Copy link
Copy Markdown
Member

Fixes WOOA7S-2209

Proposed changes

  • WOOA7S-2209: Premium Analytics: Show one generic empty state in list widgets #52791 gave the list widgets one generic state for a period with no data, but the chart widgets still show their own message and icon ("No device data in this period.", "No views in this period.", and so on). This brings them to the same magnifier and "We couldn’t find results for this time period."
  • Devices, top platforms, popular days, popular hours, the WordAds chart, total views, total visitors and the subscribers chart drop their own empty copy and icon and fall through to the generic state from ChartEmptyState.
  • The email timeline drops its period copy but keeps the "Open an email report to see its timeline here." prompt for when no email is picked, since that is a different case.
  • Total views, total visitors, the subscribers chart and the email timeline get zero-filled days back from the API for an empty period, so on real data they keep drawing a flat line until WOOA7S-2210 changes when they count as empty. The copy change here is still correct for them; it shows once that lands.
  • The Insights "Most popular time" and "Most popular day" tiles are different widgets and are not touched.

Related product discussion/links

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

No.

Testing instructions

  • Get this branch onto a site with Stats data and the Premium Analytics dashboard enabled, either a Jurassic Ninja site with the branch synced or the Jetpack Beta Tester plugin pointed at update/pa-generic-empty-state-charts.
  • Open the Stats v2 dashboard on the Traffic tab and set a custom period from before the site had any traffic, for example January 2005.
  • Devices and Top platforms should show the magnifier with "We couldn’t find results for this time period.", like the list widgets beside them.
  • If your dashboard has Popular days, Popular hours or the WordAds chart, check that they show the same state.
  • Switch back to a period with data and check that the charts draw again.
Before After
Devices shows its own device icon and "No device data in this period." next to list widgets that already show the generic state Devices shows the same magnifier and "We couldn’t find results for this time period." as the list widgets
With #52791 only, Devices keeps its own message. Devices matches the list widgets.

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.

@github-actions

github-actions Bot commented Sep 25, 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-generic-empty-state-charts branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/pa-generic-empty-state-charts

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 Sep 25, 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: October 6, 2026

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

jp-launch-control Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

No summary data is available for parent commit 99fb697, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for 99fb697 is available.

Full summary · PHP report · JS report

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Low severity

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.

@github-actions github-actions Bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Plugin] Wpcomsh labels Sep 25, 2026
@Nikschavan
Nikschavan marked this pull request as ready for review September 25, 2026 10:37
@Nikschavan
Nikschavan requested a review from a team as a code owner September 25, 2026 10:37
@Nikschavan Nikschavan added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Sep 25, 2026
@Nikschavan
Nikschavan added this pull request to stack #52798 September 25, 2026 10:39
louwie17
louwie17 previously approved these changes Sep 25, 2026

@louwie17 louwie17 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🚀

@Nikschavan
Nikschavan force-pushed the update/pa-generic-empty-state-charts branch 2 times, most recently from 88a2741 to 7bbf5a2 Compare September 28, 2026 01:38
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.
@Nikschavan
Nikschavan force-pushed the update/pa-generic-empty-state-charts branch from 7bbf5a2 to 0943731 Compare September 28, 2026 03:26
@Nikschavan
Nikschavan merged commit 2f168fd into trunk Sep 28, 2026
79 of 80 checks passed
@Nikschavan
Nikschavan deleted the update/pa-generic-empty-state-charts branch September 28, 2026 04:38
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Review This PR is ready for review. labels Sep 28, 2026
Nikschavan added a commit that referenced this pull request Sep 28, 2026
…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.
Nikschavan added a commit that referenced this pull request Sep 28, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Status] UI Changes Add this to PRs that change the UI so documentation can be updated.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants