Skip to content

Premium Analytics: offer the whole period menu on the post and video detail pages - #52087

Merged
louwie17 merged 2 commits into
trunkfrom
add/uni-754-detail-date-presets
Sep 9, 2026
Merged

Premium Analytics: offer the whole period menu on the post and video detail pages#52087
louwie17 merged 2 commits into
trunkfrom
add/uni-754-detail-date-presets

Conversation

@louwie17

@louwie17 louwie17 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

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.

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:

Before After

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):

  • Open the period dropdown. It lists Today · Yesterday · Last 24 hours · Last 7 days · Last 30 days · Last 90 days · Last 365 days · Last month · Last 12 months · Last year · All time · Custom range — the dashboard's own menu, with All time last and Custom range under it.
  • Today and Yesterday resolve to that single day; the header reads "Performance from … to …" accordingly.
  • Pick Custom range: the calendar opens beside the list, and Apply commits it.
  • All time still starts on the post's publish / video's upload day, and still survives a reload.
  • Load the page with &preset=last-90-days in the p param: the trigger reads "Last 90 days" rather than a date range.
  • The dashboard is unchanged.

pnpm run test in projects/packages/premium-analytics passes (3175 tests), as does pnpm run test-tz.

🤖 Generated with Claude Code

https://claude.ai/code/session_015eDqAWndvFNBrBRdKcsYus

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
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the add/uni-754-detail-date-presets branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/uni-754-detail-date-presets
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/uni-754-detail-date-presets

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

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:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

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
@jp-launch-control

jp-launch-control Bot commented Sep 8, 2026

Copy link
Copy Markdown

Code Coverage Summary

This 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. 🤷

Full summary · PHP report · JS report

@louwie17
louwie17 force-pushed the add/uni-754-detail-date-presets branch from 0d3a1da to 47a5111 Compare September 8, 2026 14:53
@louwie17 louwie17 changed the title Premium Analytics: offer the whole period menu on the detail pages, and add Month/Year to date Premium Analytics: offer the whole period menu on the post and video detail pages Sep 8, 2026
@louwie17
louwie17 marked this pull request as ready for review September 8, 2026 15:12
@louwie17
louwie17 requested a review from a team as a code owner September 8, 2026 15:12
@louwie17
louwie17 requested a review from a team September 8, 2026 15:12

@retrofox retrofox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks, Lourens 🚢

@retrofox retrofox added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Sep 8, 2026
@louwie17
louwie17 merged commit b6d9c2a into trunk Sep 9, 2026
84 checks passed
@louwie17
louwie17 deleted the add/uni-754-detail-date-presets branch September 9, 2026 07:07
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Review This PR is ready for review. labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Status] UI Changes Add this to PRs that change the UI so documentation can be updated.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants