Skip to content

Premium Analytics: remove the Videos report performance chart - #50801

Merged
Nikschavan merged 4 commits into
trunkfrom
codex/remove-report-performance-chart-videos
Jul 29, 2026
Merged

Premium Analytics: remove the Videos report performance chart#50801
Nikschavan merged 4 commits into
trunkfrom
codex/remove-report-performance-chart-videos

Conversation

@Nikschavan

@Nikschavan Nikschavan commented Jul 24, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • Remove the performance chart and its chart-only aggregation from the Videos report.
  • Show comparison changes for Plays and Impressions in the records table when report comparison is enabled.
  • Preserve video-detail links by enriching complete-stats rows from the primary daily response.
Google Chrome -2026-07-28 at 19 00 39@2x

Related product discussion/links

  • None.

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

No.

Testing instructions

  • Build Premium Analytics and its dependencies with fnm exec --using=24.15.0 pnpm jetpack build plugins/premium-analytics --deps.
  • Open Premium Analytics and navigate to the Videos report.
  • Select a date range without comparison and verify the records table shows video titles, Plays, and Impressions without a performance chart or comparison deltas.
  • Enable date comparison and verify matching videos show change values for both Plays and Impressions.
  • Verify linked video titles still open their video detail pages with the selected date window.
  • Automated verification completed: 24 focused Jest tests, ESLint, Prettier, package typecheck, package build, and the full dependency-stack build.

@Nikschavan Nikschavan added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] In Progress [Package] Premium Analytics labels Jul 24, 2026
@Nikschavan Nikschavan self-assigned this Jul 24, 2026
@github-actions

github-actions Bot commented Jul 24, 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 codex/remove-report-performance-chart-videos branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack codex/remove-report-performance-chart-videos
bin/jetpack-downloader test jetpack-mu-wpcom-plugin codex/remove-report-performance-chart-videos

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 Jul 24, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 3 files.

File Coverage Δ% Δ Uncovered
projects/packages/premium-analytics/routes/reports/videos/config/fields.tsx 12/13 (92.31%) 0.64% 0 💚
projects/packages/premium-analytics/routes/reports/videos/config/use-report-records.ts 5/5 (100.00%) 3.23% -1 💚
projects/packages/premium-analytics/routes/reports/videos/page.tsx 21/22 (95.45%) 12.12% -4 💚

Full summary · PHP report · JS report

@Nikschavan
Nikschavan force-pushed the codex/remove-report-performance-chart-videos branch 2 times, most recently from 37620ed to d0ba0f3 Compare July 27, 2026 04:35
@Nikschavan
Nikschavan requested a review from Copilot July 27, 2026 11:32

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

This PR updates the Premium Analytics Videos report to remove the performance chart and rely solely on a comparison-aware records table backed by the complete-stats summary request, while preserving video-detail linking and enabling plays/impressions deltas when comparison rows match.

Changes:

  • Remove the Videos report performance chart (and its chart-specific aggregation / interval handling) and render only the records table.
  • Switch the Videos report data source to a single comparison-aware complete-stats summary request; enrich comparison rows to include both previousPlays and previousImpressions.
  • Update the table fields to render metric deltas via MetricWithComparison, and adjust/add Jest tests accordingly.

Reviewed changes

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

Show a summary per file
File Description
projects/packages/premium-analytics/routes/reports/videos/page.tsx Removes the performance chart and renders a comparison-aware records table with stable row IDs.
projects/packages/premium-analytics/routes/reports/videos/page.test.tsx Updates page tests for chart removal, comparison-enabled fields, and table loading behavior during fetches.
projects/packages/premium-analytics/routes/reports/videos/config/use-report-records.ts Refactors the report hook to use a single complete-stats summary request via useStatsVideoPlays.
projects/packages/premium-analytics/routes/reports/videos/config/use-report-records.test.ts Reworks hook tests to validate complete-stats request params, comparison metrics, loading/fetching, and refetch/error behavior.
projects/packages/premium-analytics/routes/reports/videos/config/index.ts Removes now-obsolete exports tied to the deleted chart aggregation logic.
projects/packages/premium-analytics/routes/reports/videos/config/fields.tsx Adds optional comparison rendering for Plays/Impressions using MetricWithComparison.
projects/packages/premium-analytics/routes/reports/videos/config/fields.test.tsx Extends field tests to cover metric deltas and comparison-disabled behavior.
projects/packages/premium-analytics/routes/reports/videos/config/aggregate.ts Removes chart aggregation helpers no longer needed after chart removal.
projects/packages/premium-analytics/routes/reports/videos/config/aggregate.test.ts Removes tests that only validated the deleted chart aggregation behavior.
projects/packages/premium-analytics/packages/data/src/queries/stats-video-plays-summary-query.ts Adjusts the summary query param shape to match legacy request expectations (notably excluding days).
projects/packages/premium-analytics/packages/data/src/queries/tests/stats-queries.test.ts Updates query-factory expectations for the new legacy-compatible summary request params.
projects/packages/premium-analytics/packages/data/src/processing/stats/video-plays.ts Extends merged comparison rows to include previousImpressions alongside previousPlays.
projects/packages/premium-analytics/packages/data/src/processing/stats/tests/video-plays.test.ts Updates merge tests to validate impressions comparison propagation.
projects/packages/premium-analytics/packages/data/src/hooks/use-stats-video-plays.ts Updates inline documentation to reflect the dedicated legacy-compatible summary request path.
projects/packages/premium-analytics/changelog/remove-report-performance-chart-videos Adds a changelog entry describing the user-facing Videos report change.

@Nikschavan
Nikschavan force-pushed the codex/remove-report-performance-chart-videos branch 3 times, most recently from 487062e to 1dba026 Compare July 28, 2026 11:43
@Nikschavan
Nikschavan marked this pull request as ready for review July 28, 2026 13:30
@Nikschavan
Nikschavan requested review from a team as code owners July 28, 2026 13:30
chihsuan
chihsuan previously approved these changes Jul 29, 2026

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, nice cleanup. Left a few notes but nothing blocking.

Pass the records straight to the table instead of emptying it while fetching. The queries carry placeholderData, so blanking the rows dropped the user's search, sorting and page position on every date or comparison change. The loading state still reflects both isLoading and isFetching.
Report only a primary-query failure as an error. useReport combines both queries, so a comparison-only failure hid the whole table. The table now shows the current-period rows without deltas.

Delete the unused useStatsVideoPlaysSummary hook. The report reads the summary through useStatsVideoPlays. The query and its params type stay, because useStatsVideoPlays still calls the query.
@Nikschavan
Nikschavan force-pushed the codex/remove-report-performance-chart-videos branch from 57b6c83 to f12c063 Compare July 29, 2026 09:27
@Nikschavan
Nikschavan merged commit 44f3a45 into trunk Jul 29, 2026
81 checks passed
@Nikschavan
Nikschavan deleted the codex/remove-report-performance-chart-videos branch July 29, 2026 10:12
@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] In Progress labels Jul 29, 2026
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] 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.

3 participants