Skip to content

Premium Analytics: Add video thumbnails and drop "report" from report headings - #52908

Merged
chihsuan merged 5 commits into
trunkfrom
change/reports-titles-video-thumbs
Sep 30, 2026
Merged

chihsuan merged 5 commits into
trunkfrom
change/reports-titles-video-thumbs

Conversation

@chihsuan

@chihsuan chihsuan commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Fixes WOOA7S-2050

Proposed changes

Every report heading ended in "report", the export button only said Download, and the Videos report listed plain titles while Posts & Pages showed thumbnails.

  • Head each report with its name alone. The Videos report now reads Videos, and the Earnings tabs read Earnings history, Sponsored content history and Adjustments history.
  • Rename the export button at the top right of every report to Download CSV.
  • Show a small poster next to each video title in the Videos report, or a video icon when a video has no poster or it fails to load.
  • Load thumbnails at thumbnail size and only as their rows scroll into view.
  • Keep Posts & Pages thumbnails looking the same. Both reports now share one thumbnail layout.

Each heading now matches the name already shown in the breadcrumb or tab, so a report keeps a single name instead of a separate name and heading.

Related product discussion/links

  • WOOA7S-2050
  • Depends on wpcom PR 244946 (STATS-412, stacked on 233172 and 245004), which adds the poster to the video plays rows. Until it is deployed every Videos row shows the video icon, so hold the merge until it is live.
  • Settles the Download CSV placement question from WOOA7S-1921.

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

No.

Testing instructions

Setup

  1. Check out this branch and build Premium Analytics.
  2. Use a site with Stats data and at least one VideoPress video with plays. Until wpcom PR 244946 is deployed, posters only appear if you fake the video plays response to include a poster URL on each row.

Report headings and export button

  1. Open Stats v2 and open the Videos report from the Top videos card. Confirm the heading reads Videos, not "Videos report".
  2. Open the Posts & Pages, Locations and UTM reports and switch between their tabs. Confirm no heading ends in "report".
  3. Confirm the button at the top right reads Download CSV on each report, and clicking it still downloads the CSV.

Video thumbnails

  1. Open the Videos report. Confirm each video with a poster shows it as a small square next to its title.
  2. Confirm a video without a poster, or with a poster that fails to load, shows a video icon instead, and its title still opens the video detail page.
  3. Change the table density from the settings cog. Confirm the thumbnails resize with the rows.
  4. Open Posts & Pages. Confirm post thumbnails and the post and page icons look the same as on trunk.

Screenshot

The Videos report with a faked video plays response: three rows carry a poster, Customer story: Acme has a poster that fails to load, and Release notes 4.2 has none, so both show the video icon. The columns and date picker are unchanged.

Videos report with poster thumbnails, the Videos heading and the Download CSV button

@github-actions

github-actions Bot commented Sep 29, 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), and enable the change/reports-titles-video-thumbs branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack change/reports-titles-video-thumbs

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 github-actions Bot added [Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Plugin] Wpcomsh Docs labels Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Premium Analytics plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

jp-launch-control Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 9 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/premium-analytics/routes/reports/comments/config/tabs.ts 5/7 (71.43%) -28.57% 2 ❤️‍🩹
projects/packages/premium-analytics/packages/routing/src/tabs/define-report-tabs.ts 9/9 (100.00%) 0.00% 0 💚
projects/packages/premium-analytics/routes/reports/earnings/config/tabs.ts 10/10 (100.00%) 0.00% 0 💚
projects/packages/premium-analytics/routes/reports/locations/config/tabs.ts 10/10 (100.00%) 0.00% 0 💚
projects/packages/premium-analytics/routes/reports/posts/config/fields.tsx 54/58 (93.10%) -0.34% 0 💚

1 file is newly checked for coverage.

File Coverage
projects/packages/premium-analytics/packages/widgets-toolkit/src/components/report-page/report-thumbnail-title.tsx 4/4 (100.00%) 💚

Full summary · PHP report · JS report

- Report and tab headings now read the label directly, so the mirrored
  getTitle strings, getTabTitle and the report-names test are gone.
- ReportThumbnailTitle hands the title link its class names through a render
  prop instead of exporting them, lazy-loads the thumbnail, and has its own
  test covering the retry after a failed URL changes.
- Video posters are requested from Photon at 80x80 instead of full size.
- Drop the wpcomsh changelog entry: wpcomsh no longer bundles the package.
@chihsuan
chihsuan marked this pull request as ready for review September 29, 2026 08:16
@chihsuan
chihsuan requested a review from a team as a code owner September 29, 2026 08:16
@chihsuan chihsuan added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Sep 29, 2026
Nikschavan
Nikschavan previously approved these changes Sep 29, 2026

@Nikschavan Nikschavan 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.

Thank you, the changes look good. I left one question inline about using the DataViews mediaField for the thumbnails, and two small notes on the tests.

I checked the Posts & Pages report with this branch. The heading reads "Posts & Pages", the button reads "Download CSV", and the rows without a thumbnail show the post icon. I did not check the Videos report in a browser, because my test site has no VideoPress.

Posts & Pages heading, Download CSV button, icon placeholders

* @param props.children - Renders the title.
* @return The thumbnail and title.
*/
export function ReportThumbnailTitle( {

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.

The DataViews table layout already renders a thumbnail beside the title through view.mediaField (column-primary.tsx, and in the table story), and ReportRecordsTable already keeps mediaField out of the column list. A custom render on that field could keep the icon fallback, so the one difference I can find is the density sizing: the core box stays 32px in every density. Could Posts & Pages and Videos use mediaField instead of a second thumbnail slot in the toolkit, with density-aware sizing proposed upstream if the team wants it? Fine as a follow-up if you want to keep this one small.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good question, opened WOOA7S-2237 for it since titleField would bold the titles and needs a design call.

@@ -23,7 +23,7 @@ jest.mock( './config', () => ( {
],
getCommentsReportTabs: () => [ { id: 'authors', label: 'Authors' } ],
// No tab declares a heading yet, so the real helper reads the label back.

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.

This comment still describes the removed getTitle fallback. The mock is now getTabLabel itself, so there is no heading left for a tab to declare.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch, removed in 3cf572e.


fireEvent.error( thumbnail );
expect( screen.getByTestId( 'post-thumbnail-placeholder' ) ).toBeInTheDocument();
expect( screen.getByTestId( 'report-thumbnail-placeholder' ) ).toBeInTheDocument();

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.

Now that the fallback lives in ReportThumbnailTitle, this error case covers the same behavior as the component's own load-failure test, and removing onError turns both red. The undefined poster case in the videos field test repeats the component's no-thumbnail test in the same way. The route tests could assert only the URL and icon each route passes in. This does not block the merge.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point, trimmed both in 3cf572e.

@chihsuan
chihsuan merged commit 7e365ae into trunk Sep 30, 2026
86 checks passed
@chihsuan
chihsuan deleted the change/reports-titles-video-thumbs branch September 30, 2026 02:50
@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] Needs Review This PR is ready for review. [Status] In Progress labels Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs [Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics [Plugin] Wpcomsh [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants