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

Audit block transforms #63635

Open
ellatrix opened this issue Jul 16, 2024 · 8 comments
Open

Audit block transforms #63635

ellatrix opened this issue Jul 16, 2024 · 8 comments
Labels
[Feature] Block Transforms Block transforms from one block to another [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@ellatrix
Copy link
Member

Let's audit:

  • Missing block transforms.
  • Existing transforms that don't make sense or behave strangely.

Existing

  • Multiple => Headings does not make sense?
  • Multiple => Columns: does it make sense after a certain number? Which number?
  • Does SINGLE paragraph => columns make sense?
  • Should there be a quote transform for blocks nested in a quote?
  • There is no way to unquote, see also Restore Unquote button #51934. Similarly there's no way to ungroup from the transforms menu.
  • Group transforms: we need consistency:
  • Does paragraph <> code make sense? Also maybe remove Preformatted?
  • Should we remove the multi <> pull quote transform (see Having two types of quote is confusing #11610)
  • Transforming Image & Text => Image loses text.
  • Image & Text => video does not make sense?
  • Heading => list does not make sense?
  • List => heading does not make sense either.

Missing

Cc @richtabor maybe you have a good sense of what else is missing.

@ellatrix ellatrix added [Feature] Block Transforms Block transforms from one block to another [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. labels Jul 16, 2024
@cbirdsong
Copy link

I couldn't find an existing issue for this, but a paragraph block containing only an inline image should be able to be transformed into an image block.

@ellatrix
Copy link
Member Author

Sure, we can add that

@richtabor
Copy link
Member

richtabor commented Jul 17, 2024

General notes

Does SINGLE paragraph => columns make sense?

I think it's strange to promote transforming to columns, unless I have multi-selected blocks. Otherwise I just place the current block in one column, which is not quite as meaningful (and perhaps disorienting).

Maybe we need two "transform" categories: transform and wrap.

I'm not bullish on transforming to "Group" from the transform panel. It's great in the block options, as it's an action I'm taking, rather than a true transforming of the current block. We're mixing the ideas a bit including transform to group in the transforms panel.

I don't think we need two groups. I'm not sure that wrapping to anything other than group is super helpful in the editing flow (other than the case of multi-select with columns).

Transform priority

The notion of transform priority is an important one. I know we have a few in there, but it would be great if we could set prioritized transforms—especially for generic content blocks—like the image block to prioritize gallery and cover for example (and review the current prioritized transforms).

Apart from the list you made, just making Columns multi-select only, and removing "Group" as an ever-present transform (relying on the block options group functionality makes the transform panel much more intentional. Then with just a few prioritized transforms for content and images, I think it'll be super solid.

@richtabor
Copy link
Member

richtabor commented Jul 17, 2024

Image & Text => video does not make sense?

Agreed

Heading => list does not make sense?
List => heading does not make sense either.

Yea, probably doesn't make much sense. Perhaps if you have multiple content blocks selected, you can transform to List.

Does paragraph <> code make sense? Also maybe remove Preformatted?

I can see these being ok perhaps. It's likely confusing for many users to see "Peformatted" though

Multiple => Headings does not make sense?

It's probably fine.

@annezazu
Copy link
Contributor

annezazu commented Aug 8, 2024

Putting out there to include a way to transform between List types if possible while I know this broader issue to allow more control ideally would need to be done: #51480

For now, there's not a way to transform between ordered and unordered items (you can select the parent list and change but still, it's an extra step):

transform.list.mov

Happy to open a specific issue for this but it felt on the edge to me.

@ellatrix
Copy link
Member Author

@annezazu Yes, it's a general problem with list item transforms. I was also trying to convert a list to paragraphs and couldn't after selecting multiple list items. I wonder how we could best solve this. Technically, the list items are selected, not the whole list, so no transforms match (even if we add them, you can't insert paragraphs into a list block).

  • Should we add a link to select the parent block if there's no transforms? I don't really like this.
  • Should we show the parent transforms here? It could be strange when not all items are selected. Would it be expected that all items transform?
  • Should we attempt anyway to add list item transforms, and find a way around the limitation? This would mean detecting that the result of the transform can't be inserted (into the list), splitting the list, etc.

Anyone who cares about list that is good to ping? I think @jasmussen cares about lists and transforms 🙂

@jasmussen
Copy link
Contributor

Well, specifically for lists, I'm not sure transforms is the best interface at all. It's a list block, it's not an ordered list block with a unordered list block to transform into.

To that end, I'd think this is rather a challenge with the block toolbar itself, which for the List specifically could benefit from showing some of the parent properties.

There's something we could try; it might need refinement, but it still seems made for this. For the Buttons block, we have a feature to absorb into the child block the controls for the parent block. Not here how the justification controls are available regardless of which "layer" I've chosen:

buttons

This is not yet applied to the list block:

list

But it seems worth trying. The only downside, the list block toolbar could get pretty long. Mockup:

List block with absorbed control

@Marc-pi
Copy link

Marc-pi commented Nov 7, 2024

a frequent need is to convert from paragraph (link) to Buttons #66846

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Transforms Block transforms from one block to another [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
None yet
Development

No branches or pull requests

6 participants