-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Mini cart block: add margin and padding supports #59872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Testing GuidelinesApart 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:
|
📝 WalkthroughWalkthroughThis change adds support for margin and padding (spacing controls) to the WooCommerce MiniCart block. It updates the block's configuration to enable spacing controls and refactors PHP methods to handle CSS classes and styles extraction by relying on default attribute handling, removing explicit style attribute lists. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Editor
participant MiniCart Block (JS)
participant MiniCart Block (PHP)
User->>Editor: Adds/Configures MiniCart block
Editor->>MiniCart Block (JS): Loads block.json (now with spacing support)
MiniCart Block (JS)->>Editor: Enables margin/padding controls
Editor->>MiniCart Block (PHP): Renders block with attributes (including spacing)
MiniCart Block (PHP)->>MiniCart Block (PHP): Extracts classes/styles using default attribute handling
MiniCart Block (PHP)->>Editor: Returns rendered HTML with updated classes/styles
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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. |
Sorry for the delay with my review. It works great in my testing 😊 I've updated the branch with latest trunk changes with hope it will get the CI green. |
7686206
to
4ab0c62
Compare
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR adds support for margin and padding on the Mini cart block to allow for better user customization
Closes #59701
Screenshots or screen recordings:
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Testing that has already taken place:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment