Skip to content

Premium Analytics: unify the no-comparison surfaces on one declaration - #51382

Open
chihsuan wants to merge 6 commits into
wooa7s-1964-comparison-scopefrom
wooa7s-1964-report-scope-unification
Open

Premium Analytics: unify the no-comparison surfaces on one declaration#51382
chihsuan wants to merge 6 commits into
wooa7s-1964-comparison-scopefrom
wooa7s-1964-report-scope-unification

Conversation

@chihsuan

Copy link
Copy Markdown
Member

Stacked on #51381review that one first; this PR targets its branch, so the diff here is only the refactor.

Related to WOOA7S-1964.

Proposed changes

Every analytics surface answers the same question twice: does the header show the comparison control, and do the comparison params reach the things that fetch? Each route hardcoded both answers separately, which is how the dashboard came to answer the first and forget the second (the defect #51381 fixes). This collapses all of them onto the one declaration that PR introduced.

  • Mount ReportScopeProvider once per route: the /reports/$report dispatcher, post detail, video detail.
  • DateFiltersPanel reads the scope; the showComparison prop is gone, along with its four call sites.
  • useReportParams reads the scope instead of calling withoutComparison() unconditionally.
  • Delete the layout-attribute injection in both detail pages — WidgetRoot already strips from the scope, and injected attributes travelling with a layout was a standing hazard.

No behavior change. Comparison params stay on the URL on every surface, exactly as before.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

This is a pure refactor, so the interesting check is that nothing moved:

  • On Reports, post detail, and video detail: confirm no Compare control in the header, and no period-over-period deltas in any widget or table.
  • Pick a comparison on the dashboard's Traffic section, then visit each of those three pages and come back. The comparison should still be applied — the params ride along on the URL.
  • On the dashboard's Traffic section, confirm the Compare control still works and widgets still render deltas.
  • On Insights, confirm there is still no Compare control and no deltas.

@github-actions

github-actions Bot commented Aug 19, 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 wooa7s-1964-report-scope-unification branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack wooa7s-1964-report-scope-unification
bin/jetpack-downloader test jetpack-mu-wpcom-plugin wooa7s-1964-report-scope-unification

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

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!

@jp-launch-control

jp-launch-control Bot commented Aug 19, 2026

Copy link
Copy Markdown

Code Coverage Summary

No summary data is available for parent commit 8a25acd, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for 8a25acd is available.

Full summary · PHP report · JS report

@chihsuan
chihsuan force-pushed the wooa7s-1964-report-scope-unification branch from 8895b0a to e53803a Compare August 19, 2026 08:06
@chihsuan
chihsuan marked this pull request as ready for review August 19, 2026 08:25
@chihsuan
chihsuan requested a review from a team as a code owner August 19, 2026 08:25
@chihsuan chihsuan added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant