WOOA7S-2210: Premium Analytics: Show the no-results state in four more chart widgets - #52868
Conversation
Post views, Author performance, Video views and Store performance pass MetricTabsChart no empty prop, so a period with no data still draws a flat zero line. Pass ChartEmptyState, as the traffic chart does.
|
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! |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the three test reliability findings and add the required paired plugin changelog entries.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates four Premium Analytics widgets to show an in-chart no-results state for empty periods while preserving headline metrics.
Changes:
- Enables
ChartEmptyStatefor four chart widgets. - Adds empty-period test coverage.
- Adds a Premium Analytics changelog entry.
| File | Summary | Review notes |
|---|---|---|
projects/packages/premium-analytics/widgets/video-detail-views-performance/render.tsx |
Enables the chart empty state. | — |
projects/packages/premium-analytics/widgets/video-detail-views-performance/__tests__/video-detail-views-performance.test.tsx |
Tests no-results messaging. | Moderate (1 vote): configure fake timers for findByText. |
projects/packages/premium-analytics/widgets/store-performance/render.tsx |
Enables the chart empty state. | — |
projects/packages/premium-analytics/widgets/store-performance/__tests__/render.test.tsx |
Tests empty store data handling. | — |
projects/packages/premium-analytics/widgets/post-views/render.tsx |
Enables the chart empty state. | — |
projects/packages/premium-analytics/widgets/post-views/__tests__/post-views.test.tsx |
Tests no-results messaging. | Moderate (1 vote): configure fake timers for findByText. |
projects/packages/premium-analytics/widgets/author-performance/render.tsx |
Enables the chart empty state. | — |
projects/packages/premium-analytics/widgets/author-performance/__tests__/author-performance.test.tsx |
Tests no-results messaging. | Moderate (1 vote): configure fake timers for findByText. |
projects/packages/premium-analytics/changelog/update-pa-chart-empty-state-detail-widgets |
Documents the user-visible change. | Nit (4 votes): add paired plugin changelog entries. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Dashboard: Show the no-results message in the Post views, Author performance, Video views and Store performance charts for a period with no data, instead of a flat zero line. |
Code Coverage SummaryCoverage changed in 2 files.
|

Fixes WOOA7S-2210
Proposed changes
MetricTabsChartto an in-chart no-results message, but four of them never got theemptyprop: Post views, Author performance, Video views and Store performance. Their data is zero-filled per bucket, and theirisEmptyonly checks for a missing post, author or video, so a period with no data still drew a flat line at zero.ChartEmptyStatethe same way the Traffic chart does. The headline tab keeps its 0, and the chart area shows the magnifier and "We couldn’t find results for this time period.".MetricTabsCharttreats both the same way, so the message covers either response.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
wooa7s-2210-chart-empty-state-detail-widgets.I checked Post views on my local site. Author performance, Video views and Store performance are covered by unit tests that fail without the new prop.