Premium Analytics: fix widgets resizing when a dropdown opens - #50624
Merged
louwie17 merged 1 commit intoJul 17, 2026
Merged
Conversation
The Most viewed and Referrers widgets each carried a widget-picker
workaround keyed off a global `[inert]` ancestor selector:
:global([inert]:not([inert="true"])) .root {
height: auto;
aspect-ratio: 4 / 3;
overflow: hidden;
}
`inert` is not owned by the picker. A modal popup — such as the Metrics
SelectControl — inerts background content while open, so the sibling
widget matched this selector and took on a 4:3 aspect ratio for as long
as the dropdown stayed open, then snapped back on close.
#50294 already removed this hack from the other 17 widgets, along with
the AGENTS.md guidance recommending it, since the picker host now sizes
preview tiles itself. These two widgets merged after that cleanup from
branches cut before it, reintroducing the rule. Remove both to restore
parity with the rest of the package.
Fixes WOOA7S-1763.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oGxxfSNdnj1Pyf5FRnPQC
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. 🤷 |
Contributor
|
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! |
louwie17
deleted the
wooa7s-1763-metrics-dropdown-affects-other-widget-dimensions
branch
July 17, 2026 12:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Opening the Metrics dropdown on the analytics dashboard resized other widgets: the Most viewed widget shifted down while the dropdown was open and snapped back on close.
Both the Most viewed (
top-posts) and Referrers widgets carried a widget-picker workaround at the bottom of their CSS module:Those are exactly the three declarations seen appearing on click in the reported DevTools screenshot.
The flaw is that the rule keys "am I in the widget-picker preview?" off a global
[inert]ancestor selector, butinertisn't owned by the picker. A modal popup — such as the MetricsSelectControl— inerts background content while it is open, so a sibling widget matches this selector and takes on a 4:3 aspect ratio for as long as the dropdown stays open.This hack is already obsolete. #50294 removed it from the other 17 widgets and deleted the
AGENTS.mdguidance recommending it, because the picker host now sizes preview tiles itself. These two widgets merged after that cleanup (Jul 9 and Jul 14) from branches cut before it, quietly reintroducing the rule. This PR removes both, restoring parity with the rest of the package.The
[inert]image-sizing rules elsewhere (avatars, flags) are deliberately left alone — they only restore intended sizes, so they are no-ops outside the picker.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Reproducing the bug (on
trunk)metrics.length * MIN_TAB_WIDTH).Verifying the fix (on this branch)
Checking for regressions in the widget picker (this is what the removed rule was originally for)
🤖 Generated with Claude Code
https://claude.ai/code/session_011oGxxfSNdnj1Pyf5FRnPQC