Premium Analytics: align Posts report with legacy Stats#50746
Premium Analytics: align Posts report with legacy Stats#50746Nikschavan wants to merge 5 commits into
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
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. 🤷 |
|
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! |
787fca3 to
196bc37
Compare
There was a problem hiding this comment.
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
omitDerivedDayssupport to drop the deriveddaysparam (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. |
680d10e to
7e737cd
Compare
Fixes WOOA7S-1778
Proposed changes
daysparameter.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
stats/top-postsandstats/archivesrequests and confirm they useperiod=day,start_date,date,max=0, andsummarize=1withoutdays; confirm the posts request also usesskip_archives=1.pnpm --dir projects/packages/premium-analytics typecheck.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.