WOOA7S-1500: Port Stats Tags & categories widget#50147
Draft
kangzj wants to merge 3 commits into
Draft
Conversation
Port the Jetpack Stats "Tags and categories" module into a registered Premium Analytics dashboard widget. Renders the most viewed tags and categories for the selected period as a leaderboard sourced from useStatsTags; single tags/categories link to their archive while grouped rows render as plain text. The Stats tags endpoint has no comparison period, so the widget renders single-period values only.
Contributor
|
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! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
Add a widget-scoped apiFetch middleware that serves a realistic raw stats/tags response so the Default, WithComparison, and WidgetDashboardWithWidget stories render a populated leaderboard instead of the empty state. Include a grouped (multi-tag) row so the plain-text path is exercised alongside linked rows. Wrap the widget body in a styles.root element so the picker-preview aspect-ratio rule has an element to attach to.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes WOOA7S-1500
Proposed changes
jpa/tags-categories).useStatsTagsin@jetpack-premium-analytics/data.max = 0shows all rows, loading overlay only when there is no data yet, counts formatted with multipliers, and the widget renders body only (host owns the chrome).tagsendpoint has no comparison period, so the widget renders single-period values only; theWithComparisonstory documents that the module has no comparison data to display.Related product discussion/links
Does this pull request change what data or activity we track or use?
No. It reuses the existing Stats
tagsproxy endpoint via the shared data hook; no new tracking.Testing instructions
Packages/Premium Analytics/Widgets/TagsCategories.pnpm exec eslint projects/packages/premium-analytics/widgets/tags-categories— clean.jetpack build packages/premium-analytics(with dependencies built) — succeeds.