-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Product Collection: carousel layout scaffolding and Editor experience #59519
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
Product Collection: carousel layout scaffolding and Editor experience #59519
Conversation
…tions more flexible in finding blocks
@@ -34,6 +34,9 @@ jest.mock( '@woocommerce/settings', () => ( { | |||
} | |||
return defaultValue; | |||
} ), | |||
getSettingWithCoercion: jest.fn( ( key: string, defaultValue: unknown ) => { | |||
return defaultValue; | |||
} ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests has started to fail with getSettingWithCoercion
is not a function. The test has been passing on trunk
but failed on this branch which does not make much sense.
Here's what Claude told me:
The reason it works on trunk but fails on your branch is likely due to a difference in how the module resolution is working. On trunk, it might be falling back to the actual implementation for unmocked functions, while on your branch it's strictly enforcing the mock.
And I guess that may be it since I touched plugins/woocommerce/client/blocks/assets/js/utils*
adding new util 🤷 Anyway, I added this mock and the test is passing.
Thanks @gigitux for review! I addressed your comments, including the one to move to
I refactored the code as well including:
On top of it:
Can I ask you for re-review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the feedback and deciding to investigate and implement the carousel with supports.layout
🚀
I left feedback regarding the transition from the carousel layout. I am not convinced that we should remove blocks during the transition.
I'm pretty sure that you're aware, but we need to improve the layout of the warning:

As above, it is not a blocker, we can fix it in a follow-up PR.
productTemplate?.clientId, | ||
productTemplateUpdatedBlock | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should add an extra logic to ensure that we carry all the blocks added in group block:
Screen.Capture.on.2025-07-17.at.09-58-40.mp4
Not a blocker; I'm fine if you want to refine it in a dedicated PR 👍
Thanks for review @gigitux . I addressed the feedback:
![]()
Let me know if you want to re-review or you're fine with it as-is 🙌 |
Yeah., I'll be adding them 👍 |
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR includes:
Additional changes:
plugins/woocommerce/client/blocks/assets/js/blocks/product-filters/utils/get-inner-block-by-name.ts
from Product Filters toplugins/woocommerce/client/blocks/assets/js/utils
so I could reuse it as wellwoocommerce/product-gallery-large-image-next-previous
and this is kept as constant in Product Collection.Closes #59402
Closes #59403
(For Bug Fixes) Bug introduced in PR # .
Screenshots or screen recordings:
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
Default collection
Custom collection
Repeat previous steps for custom collection by choosing some collection, e.g. "On Sale" in step 2. The only difference is there's no Pagination block, hence:
Performance notice
Carousel is meant to display only single page hence we display performance notice when merchant decides to set too many products in carousel.
Testing that has already taken place:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment