Premium Analytics: offer the whole period menu on the post and video detail pages - #52087
Conversation
The post and video detail pages narrowed the date picker to all time and four rolling windows. That list was drawn for the segmented pill row the dropdown replaced, where the row's width bounded what could fit; a menu has no such bound, and the list was never revisited. Today, Yesterday and the rest have been on the dashboard menu since it landed. DETAIL_SURFACE_PRESETS is now the menu's own list plus all time, which a detail page can anchor on the resource's publish date, and Custom range comes back with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015eDqAWndvFNBrBRdKcsYus
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
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! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
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. |
`toMatchObject` ignores a key it is not given, so re-adding `withCustomRange: false` would have hidden Custom range on both detail pages with this test still passing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015eDqAWndvFNBrBRdKcsYus
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. 🤷 |
0d3a1da to
47a5111
Compare
retrofox
left a comment
There was a problem hiding this comment.
LGTM. Thanks, Lourens 🚢
Fixes UNI-754
Proposed changes
The post and video detail pages offered five periods where the dashboard offered eleven. This gives them the same menu.
DETAIL_SURFACE_PRESETSis now the menu's own list plus all time, which a detail page can still anchor on the resource's publish date. The narrow list was drawn for the segmented pill row that Premium Analytics: add the date period dropdown #51835 / Premium Analytics: render the period dropdown in the date filters panel #51842 replaced with a dropdown, where the row's width bounded what could fit; a menu has no such bound, and the list was never revisited. Today and Yesterday have been on the dashboard menu since it landed.withCustomRange: falsegoes.A deep link naming a period the page did not offer, e.g.
&preset=last-90-days, also stops falling back to a bare date range on the trigger — the period now names itself.Screenshots
Post detail, period menu open:
Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Build the dashboard:
jetpack build --deps packages/premium-analytics, then open Premium Analytics (wp-admin/admin.php?page=jetpack-premium-analytics-wp-admin).On a post's detail page (from Top posts) and a video's (from the VideoPress widget):
&preset=last-90-daysin thepparam: the trigger reads "Last 90 days" rather than a date range.pnpm run testinprojects/packages/premium-analyticspasses (3175 tests), as doespnpm run test-tz.🤖 Generated with Claude Code
https://claude.ai/code/session_015eDqAWndvFNBrBRdKcsYus