Premium Analytics: port Stats Search Terms widget#49985
Conversation
|
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 🤖 🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so: 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! 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 SummaryCoverage changed in 1 file.
Coverage check overridden by
Covered by non-unit tests
|
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
ec5da44 to
ea30566
Compare
Add itemLabel wrapper with padding (mirrors top-platforms pattern) so the overlay bar gets its height from the label element. Pass loading prop and use chart's built-in emptyStateText. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- widget.ts: add `as const` to attributes type field so it narrows to literal 'integer' rather than string (fixes StoryWidgetMetadata mismatch) - use-search-term-views: cast reportParams to StatsReportParams (same pattern as use-location-views) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…is source of truth) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…empty state Remove manual empty/loading early returns that bypassed the header. Use WidgetLoadingOverlay for initial load, and LeaderboardChart's built-in emptyStateText for no-data state (same pattern as top-platforms). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Why
Port the Jetpack Stats Search Terms module into Premium Analytics as a standalone widget (`jpa/search-terms`), closing WOOA7S-1496.
The data layer (`useStatsSearchTerms`, `sanitizeStatsSearchTermsResponse`, fixtures, tests) was already complete on trunk. This PR adds only the widget UI layer.
What
Notes
Search terms data requires organic search traffic from indexed sites. On sites with no search traffic for the selected period, the widget correctly shows an empty state. Selecting a longer date range (e.g. last year) will surface terms if the site has historical search data.
Test plan
🤖 Generated with Claude Code