Skip to content

WOOA7S-1696: Premium Analytics: show nested rows and deltas in the Referrers report#50747

Open
Nikschavan wants to merge 5 commits into
trunkfrom
update/wooa7s-1696-referrers-report
Open

WOOA7S-1696: Premium Analytics: show nested rows and deltas in the Referrers report#50747
Nikschavan wants to merge 5 commits into
trunkfrom
update/wooa7s-1696-referrers-report

Conversation

@Nikschavan

@Nikschavan Nikschavan commented Jul 22, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • Remove the performance chart from the Referrers report.
  • Match the detailed Calypso Referrers request by summarizing the selected day range, requesting all rows, and omitting the generic days parameter.
  • Render referrer groups, sources, and domains as nested rows in the shared drilldown table.
  • Show Views comparison deltas when comparison is enabled, while preserving favicons, safe links, error handling, and accessible group context.
Google Chrome -2026-07-24 at 18 38 28@2x

Related product discussion/links

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

No. It changes how existing Stats referrer data is requested and displayed; it does not add or change tracking.

Testing instructions

  • Build Premium Analytics and open Analytics → Referrers.
  • Select a date preset and enable comparison.
  • Verify the page has no chart and the table shows Referrer and Views columns.
  • Verify group, source, and domain rows retain their nested indentation without visible dash markers.
  • Verify comparison deltas appear beside Views and referrer favicons and safe external links still work.
  • Search for a nested domain and verify its ancestor rows remain visible.
  • Automated verification: 79 affected Jest suites (541 tests), TypeScript, ESLint, stylelint, package build, and plugin build pass.

@Nikschavan Nikschavan added the Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Jul 22, 2026
@Nikschavan Nikschavan self-assigned this Jul 22, 2026
@github-actions

github-actions Bot commented Jul 22, 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 (WordPress.com Site Helper), and enable the update/wooa7s-1696-referrers-report branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/wooa7s-1696-referrers-report

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

@jp-launch-control

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

@github-actions

github-actions Bot commented Jul 22, 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!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jul 22, 2026
@Nikschavan
Nikschavan force-pushed the update/wooa7s-1696-referrers-report branch from a2b6eaa to 386e060 Compare July 23, 2026 06:49
@Nikschavan
Nikschavan marked this pull request as ready for review July 23, 2026 06:52
@Nikschavan
Nikschavan requested review from a team as code owners July 23, 2026 06:52
Copilot AI review requested due to automatic review settings July 23, 2026 06:52
@Nikschavan Nikschavan added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Jul 23, 2026

Copilot AI 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.

Pull request overview

Updates the Premium Analytics Referrers report to align more closely with Calypso’s detailed referrers experience by changing both the Stats request shape and how results are rendered in the report table.

Changes:

  • Replace the Referrers report chart + flat records table with a nested (native DataViews hierarchy) drilldown table.
  • Change the referrers Stats query/request to summarize explicit date ranges (and omit the generic days param) while requesting all rows for client-side table interactions.
  • Surface comparison deltas in the Views column and preserve safe external linking + favicon handling for referrer leaves.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
projects/packages/premium-analytics/routes/reports/referrers/page.tsx Removes the performance chart and switches the report body to ReportDrilldownTable with native hierarchy configuration.
projects/packages/premium-analytics/routes/reports/referrers/config/use-report-records.ts Updates the referrers request params (summarized range, all rows) and derives hierarchical rows from merged comparison rows.
projects/packages/premium-analytics/routes/reports/referrers/config/use-report-records.test.ts Reworks tests to validate the new summarized request and parent-linked hierarchical rows output.
projects/packages/premium-analytics/routes/reports/referrers/config/index.ts Removes unused aggregate/time-series exports; keeps only the hierarchy flattener export.
projects/packages/premium-analytics/routes/reports/referrers/config/fields.tsx Updates table fields to support nested rows, safe leaf linking with accessible parent context, favicon handling, and views deltas.
projects/packages/premium-analytics/routes/reports/referrers/config/fields.test.tsx Adds coverage for parent-context announcements, group-row non-linking, favicon error handling, and views delta rendering.
projects/packages/premium-analytics/routes/reports/referrers/config/fields.module.css Adds favicon sizing/styling for the referrer label cell.
projects/packages/premium-analytics/routes/reports/referrers/config/aggregate.ts Replaces bucket-aggregation/time-series helpers with a depth-first hierarchical flattener for DataViews native levels.
projects/packages/premium-analytics/routes/reports/referrers/config/aggregate.test.ts Updates tests to validate stable parent IDs, depth-first order, and icon inheritance across hierarchy levels.
projects/packages/premium-analytics/packages/ui/src/dataviews-drilldown-native/drilldown-leaf-cell.module.scss Adjusts link styling override to fix layout without forcing link color/decoration.
projects/packages/premium-analytics/packages/data/src/queries/stats-referrers-query.ts Configures the referrers query factory to omit days to match Calypso’s explicit-range request style.
projects/packages/premium-analytics/packages/data/src/queries/stats-query.ts Adds per-endpoint query settings to omit derived params when building Stats proxy queries.
projects/packages/premium-analytics/packages/data/src/queries/tests/stats-queries.test.ts Adds a regression test ensuring the referrers query key params match the Calypso-style range request (no days).
projects/packages/premium-analytics/changelog/update-wooa7s-1696-referrers-report Adds a changelog entry describing the report UI change (nested rows + deltas, chart removal).

# Conflicts:
#	projects/packages/premium-analytics/packages/ui/src/dataviews-drilldown-native/__tests__/process-hierarchy-levels.test.ts
#	projects/packages/premium-analytics/packages/ui/src/dataviews-drilldown-native/dataviews-drilldown-native.tsx
#	projects/packages/premium-analytics/packages/ui/src/dataviews-drilldown-native/process-hierarchy-levels.ts
#	projects/packages/premium-analytics/routes/reports/referrers/config/fields.module.css
#	projects/packages/premium-analytics/routes/reports/referrers/config/fields.tsx
#	projects/packages/premium-analytics/routes/reports/referrers/config/use-report-records.ts
#	projects/packages/premium-analytics/routes/reports/referrers/page.tsx
@Nikschavan
Nikschavan force-pushed the update/wooa7s-1696-referrers-report branch from 5caa615 to 13f5440 Compare July 24, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Package] Premium Analytics [Status] In Progress [Status] Needs Review This PR is ready for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants