-
Notifications
You must be signed in to change notification settings - Fork 58
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
Block type conversion v1 for paragraph #2814
Comments
@Tug I'm planning on doing some design discovery work on transforms starting next week, but this sounds good start for a very basic first iteration. A couple of quick notes on your proposal:
Here's a quick mock of the sequence: I'll be starting to dig a bit deeper next week but in the meantime let me know if you have any thoughts or if you're seeing any additional complexity that needs some consideration! |
We don't have to. However those are already defined as part of each block definition, so we'd be reusing the logic already existing on the web, not creating new ones. There is no risk on our side in running those transforms as long as the blocks we transform to are supported.
ActionSheet seems fine to me as well. As you said if we show more than 5 or 6 it might be too limited though
I like that 👍 |
@Tug Fair enough. My concern would mostly be end-user confusion. Personally, I find the flow of transforming a Paragraph into a Columns block on web to be a little unclear. It's worth a try though, to see if it feels weird in practice.
Agreed, it might get a bit unwieldy on blocks that offer a lot of options, but this should be a good starting point. |
(Hello! I'll be working on the "transform a paragraph to a heading" piece of this as a part of my trial. @chipsnyder is my trial-buddy for this - excited to dig in!) |
(Hey, just spent the evening poking around - that is a draft PR, and I dunno who-is-working-on-what-part-of-this-change so far, so please let me know if I'm stepping on toes with work that others have planned! 👋) |
No worry @blixt-io nobody else is working on this at the moment, it's yours! Please reach out to @iamthomasbishop if you have questions regarding design |
Alright, I think I'm done building out the functionality here! I'll update the later-two PRs to point at In the last PR on this list, I went ahead and enabled all block-to-block transformations. It was so straightforward to do (yay shared code!) that I figured I should put it up for review, just in case that's something you all were interested in! @iamthomasbishop, let me know what you'd prefer from a design-standpoint. Here's a little peek at what the "all blocks are transformable" situation feels like: |
@iamthomasbishop @Tug There are two options here:
Let me know what you prefer! |
Hey @blixt-io @iamthomasbishop will have some limited availability this week so jumping in here. The web support for blocks and the mobile support are pretty out of sync right now so I think having an allow list for supported transformations would still be a good a plan. Having a framework in place to maintain this list would be helpful as well in case we find any problematic transformations. Maybe we can build off the work you have in https://github.com/blixt-io/gutenberg/pull/2 and modify that helper function with a few allow-lists to indicate which blocks Mobile is ready to support and what transformations are supported on mobile. I think if we start with the list in this ticket we could use that framework to expand from there. |
Related to #2525 |
@mchowning @illusaen I added this to the Mobile Gutenberg board since @illusaen is working on it. Feel free to move it back to Gutenpages if needed |
We should be supporting block transforms in gutenberg-mobile.
Block transforms is already built in gutenberg core api and documented so most of the work here is going to be focused on building a mobile UI for it.
We could start by supporting the most common transforms which are all the Paragraph ones:
In this first iteration I suggest we just add this as a new entry in the block options menu:
Tapping "Transform Block" would open up the bottom sheet with a selection of block to transform to (we can reuse the Inserter UI).
It would be ideal if the bottom sheet could have the title "Transform Paragraph block to..."
Moreover we should filter out unsupported blocks.
cc @iamthomasbishop
The text was updated successfully, but these errors were encountered: