Skip to content

Premium Analytics: remove obsolete widget-picker preview aspect-ratio hack - #50294

Merged
chihsuan merged 1 commit into
trunkfrom
remove/premium-analytics-picker-preview-hack
Jul 8, 2026
Merged

Premium Analytics: remove obsolete widget-picker preview aspect-ratio hack#50294
chihsuan merged 1 commit into
trunkfrom
remove/premium-analytics-picker-preview-hack

Conversation

@chihsuan

@chihsuan chihsuan commented Jul 8, 2026

Copy link
Copy Markdown
Member

Fixes #

Proposed changes

Premium Analytics widgets shipped a per-widget CSS workaround for the widget-picker preview:

:global([inert]:not([inert="true"])) .root {
  height: auto;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

Why: The picker rendered each widget tile inert, and the preview wrapper's height: 125% of an auto-height parent left height: 100% on .root resolving to auto — so the tile collapsed. The 4:3 aspect-ratio rule gave it a sensible fallback shape.

How: #50271 updated the widget-picker host so it sizes preview tiles itself, so the workaround is now dead code. This PR:

  • Removes the aspect-ratio rule from every widget that carried it (16 style modules).
  • Removes the matching "Widget picker preview" guidance from the package AGENTS.md so new widgets don't reintroduce it.

What is intentionally kept: the separate :global([inert]) … .leaderboardImage / .avatar / img rules in locations, authors, subscribers-list, and visitors-by-location. Those counter the picker grid's img { object-fit: cover } blowing flags/avatars up to fill the tile — an unrelated concern that #50271 did not touch.

Related product discussion/links

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

No.

Testing instructions

  • Build the package (jetpack build --deps packages/premium-analytics) or run Storybook.
  • Open the Premium Analytics dashboard's widget picker.
  • Confirm every widget preview tile still renders at a sensible size (no collapse, no full-bleed stretch).
  • Confirm Locations/Visitors-by-Location flag images and Authors/Subscribers avatars still render at their intended small size in the picker preview (not stretched to fill the tile).

@chihsuan chihsuan self-assigned this Jul 8, 2026
@chihsuan
chihsuan marked this pull request as ready for review July 8, 2026 04:57
@chihsuan
chihsuan requested review from a team as code owners July 8, 2026 04:57
@github-actions

github-actions Bot commented Jul 8, 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!

@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 Jul 8, 2026
@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

@chihsuan
chihsuan merged commit 7e1c66e into trunk Jul 8, 2026
74 checks passed
@chihsuan
chihsuan deleted the remove/premium-analytics-picker-preview-hack branch July 8, 2026 06:08
@github-actions github-actions Bot removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jul 8, 2026
louwie17 added a commit that referenced this pull request Jul 17, 2026
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.


Claude-Session: https://claude.ai/code/session_011oGxxfSNdnj1Pyf5FRnPQC

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant