Repository navigation
PA - VideoPress: let the package own the Top videos widget - #52909
Conversation
the default-layout policy asks the widget registry once it can answer
phan cannot see past the finally
…ity-videopress-layout-validation # Conflicts: # projects/packages/premium-analytics/docs/dashboard-widgets.md
a renamed type keeps the layouts saved under its old name; contract 1.1.0
a Widget_Type object as type dropped the whole sections route on PHP 8
…ity-videopress-former-names # Conflicts: # projects/packages/premium-analytics/docs/dashboard-sections.md # projects/packages/premium-analytics/src/dashboard-layout.php # projects/packages/premium-analytics/tests/php/Dashboard_Layout_Test.php
…ity-videopress-former-names
build the broken instances by hand for phan; cover the non-instance branch and the sanitizer
the video plays hook too, provisional; widget contract 1.2.0; the facade must be fully declared
type videopress/top-videos, former jpa/videopress; the Traffic seed moves too
jetpack-mu-wpcom calls the VideoPress registrants on Simple and Atomic
|
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. Videopress 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. Mu Wpcom plugin:
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. |
a keyed list reached the client as an object; the client renames stored layouts only
…pdate/pa-extensibility-videopress-sdk-exports
…ity-videopress-sdk-exports
with describeError and the row limit; the video plays hook stays provisional
…date/pa-extensibility-videopress-top-videos # Conflicts: # projects/js-packages/premium-analytics-sdk/changelog/update-pa-extensibility-videopress-sdk-exports # projects/js-packages/premium-analytics-sdk/src/index.d.ts # projects/packages/premium-analytics/changelog/update-pa-extensibility-videopress-sdk-exports # projects/packages/premium-analytics/docs/dashboard-widgets.md # projects/packages/premium-analytics/packages/sdk/src/index.ts # projects/packages/premium-analytics/packages/widgets-toolkit/src/components/leaderboard/leaderboard.module.scss # projects/packages/premium-analytics/widgets/videopress/__tests__/videopress.test.tsx # projects/packages/premium-analytics/widgets/videopress/style.module.css # projects/packages/videopress/widgets/top-videos/render.tsx # projects/packages/videopress/widgets/top-videos/style.module.css
they moved to the VideoPress package with the widget
covers the rows, the status, the error copy and the footer link
the widget suite that exercised it left the package
the Leaderboard caps its rows; a consumer sizes its own request
…date/pa-extensibility-videopress-top-videos
the SDK no longer exposes the dashboard's row limit
…ity-videopress-top-videos
…ity-videopress-top-videos
louwie17
left a comment
There was a problem hiding this comment.
Thanks @retrofox, this tested well on a local Docker site and the move itself looks good! Saved layouts that still hold jpa/videopress keep rendering as Top videos, and it leaves the default layout and the picker when VideoPress is off.
I did leave two inline comments, the main one is around the new jetpack_videopress_analytics_dashboard_widget_manifest filter, which I don't think we should introduce just for the tests. The other is a small nit around a docblock, which can be a quick fix before merging.
Let me know what you think.
drops the package's own hook; the availability docblock stops naming the widget
louwie17
left a comment
There was a problem hiding this comment.
Thanks for addressing the feedback @retrofox, dropping the filter and feeding the fixture through the existing one is much cleaner, and thanks for updating the docblock as well. I re-tested this on a local Docker site and it all still works well, code looks good!
One note, the WordPress.com Tests check timed out on the latest commit, so that probably needs a re-run before merging.
LGTM 🚀
…ity-videopress-top-videos
the button takes the linked report by id, contract 1.3.0; the parity test drops the moved widget
Fixes WOOA7S-2223
Proposed changes
Step 4 of the VideoPress consumer stack (WOOA7S-2221), after #52885.
The Top videos widget of the Traffic section leaves Premium Analytics and becomes a widget of
packages/videopress, the way the Ads widgets became widgets ofpackages/adsin #52635.The package that knows what a VideoPress video is now owns the widget that lists them.
The widget
packages/videopress/widgets/top-videos/is the formerwidgets/videopress/of Premium Analytics, built here by wp-build asjetpack-videopress/widgets/top-videos/renderand…/widget.It imports everything from
@automattic/jetpack-premium-analytics-sdk, which #52885 made possible, and nothing from the dashboard's internal packages.It renders the SDK's
Leaderboard(#52965), so it carries no chart wiring and no layout CSS of its own.The type is
videopress/top-videos, withjpa/videopressdeclared as its former name, so a persisted layout that still saysjpa/videopressrenders the new type (#52874).The registrant
Analytics_Dashboardinpackages/videopress/src/has the shape of its Ads namesake.init()hooks two things: the widget registration onjetpack_premium_analytics_register_widget_typesat 20, and a seed onjetpack_premium_analytics_dashboard_default_layoutat 10 that appends the Traffic instance where the dashboard used to seed it, uuid and order included.The registration waits for a widget contract between 1.2.0 and 2; the seed does not wait, because the dashboard's own policy drops an instance whose type never registers (#52866).
Initializer::active_initialization()callsinit(), so the widget followsStatus::is_active(): the VideoPress module of the Jetpack plugin, or the standalone plugin.On the WordPress.com platform,
init()returns early, andjetpack-mu-wpcomcalls the registrants for thevideopressplan feature on Simple and Atomic, from the copy that the Jetpack plugin bundles.The package adds no hook of its own. The tests feed a fixture manifest through the dashboard's
jetpack_premium_analytics_registrable_widget_typesfilter, with or without a local build.The SDK gains the CSV download
#52969 gave Top videos a "Download CSV" footer action while this branch was in review. The moved widget keeps it through one new SDK export,
ExporterCsvDownloadButton. The button now also takes the linked report by id,report="videos", so the consumer never holds the dashboard's exporter; the dashboard's own widgets keep passingexporter.WIDGET_API_VERSIONmoves to 1.3.0 and the registrant waits for it.The CSV parity suite of Premium Analytics loses its Videos case: the widget is not in the package to compare. The VideoPress render suite covers the footer action instead.
What Premium Analytics loses
The widget folder, the Traffic seed, the
jpa/videopressentry ofVIDEOPRESS_WIDGET_TYPES, the two toolkit helpers, and the two test-group imports.videopress-availability.phpstays: the Videos report and the detail route still gate on it.Tests
The widget's pure tests move with it, as
widgets/top-videos/test/.Its render suite is rewritten for the consumer side.
The old one drove the widget through the dashboard's internal packages (the data query client, the report mocks), which consumers can't import.
The new one replaces the SDK module and checks what the widget owns: the rows, the request status, the error copy, and the footer link.
The story does not move, for the same reason. A harness that renders the real SDK for consumers is part of the SDK audit (WOOA7S-2228).
Premium Analytics gains a direct suite for
useStatsVideoPlays: the widget suite that exercised the hook left the package.The registrants have PHP tests in both packages.
Dependencies
packages/videopressrequires nothing new at runtime: the registration action only fires when the dashboard is loaded.Premium Analytics is a
require-devand a test-only dependency, for tests and phan;jetpack-mu-wpcomlists VideoPress the same way. The plugin locks record that.Related product discussion/links
Linear: WOOA7S-2221 for the stack, WOOA7S-2223 for this step. Umbrella #52867.
Does this pull request change what data or activity we track or use?
No.
Testing instructions
On a Jetpack site with the VideoPress module active and the dashboard enabled:
GET /wp-json/wpcom/v2/widget-moduleslistsvideopress/top-videoswith `"former_names":This allows crossing without losing a widget instance with a name that no longer exists.
["jpa/videopress"]and arender_moduleunderjetpack-videopress/, and no longer listsjpa/videopress.jpa/videopressinstance renders it as Top videos; it is not a "no longer available" tile.You need to customize the dashboard beforehand to test this PR and have an old instance of the VideoPress widget there. You can inspect the persistent data in the
Applicationtab of your browser.Screen.Recording.2026-10-01.at.10.20.30.AM.mov
On the PHP side:
jetpack test php packages/videopressjetpack test php packages/premium-analyticsjetpack test php packages/jetpack-mu-wpcomjetpack test js packages/videopress