Fix analytics tables showing extra padding on WordPress 7.0#63809
Fix analytics tables showing extra padding on WordPress 7.0#63809
Conversation
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>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughReplaced Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/js/components/src/table/index.tsx`:
- Around line 184-185: This PR changes runtime spacing behavior by setting
CardBody size to 'none' in the components package; add a changelog entry for
packages/js/components describing this functional change (reference the CardBody
component and the size prop change) by running `pnpm changelog add` or by
creating a file under packages/js/components/changelog/ with an appropriate
type/brief description, including a short summary of the change and the PR
number so consumers know spacing behavior changed at runtime.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 81866b90-b626-443e-9846-c6f23b5192bf
📒 Files selected for processing (9)
packages/js/components/src/abbreviated-card/index.jspackages/js/components/src/advanced-filters/index.jspackages/js/components/src/table/index.tsxpackages/js/components/src/table/stories/table-placeholder.story.tsxpackages/js/components/src/table/stories/table.story.tsxplugins/woocommerce/client/admin/client/analytics/components/leaderboard/index.jsplugins/woocommerce/client/admin/client/dashboard/dashboard-charts/block.jsplugins/woocommerce/client/admin/client/layout/store-alerts/index.jsplugins/woocommerce/client/admin/client/layout/store-alerts/placeholder.js
|
Size Change: +3 B (0%) Total Size: 5.98 MB |
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. |
Testing GuidelinesHi @woocommerce/ventures, 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:
|
chihsuan
left a comment
There was a problem hiding this comment.
LGTM. Tested on both WP 6.9 and 7.0 and verified that no extra padding is shown. 🚢
* 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>
* 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>
|
IMPORTANT: Merging this PR to the appropriate branches is critical to the release process and ensures that the bug does not cause regressions in the future releases. Cherry picking was successful for |
|
IMPORTANT: Merging this PR to the appropriate branches is critical to the release process and ensures that the bug does not cause regressions in the future releases. Cherry picking was successful for |
… on WordPress 7.0 (#63826) Fix analytics tables showing extra padding on WordPress 7.0 (#63809) * 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. * Keep @ts-expect-error comment with updated size values for CardBody * Add changelog entries for analytics padding fix --------- Co-authored-by: louwie17 <lourensschep@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
… on WordPress 7.0 (#63827) Fix analytics tables showing extra padding on WordPress 7.0 (#63809) * 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. * Keep @ts-expect-error comment with updated size values for CardBody * Add changelog entries for analytics padding fix --------- Co-authored-by: louwie17 <lourensschep@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Changelog entry
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