[Backport to release/10.6] Fix analytics tables showing extra padding on WordPress 7.0#63827
Conversation
* Fix analytics tables showing extra padding on WordPress 7.0 Set Card/CardBody size to "none" instead of null to use the new explicit size value added in WordPress 7.0 (Gutenberg #72511). Also removes the now-unnecessary @ts-expect-error comments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Keep @ts-expect-error comment with updated size values for CardBody Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add changelog entries for analytics padding fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Testing GuidelinesHi @louwie17 , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
|
Size Change: -40.3 kB (-0.67%) Total Size: 5.93 MB
|
This PR is a cherry-pick of #63809 to
release/10.6.Original PR Description
Submission Review Guidelines:
Changes proposed in this Pull Request:
Fixes extra padding appearing on analytics tables and related card components when running on WordPress 7.0.
WordPress 7.0 (Gutenberg #72511) added a
nonesize value to theCardcomponent. Previously, we were passingsize={ null }to suppress default padding, which worked as an undocumented side-effect. With WordPress 7.0 this no longer works as expected and results in extra padding being applied.This PR updates all affected
CardandCardBodyusages to use the new explicitsize="none"value, and removes the@ts-expect-errorcomments that were needed whennullwas the only workaround.Closes WOOA7S-1158.
Screenshots or screen recordings:
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Setup: Ensure you are running WordPress 7.0 or later ( you can use the WordPress beta tester for this ), please also test against 6.9 to make sure it still works fine there.
Analytics Tables (TableCard)
Advanced Filters
Leaderboards (Dashboard)
Dashboard Charts
Abbreviated Cards
Store Alerts
errororupdate:Testing that has already taken place:
Code change reviewed and verified against the Gutenberg PR #72511 which added
noneas an explicit supportedsizevalue forCard/CardBody. The@ts-expect-errorsuppression comments were also removed since"none"is now a valid type.Milestone
Automatically assign milestone for the next WooCommerce versionChangelog entry
Automatically create a changelog entry from the details below.Changelog Entry Details
Significance
Type
Message
Fix analytics tables and dashboard cards showing extra padding on WordPress 7.0 by setting Card/CardBody size to "none".
Changelog Entry Comment
Comment