Skip to content
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

Use drag and drop to transform an Image block → Gallery block #32819

Open
critterverse opened this issue Jun 18, 2021 · 0 comments
Open

Use drag and drop to transform an Image block → Gallery block #32819

critterverse opened this issue Jun 18, 2021 · 0 comments

Comments

@critterverse
Copy link
Contributor

@critterverse critterverse commented Jun 18, 2021

One behavior that users might expect to find in Gutenberg is the ability to create side-by-side images by dragging and dropping an image next to an existing one.

Note: This behavior has previously been explored in #13202 and perhaps elsewhere!

image-transform.mp4

Current behavior
You can drag an image on top of an existing Image block, which will upload the new image and replace the current one. The drop zone covers the full area of the block and is indicated by a blue overlay color with a CTA.

Proposed behavior

indicator

The blue overlay color could be reserved for replacing an image, with a new treatment introduced for transforming the Image block into a Gallery block to achieve a side-by-side effect. I used a 4px vertical line to indicate the position of the new image — this is the same visual treatment used for the “move to” indicator (but I can also see a conceptual argument for using a 1px line like the sibling inserter).

snackbar-1

We could potentially show a snack bar after the user completes the transform via drag and drop, as it’s not explicitly clear that this action will change the block type. This would offer the opportunity to undo the transform. (It's also very easy to transform a Gallery block to Image blocks via the transform menu in the block toolbar, in case the user wants to reverse this change later.)

I imagine this could work by identifying separate drag zones within the area of the existing block for replacing/transforming but it would be helpful to play around with this in a PR to see what feels right!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant