-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Transform multiple selected blocks to Columns block #25829
Conversation
Size Change: +291 B (0%) Total Size: 1.18 MB
ℹ️ View Unchanged
|
Tested inserting columns block on mobile and looks good! 👍 |
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.
🚀 from me! This is amazing @ntsekouras ! The transformation to column experience feels nice :D.
I manually tested the following flows:
- Selected 1 block. Confirmed, column option is missing.
- Selected 2-6 blocks. Confirmed, column option is available.
- Selected 2-6 blocks, some with inner Columns. Confirmed, column option is available. Nested columns works.
Fantastic job abstracting the repeated createBlocksFromInnerBlocksTemplate
function. This tidies it up a lot!
The only suggestion I have, but is not necessary, would be to add an E2E test for attempting to "columnize" just a single block.
Right now, there are test cases for 2, and more than 6.
Again, totally not a blocker! This is amazing. I love how thorough you are with your PR code changes.
Sidenote: TIL that adding a +
in front of a number string
transforms it into a number
(type) 😱 .
Same goes with -
, but making it negative.
Hey @ItsJonQ - thanks so much for your review! 🥇
Actually the transformation would work with any number of blocks. We limit that only because it doesn't make sense to create |
This is a cool new interaction, let's make sure to include it in changelogs for 5.6. |
|
Thanks, added to the list in #26108 ! |
Description
Resolves: #16504
This PR adds the ability to transform multiple selected blocks in a
Columns
block. For now theColumns
transformation is available from the menu only if selected blocks arebetween two and six
. The numbersix
is selected as for now this is the currentmax
columns allowed by aColumns
block.You can create a
Columns
block from any other block, including InnerBlocks themselves.How has this been tested?
Locally for now.
You can test this PR by doing the following:
Group
block.Columns
Types of changes
A new function (
createBlocksFromInnerBlocksTemplate
) for creating blocks fromInnerBlocks template
have been exposed to the public API. A version of this function has been used(duplicated) in more than one places to implement the relative functionality.Todos left
createBlocksFromInnerBlocksTemplate
.Columns
.Checklist: