Skip to content

Premium Analytics: unify the shared leaderboard row height, radius, and hover - #51595

Merged
chihsuan merged 2 commits into
trunkfrom
wooa7s-1989-leaderboard-row-consolidation
Aug 27, 2026
Merged

chihsuan merged 2 commits into
trunkfrom
wooa7s-1989-leaderboard-row-consolidation

Conversation

@chihsuan

@chihsuan chihsuan commented Aug 26, 2026 •

Copy link
Copy Markdown
Member

Proposed changes

First of a few PRs aligning the leaderboard widgets with the design prototype.

  • LeaderboardRow / LeaderboardPostLabel lose the variant and className escape hatches — every leaderboard row is now one 36px box with padding-inline: md.
  • Bar radius moves from --wpds-border-radius-md (4px) to --wpds-border-radius-lg (8px), matching the design reference.
  • Link rows gain the reference's hover treatment: --wpds-color-foreground-interactive-brand plus the existing underline.
  • utm-insights — the repo's only caller of the removed props — drops them, and its .itemLabel adopts the shared row box so its two views stay level.
  • The package's AGENTS.md row-height convention now points at the shared components instead of teaching an 8px inline padding that no longer matches.

The 44px rows came from .overlay, added in #50919 so migrated post rows would keep matching a hand-written 12px block padding. Removing the variant removes the reason those two heights existed. Widget migrations onto the shared row are follow-ups: #51599 moves Most viewed and Videos, and a third PR takes the rest. Until those land, the widgets that draw their own labels keep an 8px inline inset where the shared row now uses 12px.

Before / after

Captured from Storybook rather than a live site: this is a component-level change, and the widget stories exercise the shared row directly. Each "before" is a real trunk build of the package, not the branch with values overridden — same window size and crop for both.

Top referrers — bar radius 4px → 8px, text inset 8px → 12px.

Before After
before after

Link hover — was underline only; now picks up --wpds-color-foreground-interactive-brand.

Before After
before after

Top UTM — rows drop from 44px to 36px, so they sit level with the post rows a drill-down shows.

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, then open Packages / Premium Analytics / Widgets / Referrers → Default.
  • Check each row: 36px tall, text inset 12px from the bar's left edge, bar corners rounded 8px.
  • Hover a linked row (twitter.com, linkedin.com). The title should turn blue (#3858e9) and underline. Hovering a row that is not a link should not.
  • Open Widgets / UtmInsights → Default, then drill into a UTM value. The top-level rows and the post rows below should be the same height and share the same left inset — before this change the drill-down dropped from 44px to 36px.
  • On a dashboard, confirm no leaderboard widget lost its rounded bars or changed height unexpectedly. Widgets that render their own labels (Most viewed, Top platforms, Searched terms, Tags, File downloads, Videos, Shares) are deliberately untouched here, so their text still sits 8px from the bar edge rather than 12px.

@chihsuan chihsuan self-assigned this Aug 26, 2026
@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-leaderboard-row-consolidation branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack wooa7s-1989-leaderboard-row-consolidation
bin/jetpack-downloader test jetpack-mu-wpcom-plugin wooa7s-1989-leaderboard-row-consolidation

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 [Status] In Progress 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.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Aug 26, 2026
@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/premium-analytics/packages/widgets-toolkit/src/components/chart-leaderboard/leaderboard-row.tsx 15/15 (100.00%) 0.00% 0 💚

Full summary · PHP report · JS report

@chihsuan
chihsuan marked this pull request as ready for review August 26, 2026 09:27
@chihsuan
chihsuan requested a review from a team as a code owner August 26, 2026 09:27
@chihsuan chihsuan added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Aug 26, 2026
…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.

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

Tests well for me 👍 I pulled the branch and gave it a spin in Storybook, and measured the computed styles instead of just eyeballing - all the numbers matches what's in the PR.

  • Referrers rows come out exactly 36px with 12px padding on both sides, and the bars are 8px radius now.
  • Hovering twitter.com turns the link #3858e9 with underline, and the arrow picks up the colour too, so I think that's why the colour has to sit on the anchor. The Search Engines drill-down row stays black on hover as expected.
  • UTM top rows are 36px (was 44px), and the post rows after drilling in measure exactly the same, so the two views finally sit level.

I also grepped the package for the removed variant/className props and found no leftovers - utm-insights really was the only caller. The barBorderRadius change only reaches leaderboard-chart.tsx via the leaderboardChart theme key so other chart types are not affected. Changelog entries cover both plugins that ship the package too.

Referrers Link hover UTM top level UTM drill-down
referrers hover utm top utm drill-down

Just a heads up if you test locally: I hit a readSiteTimestamp import error in Storybook at first, which turned out to be a stale packages/data/build-module/ built from a newer trunk - nothing to do with this PR, rebuilding the package on the branch fixed it.

Nice cleanup, thanks!

@chihsuan
chihsuan merged commit c277300 into trunk Aug 27, 2026
80 checks passed
@chihsuan
chihsuan deleted the wooa7s-1989-leaderboard-row-consolidation branch August 27, 2026 02:03
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Aug 27, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants