Skip to content

[Backport to release/10.6] Fix analytics tables showing extra padding on WordPress 7.0#63827

Merged
louwie17 merged 3 commits intorelease/10.6from
cherry-pick-PR63809-to-release/10.6
Mar 24, 2026
Merged

[Backport to release/10.6] Fix analytics tables showing extra padding on WordPress 7.0#63827
louwie17 merged 3 commits intorelease/10.6from
cherry-pick-PR63809-to-release/10.6

Conversation

@woocommercebot
Copy link
Copy Markdown
Collaborator

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 none size value to the Card component. Previously, we were passing size={ 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 Card and CardBody usages to use the new explicit size="none" value, and removes the @ts-expect-error comments that were needed when null was the only workaround.

Closes WOOA7S-1158.

Screenshots or screen recordings:

before after
Screenshot 2026-03-23 at 20 09 04 Screenshot 2026-03-23 at 20 09 42

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)

  1. Go to WooCommerce → Analytics → Revenue (or any analytics report: Orders, Products, Categories, Coupons, etc.).
  2. Verify the data table renders without unexpected top/bottom padding inside the card body — the table content should sit flush against the card borders with no extra whitespace.

Advanced Filters

  1. Go to WooCommerce → Analytics → Orders.
  2. Click Add filter and add one or more filters (e.g. filter by order status).
  3. Verify the active filter chips inside the card body display without extra padding.

Leaderboards (Dashboard)

  1. Go to WooCommerce → Analytics → Overview (dashboard).
  2. Scroll down to the leaderboard section (e.g. Top Products, Top Coupons).
  3. Verify the leaderboard cards render without unexpected padding around their content.
  4. If there is no data for the selected period, verify the "No data recorded for the selected time period." empty state also has no extra padding.

Dashboard Charts

  1. Go to WooCommerce → Analytics → Overview.
  2. Verify the chart cards (Revenue, Orders, etc.) render without extra padding around the chart area.

Abbreviated Cards

  1. Go to WooCommerce → Analytics → Overview.
  2. Verify the small summary cards (e.g. total sales, orders) at the top of the page render without extra padding.

Store Alerts

  1. Use WP-CLI to create an unactioned admin note of type error or update:
wp eval "
  \$note = new \Automattic\WooCommerce\Admin\Notes\Note();
  \$note->set_name( 'test-store-alert' );
  \$note->set_title( 'Test Store Alert' );
  \$note->set_content( 'This is a test store alert.' );
  \$note->set_type( \Automattic\WooCommerce\Admin\Notes\Note::E_WC_ADMIN_NOTE_ERROR );
  \$note->set_status( \Automattic\WooCommerce\Admin\Notes\Note::E_WC_ADMIN_NOTE_UNACTIONED );
  \$note->set_source( 'woocommerce' );
  \$note->set_content_data( (object) array() );
  \$note->save();
  echo 'Note created with ID: ' . \$note->get_id();
  "
  1. Go to WooCommerce → Home.
  2. Verify the store alert card at the top of the page renders without unexpected extra padding around the alert content.

Testing that has already taken place:

Code change reviewed and verified against the Gutenberg PR #72511 which added none as an explicit supported size value for Card/CardBody. The @ts-expect-error suppression comments were also removed since "none" is now a valid type.

Milestone

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch

Type

  • Fix - Fixes an existing bug

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

* 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>
@woocommercebot woocommercebot requested a review from louwie17 March 24, 2026 10:18
@github-actions github-actions bot added package: @woocommerce/components issues related to @woocommerce/components plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Mar 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Testing Guidelines

Hi @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:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 24, 2026

Size Change: -40.3 kB (-0.67%)

Total Size: 5.93 MB

Filename Size Change
./packages/js/product-editor/build/blocks/generic/product-linked-list-field/editor-rtl.css 0 B -329 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-linked-list-field/editor.css 0 B -329 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-number-field/editor-rtl.css 0 B -227 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-number-field/editor.css 0 B -227 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-pricing-field/editor-rtl.css 0 B -296 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-pricing-field/editor.css 0 B -297 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-section/editor-rtl.css 0 B -277 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-section/editor.css 0 B -277 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-tab/editor-rtl.css 0 B -303 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-tab/editor.css 0 B -303 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-taxonomy-field/editor-rtl.css 0 B -449 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-taxonomy-field/editor.css 0 B -449 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-text-field/editor-rtl.css 0 B -315 B (removed) 🏆
./packages/js/product-editor/build/blocks/generic/product-text-field/editor.css 0 B -315 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-attributes-field/editor-rtl.css 0 B -318 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-attributes-field/editor.css 0 B -318 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-custom-fields-toggle-field/editor-rtl.css 0 B -329 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-custom-fields-toggle-field/editor.css 0 B -329 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-details-section-description/editor-rtl.css 0 B -532 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-details-section-description/editor.css 0 B -532 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-downloads-field/editor-rtl.css 0 B -1.05 kB (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-downloads-field/editor.css 0 B -1.05 kB (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-has-variations-notice/editor-rtl.css 0 B -281 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-has-variations-notice/editor.css 0 B -281 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-images-field/editor-rtl.css 0 B -492 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-images-field/editor.css 0 B -492 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-list-field/editor-rtl.css 0 B -730 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-list-field/editor.css 0 B -730 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-name-field/editor-rtl.css 0 B -460 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-name-field/editor.css 0 B -459 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-regular-price-field/editor-rtl.css 0 B -323 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-regular-price-field/editor.css 0 B -324 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-sale-price-field/editor-rtl.css 0 B -322 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-sale-price-field/editor.css 0 B -323 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-schedule-sale-fields/editor-rtl.css 0 B -273 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-schedule-sale-fields/editor.css 0 B -273 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-shipping-dimensions-fields/editor-rtl.css 0 B -381 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-shipping-dimensions-fields/editor.css 0 B -381 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-single-variation-notice/editor-rtl.css 0 B -271 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-single-variation-notice/editor.css 0 B -271 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-sku-field/editor-rtl.css 0 B -347 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-sku-field/editor.css 0 B -344 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-summary-field/editor-rtl.css 0 B -506 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-summary-field/editor.css 0 B -506 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-tag-field/editor-rtl.css 0 B -363 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-tag-field/editor.css 0 B -363 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-variation-items-field/editor-rtl.css 0 B -379 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-variation-items-field/editor.css 0 B -379 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-variations-options-field/editor-rtl.css 0 B -517 B (removed) 🏆
./packages/js/product-editor/build/blocks/product-fields/product-variations-options-field/editor.css 0 B -517 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-linked-list-field/editor-rtl.css 0 B -329 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-linked-list-field/editor.css 0 B -329 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-number-field/editor-rtl.css 0 B -227 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-number-field/editor.css 0 B -227 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-pricing-field/editor-rtl.css 0 B -296 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-pricing-field/editor.css 0 B -297 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-section/editor-rtl.css 0 B -277 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-section/editor.css 0 B -277 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-tab/editor-rtl.css 0 B -303 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-tab/editor.css 0 B -303 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-taxonomy-field/editor-rtl.css 0 B -449 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-taxonomy-field/editor.css 0 B -449 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-text-field/editor-rtl.css 0 B -315 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/generic/product-text-field/editor.css 0 B -315 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-attributes-field/editor-rtl.css 0 B -318 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-attributes-field/editor.css 0 B -318 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-custom-fields-toggle-field/editor-rtl.css 0 B -329 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-custom-fields-toggle-field/editor.css 0 B -329 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-details-section-description/editor-rtl.css 0 B -532 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-details-section-description/editor.css 0 B -532 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-downloads-field/editor-rtl.css 0 B -1.05 kB (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-downloads-field/editor.css 0 B -1.05 kB (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-has-variations-notice/editor-rtl.css 0 B -281 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-has-variations-notice/editor.css 0 B -281 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-images-field/editor-rtl.css 0 B -492 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-images-field/editor.css 0 B -492 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-list-field/editor-rtl.css 0 B -730 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-list-field/editor.css 0 B -730 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-name-field/editor-rtl.css 0 B -460 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-name-field/editor.css 0 B -459 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-regular-price-field/editor-rtl.css 0 B -323 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-regular-price-field/editor.css 0 B -324 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-sale-price-field/editor-rtl.css 0 B -322 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-sale-price-field/editor.css 0 B -323 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-schedule-sale-fields/editor-rtl.css 0 B -273 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-schedule-sale-fields/editor.css 0 B -273 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-shipping-dimensions-fields/editor-rtl.css 0 B -381 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-shipping-dimensions-fields/editor.css 0 B -381 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-single-variation-notice/editor-rtl.css 0 B -271 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-single-variation-notice/editor.css 0 B -271 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-sku-field/editor-rtl.css 0 B -347 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-sku-field/editor.css 0 B -344 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-summary-field/editor-rtl.css 0 B -506 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-summary-field/editor.css 0 B -506 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-tag-field/editor-rtl.css 0 B -363 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-tag-field/editor.css 0 B -363 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-variation-items-field/editor-rtl.css 0 B -379 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-variation-items-field/editor.css 0 B -379 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-variations-options-field/editor-rtl.css 0 B -517 B (removed) 🏆
./plugins/woocommerce/client/admin/build/product-editor/blocks/product-fields/product-variations-options-field/editor.css 0 B -517 B (removed) 🏆

compressed-size-action

Copy link
Copy Markdown
Contributor

@louwie17 louwie17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@louwie17 louwie17 enabled auto-merge (squash) March 24, 2026 11:57
@louwie17 louwie17 merged commit 8f15137 into release/10.6 Mar 24, 2026
33 checks passed
@louwie17 louwie17 deleted the cherry-pick-PR63809-to-release/10.6 branch March 24, 2026 13:53
@github-actions github-actions bot added metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. needs: documentation The issue/PR requires documentation to be added. labels Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metric: feature freeze exception A tracking label for PRs that were merged after the feature freeze. needs: documentation The issue/PR requires documentation to be added. package: @woocommerce/components issues related to @woocommerce/components plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants