Skip to content

Premium Analytics: move Most viewed and Videos onto the shared leaderboard row - #51599

Merged
chihsuan merged 9 commits into
trunkfrom
wooa7s-1989-migrate-custom-title-labels
Aug 27, 2026
Merged

chihsuan merged 9 commits into
trunkfrom
wooa7s-1989-migrate-custom-title-labels

Conversation

@chihsuan

@chihsuan chihsuan commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Proposed changes

  • Most viewed and Videos drop their hand-written title labels and render through the shared leaderboard row, so both now match the design prototype's row box (36px tall, padding-inline: md) instead of their own.
  • ~100 lines of per-widget label CSS go away — .labelRow, .labelTitle, .labelTitleLink, .labelExternalLink, .labelText, and their hover rules.
  • LeaderboardRowAction gains a videoLink kind. postLink hard-codes the /post/$postId route, so video rows had no way to reach /video/$videoId through the shared row.
  • Both widgets now take their detail-link window from useWidgetNavigationSearch(). Most viewed was reading reportParams, which strips comparison state on surfaces that don't offer it, so breadcrumbing back lost the user's comparison.

Second of a few PRs aligning the leaderboard widgets with the design prototype. Behavior is unchanged otherwise: the internal / public-URL / plain-text branches, the outbound ↗ marker, title tooltips, long-title ellipsis, and the archive drill-down all resolve exactly as before.

Stacked on #51595.

Screenshots

Captured from Storybook at a 760px widget width. Both widgets go from a hand-written label (43px tall, padding: 12px 8px) to the shared row (36px, padding-inline: 12px), so they now sit level with every other leaderboard.

Most viewed → Default — the tighter rows fit a sixth row in the same space.

Before After
before after

Most viewed → Archives — the drill-down groups pick up the same box.

Before After
before after

Videos

Before After
before after

Related product discussion/links

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

No.

Testing instructions

  • Run Storybook: pnpm run storybook from projects/packages/premium-analytics.
  • Open Packages / Premium Analytics / Widgets / TopPosts → Default. Rows should be 36px tall with a 12px inset, level with every other leaderboard.
  • Hover a linked row — the title turns blue (#3858e9) and underlines.
  • Open TopPosts → Archives and drill into a group. The child rows keep the same height and inset; the row is a button, not a link.
  • Open VideoPress → Default. Every linked row should point at /video/…, not /post/… — that's what the new videoLink action fixes.
  • On a dashboard, confirm long titles still ellipsize and external rows still show the new-tab arrow.

@github-actions

github-actions Bot commented Aug 26, 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 wooa7s-1989-migrate-custom-title-labels branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack wooa7s-1989-migrate-custom-title-labels
bin/jetpack-downloader test jetpack-mu-wpcom-plugin wooa7s-1989-migrate-custom-title-labels

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 Docs labels Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 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: September 7, 2026

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 Aug 26, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 3 files.

File Coverage Δ% Δ Uncovered
projects/packages/premium-analytics/widgets/top-posts/render.tsx 79/99 (79.80%) -0.20% 1 ❤️‍🩹
projects/packages/premium-analytics/packages/widgets-toolkit/src/components/chart-leaderboard/leaderboard-row.tsx 16/16 (100.00%) 0.00% 0 💚
projects/packages/premium-analytics/widgets/videopress/render.tsx 15/15 (100.00%) 0.00% 0 💚

Full summary · PHP report · JS report

…nk arrow

The design system renders the arrow as a sibling of the label, so a colour on
.label never reached it and hover showed blue text beside a dark arrow. Move the
colour to the anchor and leave the underline on the label.

Also size the UTM value rows with body-sm so they match the post rows they drill
into, and stop AGENTS.md restating the shared row's values.
@chihsuan
chihsuan force-pushed the wooa7s-1989-migrate-custom-title-labels branch from 208b658 to 1345a5e Compare August 26, 2026 09:48
…join a group

The suite gained a `@wordpress/route` mock but stayed in the no-mocks group, so `test-groups` failed on the mismatched signature.
… actions

`LeaderboardPostLabel` reads the window from context, but a row whose action
varies per row has to build it by hand and could omit `search` silently: the
detail page then opened on its own default range with nothing to show for it.

Making `search` required turns that into a compile error. Pass `{}` to navigate
without a window on purpose.
Base automatically changed from wooa7s-1989-leaderboard-row-consolidation to trunk August 27, 2026 02:03
…custom-title-labels

# Conflicts:
#	projects/packages/premium-analytics/packages/widgets-toolkit/src/components/chart-leaderboard/leaderboard-row.tsx
@chihsuan
chihsuan marked this pull request as ready for review August 27, 2026 02:42
@chihsuan
chihsuan requested a review from a team as a code owner August 27, 2026 02:42
@chihsuan
chihsuan merged commit 69a2228 into trunk Aug 27, 2026
104 of 107 checks passed
@chihsuan
chihsuan deleted the wooa7s-1989-migrate-custom-title-labels branch August 27, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant