-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Drag blocks into other blocks to create patterns and layouts #13202
Comments
Notably, if this were actually implemented, you would have to be dragging blocks from the drag handle on their side, not the middle of the block as shown in the mockup GIF. You couldn't drag a text block like the GIF shows because it would just select the text inside it. It is also important to keep in mind that people may want to reverse this conversion later on. The most obvious way to handle this would be the block switcher, but its UI is designed around converting one block to one block, multiple blocks to one block, or one block to multiple of the same type of block. It does not currently account for situations where you want to convert one block to multiple different types of blocks, e.g. going from a Media & Text block to a Paragraph block followed by an Image block. The UI would have to be tweaked for conversion options like this to be clearly displayed/communicated to the user. I also recall an old mockup where the blue lines that appear between blocks when drag-and-dropping also appeared to the left and right of blocks. This could potentially allow for different conversions involving the Media & Text block where the order of image and text is determined when the drag-and-drop action happens, meaning the user does not have to manually discover and then use the toolbar option to change the text/image order. On the other hand, the left/right blue lines idea may be better reserved for creating column or CSS Flex ( |
I just found the old mockups I was referring to; they were in #219: |
This is correct. The gif was meant to just convey the experience, not the actual UI.
You bring up a good point. I hadn't thought of that. |
Sharing a couple other animations to get this idea across: Creating a Cover Creating a Media + Text block (Note that these both happen to place the drag handle on the right, and a layout grid during resize, which aren't necessarily part of the core concept here.) |
Here's a couple ways in which this interaction is done with other software applications. Paper Medium In Gutenberg we already use a blue line pattern for dragging and dropping blocks above or below other blocks. We just need to extend this to a side-by-side drop position now too. Something like this: |
I like that. The "drag two images together to make a gallery" example is probably the clearest first iteration of this. |
This could potentially be something handled by the transform system. At the moment, most transforms are for a single block to another single block type. Multiple blocks of a single type can also be transformed to a single block (multiple images to a gallery) using the This could be considered a combination transform. Something like:
Multiselecting the two blocks and using the transform menu as well as drag and drop could be considered valid ways of performing the transform. |
Looking at all the drag-n-drop examples above, I get the feeling that they could all be accomplished using columns. So not by converting 2 simple blocks to 1 complex block, but by wrapping these 2 blocks in columns. |
But what if the user was trying to create a layout that had the text on top of the image? Say, like the Cover block? I do like the idea of smart columns, but I'd love to see some simple block conversion happen. An flow that recognizes there's a more complex block that can be substituted based on the user's interaction. |
With #56186 merged, I think we're good to finally close this one! |
Problem:
In many of the user research videos of Gutenberg, the users tended to try and align items by dragging and dropping them in the editor. They'd want to display two images side-by-side by dragging them next to each other.
Solution:
Dragging and dropping a simple block onto another simple block produces an already existing core complex block.
Example:
Drag and drop a simple text block onto a simple image block, and you get a complex Media+Text block.
The text was updated successfully, but these errors were encountered: