Repository navigation
Premium Analytics: Add video thumbnails and drop "report" from report headings - #52908
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?
|
|
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! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Wpcomsh plugin:
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. |
Code Coverage SummaryCoverage changed in 9 files. Only the first 5 are listed here.
1 file is newly checked for coverage.
|
- 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.
Nikschavan
left a comment
There was a problem hiding this comment.
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.
| * @param props.children - Renders the title. | ||
| * @return The thumbnail and title. | ||
| */ | ||
| export function ReportThumbnailTitle( { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. | |||
There was a problem hiding this comment.
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.
|
|
||
| fireEvent.error( thumbnail ); | ||
| expect( screen.getByTestId( 'post-thumbnail-placeholder' ) ).toBeInTheDocument(); | ||
| expect( screen.getByTestId( 'report-thumbnail-placeholder' ) ).toBeInTheDocument(); |
There was a problem hiding this comment.
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.

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.
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
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Setup
posterURL on each row.Report headings and export button
Video thumbnails
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.