Skip to content

Premium Analytics: align Posts report with legacy Stats#50746

Open
Nikschavan wants to merge 5 commits into
trunkfrom
add/wooa7s-1620-posts-pages-report-page
Open

Premium Analytics: align Posts report with legacy Stats#50746
Nikschavan wants to merge 5 commits into
trunkfrom
add/wooa7s-1620-posts-pages-report-page

Conversation

@Nikschavan

@Nikschavan Nikschavan commented Jul 22, 2026

Copy link
Copy Markdown
Member

Fixes WOOA7S-1778

Proposed changes

  • Remove the performance chart from the Posts & Pages report.
  • Match the legacy Calypso Stats requests for posts and archives by using a summarized day range without the derived days parameter.
  • Show the views delta in both Posts & Pages and Archives when comparison is enabled.
  • Use the current shared report date controls, with quick presets on the filter surface and a calendar-only custom picker.
  • Render Archives as Calypso-style nested groups, keeping archive pages sorted by views and using the standard outbound-link treatment.
Google Chrome -2026-07-23 at 12 26 00@2x

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

No. This changes how existing Stats data is requested and displayed; it does not add tracking or collect new data.

Testing instructions

  • Build and activate Premium Analytics, then open Stats → Posts & Pages.
  • Confirm the report does not display a performance chart.
  • Confirm quick date presets appear outside the custom picker and that the custom picker contains no preset shortcuts.
  • Inspect the stats/top-posts and stats/archives requests and confirm they use period=day, start_date, date, max=0, and summarize=1 without days; confirm the posts request also uses skip_archives=1.
  • Enable comparison and confirm views deltas appear in both Posts & Pages and Archives.
  • Open Archives and confirm parent labels such as Tags, Categories, and Authors appear with their archive rows indented beneath them and sorted by views.
  • Confirm the archive rows do not show drill-down em-dash markers.
  • Confirm linked archive pages use the standard new-tab affordance and unsafe URLs render as plain text.
  • Run pnpm --dir projects/packages/premium-analytics typecheck.
  • Run pnpm --dir projects/packages/premium-analytics exec jest --config=tests/jest.config.cjs --runInBand packages/data/src/queries/__tests__/stats-queries.test.ts routes/reports/posts/config/fields.test.tsx routes/reports/posts/config/use-report-records.test.ts routes/reports/posts/page.test.tsx.

@Nikschavan Nikschavan added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. labels 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 add/wooa7s-1620-posts-pages-report-page branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/wooa7s-1620-posts-pages-report-page

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

jp-launch-control Bot commented Jul 22, 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

@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!

@Nikschavan
Nikschavan force-pushed the add/wooa7s-1620-posts-pages-report-page branch 2 times, most recently from 787fca3 to 196bc37 Compare July 23, 2026 06:51
@Nikschavan
Nikschavan marked this pull request as ready for review July 23, 2026 06:51
@Nikschavan
Nikschavan requested a review from a team as a code owner July 23, 2026 06:51
Copilot AI review requested due to automatic review settings July 23, 2026 06:51
@Nikschavan
Nikschavan requested a review from a team as a code owner July 23, 2026 06:51

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

Aligns the Premium Analytics Posts & Pages report behavior and UI with legacy Calypso Stats by simplifying the data request shape, removing the performance chart, and improving comparison + Archives rendering.

Changes:

  • Remove the Posts report performance chart and its URL-driven period handling, leaving a table-only report view.
  • Update Posts/Archives requests to use a summarized day range and add omitDerivedDays support to drop the derived days param (matching legacy Stats requests).
  • Render Archives as a nested (parent/child) drilldown table and show Views deltas in both tabs when comparison is enabled.

Reviewed changes

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

Show a summary per file
File Description
projects/packages/premium-analytics/routes/reports/posts/page.tsx Removes performance chart flow, wires comparison-aware fields, and uses a drilldown table for Archives.
projects/packages/premium-analytics/routes/reports/posts/page.test.tsx Updates page tests to reflect chart removal and verifies drilldown rendering for Archives.
projects/packages/premium-analytics/routes/reports/posts/config/use-report-records.ts Switches to summarized list consumption via merged comparison rows; adds omitDerivedDays and exposes hasComparison per tab.
projects/packages/premium-analytics/routes/reports/posts/config/use-report-records.test.ts Replaces chart-focused tests with request-shape + merged comparison row assertions (posts and archives).
projects/packages/premium-analytics/routes/reports/posts/config/index.ts Updates exports to remove aggregation utilities and expose buildArchiveRows.
projects/packages/premium-analytics/routes/reports/posts/config/fields.tsx Adds comparison-aware Views rendering, switches to standard outbound-link treatment, and builds hierarchical archive rows for drilldown.
projects/packages/premium-analytics/routes/reports/posts/config/fields.test.tsx Extends field tests to cover delta rendering, external-link affordance, unsafe URL handling, and archive hierarchy building.
projects/packages/premium-analytics/routes/reports/posts/config/fields.module.css Removes no-longer-used styles after switching to standard link components.
projects/packages/premium-analytics/routes/reports/posts/config/aggregate.ts Deletes chart/table aggregation utilities now that the report no longer renders a performance chart.
projects/packages/premium-analytics/routes/reports/posts/config/aggregate.test.ts Removes tests for deleted aggregation utilities.
projects/packages/premium-analytics/packages/data/src/queries/stats-query.ts Adds omitDerivedDays param support to remove days from Stats proxy requests when desired.
projects/packages/premium-analytics/packages/data/src/queries/tests/stats-queries.test.ts Adds coverage asserting legacy-like top-posts request params when omitDerivedDays is enabled.
projects/packages/premium-analytics/changelog/update-report-posts-request-comparison Adds changelog entry documenting the Posts report request + UI alignment changes.

@Nikschavan
Nikschavan force-pushed the add/wooa7s-1620-posts-pages-report-page branch from 680d10e to 7e737cd Compare July 24, 2026 12:38
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.

2 participants