Repository navigation
Premium Analytics: Remove the grey hover box inside metric cards - #54385
Conversation
|
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: 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. |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage SummaryThis 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. 🤷 |
@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.
92997a9 to
dd419b0
Compare
There was a problem hiding this comment.
🟡 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
::afteroverlay 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. |

Fixes N/A
Proposed changes
@wordpress/ui0.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.::afterto 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/uirules sit in a cascade layer, so it also wins over the copy of@wordpress/uithat the Gutenberg plugin or WordPress.com loads.Related product discussion/links
@wordpress/uishare class names across versions)Does this pull request change what data or activity we track or use?
No.
Testing instructions
fix/pa-metric-tabs-hover-backgroundfor Premium Analytics, or a Jurassic Ninja site with the branch synced.