WOOA7S-1508: Port Stats Most popular time widget#50154
Draft
kangzj wants to merge 2 commits into
Draft
Conversation
Ports the Jetpack Stats "Most popular time" highlight into a registered jpa/most-popular-time widget: the peak hour for views and its share, above a bar chart of views across the day. Data comes from the useStatsInsights hook; the insights endpoint has no date range or comparison period.
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. 🤷 |
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-1508
Proposed changes
jpa/most-popular-time, categorystats, framed presentation).<Text>, share viaMetricWithComparisonvalue-only), above a bar chart of views across the day rendered with the toolkitBarChart.useStatsInsightshook (stats/insightsproxy). The insights endpoint reports across the whole lifetime of the site, so there is no date range and no comparison period —WithComparisonrenders identically toDefault, which the story documents.WidgetRoot,WidgetLoadingOverlayonly when loading with no data, host-owned chrome (no body heading), all strings through__( …, 'jetpack-premium-analytics' ), CSS Modules with--wpds-*tokens only, and the picker-preview aspect-ratio block.Default,WithComparison,WidgetDashboardWithWidget) per the AGENTS.md template. Central mocks don't coverstats/insights, so a story-scopedapiFetchmiddleware mocks it inside the story file (the sharedregister-report-mocksis untouched).Scope is additive only: the new
widgets/most-popular-time/**folder plus a changelog entry. The Storybook widgets root is already registered inprojects.js.Related product discussion/links
Does this pull request change what data or activity we track or use?
No. It reuses the existing
stats/insightsproxy endpoint via the existinguseStatsInsightsdata hook; no new tracking.Testing instructions
Defaultshows the peak-hour highlight, its share of views, and the hourly bar chart.WithComparisonrenders identically (insights has no comparison period).WidgetDashboardWithWidgetrenders the widget in the real dashboard chrome (framed card).pnpm exec eslint(clean),stylelint(clean),tsc --noEmit(clean),jetpack build packages/premium-analytics --deps(succeeds), and/widget-audit most-popular-time(no violations).