Skip to content

Premium Analytics: Remove the grey hover box inside metric cards - #54385

Merged
Nikschavan merged 1 commit into
trunkfrom
fix/pa-metric-tabs-hover-background
Nov 3, 2026
Merged

Nikschavan merged 1 commit into
trunkfrom
fix/pa-metric-tabs-hover-background

Conversation

@Nikschavan

Copy link
Copy Markdown
Member

Fixes N/A

Proposed changes

  • Hovering an unselected metric card (Traffic summary, Store performance and the other metric tab charts) shows a grey box inside the card. @wordpress/ui 0.25 changed the Tab styles in Tabs: Align interaction backgrounds and focus states WordPress/gutenberg#84572: the hover fill and the focus ring are now painted on the tab's ::after, inset for a 48px tab, so on our 72px cards they show up as a smaller grey rectangle with a band of the card fill around it.
  • Stretch the tab's ::after to the card, give it the card's corner radius, and drop its fill and shadow. The card fill we already set on hover stays the only hover state, and the keyboard focus ring now sits on the card edge. Our rule is unlayered and the @wordpress/ui rules sit in a cascade layer, so it also wins over the copy of @wordpress/ui that the Gutenberg plugin or WordPress.com loads.
  • This does not touch the light-blue card fill for the hovered and selected cards; that is being handled in a separate PR.
Before (trunk) After (this branch)
Grey hover box inset inside the Visitors card Hover fill covers the whole Visitors card
A grey box sits inside the hovered Visitors card. The hover fill covers the whole Visitors card.

Keyboard focus ring drawn on the Visitors card edge

Related product discussion/links

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

No.

Testing instructions

  • Get this branch onto a site with the Jetpack Beta Tester plugin pointed at fix/pa-metric-tabs-hover-background for Premium Analytics, or a Jurassic Ninja site with the branch synced.
  • Go to Jetpack > Stats v2 > Traffic.
  • Hover the Visitors card in the Traffic summary. The whole card gets the light fill, with no grey box inside it.
  • Click the Views card, then press the right arrow key. The focus ring follows the edge of the Visitors card.
  • Repeat on the WooCommerce tab (Store performance widget) if WooCommerce is active.

@Nikschavan Nikschavan self-assigned this Oct 31, 2026
@github-actions github-actions Bot added [Package] Premium Analytics [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Premium Analytics labels Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 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:

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.


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 commented Oct 31, 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 fix/pa-metric-tabs-hover-background branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/pa-metric-tabs-hover-background

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

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report · JS report

@Nikschavan
Nikschavan marked this pull request as ready for review November 2, 2026 07:42
@Nikschavan
Nikschavan requested a review from a team as a code owner November 2, 2026 07:42
Copilot AI balanced review requested due to automatic review settings November 2, 2026 07:42
@wordpress/ui 0.25 paints the Tab hover fill and focus ring on ::after, sized for a 48px tab. Stretch that layer to the card and drop its fill so the card fill shows hover and the focus ring follows the card edge.
@Nikschavan
Nikschavan force-pushed the fix/pa-metric-tabs-hover-background branch from 92997a9 to dd419b0 Compare November 2, 2026 07:46

Copilot AI 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.

🟡 Changes recommended

The visible Premium Analytics fix is missing required changelog entries for the Stats and wpcomsh plugins, whose users also receive the change.

1 open issue
What changed in this PR

This PR adjusts Premium Analytics metric tabs to remove the inset grey hover box introduced by newer WordPress UI styles while preserving the existing card fill.

Changes:

  • Stretch the tab’s ::after overlay to the card edges and inherit its corner radius.
  • Remove the overlay’s background and shadow, and align the keyboard focus outline with the card.
  • Add release notes for the shared package, Premium Analytics plugin, and Jetpack plugin.
File Description
projects/​plugins/​premium-analytics/​changelog/​fix-pa-metric-tabs-hover-background Document the metric-card hover fix for Premium Analytics users.
projects/​plugins/​jetpack/​changelog/​fix-pa-metric-tabs-hover-background Document the Premium Analytics fix for Jetpack users.
projects/​packages/​premium-analytics/​packages/​widgets-toolkit/​src/​components/​metric-tabs-chart/​metric-tabs-chart.module.scss Override the tab overlay’s size, corners, fill, shadow, and focus offset.
projects/​packages/​premium-analytics/​changelog/​fix-pa-metric-tabs-hover-background Record the fix in the shared package’s release notes.

Review effort: Balanced

Significance: patch
Type: fixed

Metric cards: Remove the grey box that appears inside a metric card on hover when a newer version of the WordPress UI library is loaded.

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

Thanks, tested well! 🚢

@Nikschavan
Nikschavan merged commit 73df203 into trunk Nov 3, 2026
96 checks passed
@Nikschavan
Nikschavan deleted the fix/pa-metric-tabs-hover-background branch November 3, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[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.

3 participants