WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.08k stars 4.04k forks source link

Multi-Select: hide grouping controls for when selecting text only blocks #40063

Open annezazu opened 2 years ago

annezazu commented 2 years ago

What problem does this address?

When using multi-select, the block toolbar still displays the tooling to group/row/stack blocks:

https://user-images.githubusercontent.com/26996883/161875269-82bfb730-d2b7-4b5b-aa7e-03defac0f14a.mov

This was found during the 6.0 walkthrough.

What is your proposed solution?

When using multi select with text only blocks (header, paragraph, etc), hide the controls for group/row/stack options:

Screen Shot 2022-04-05 at 6 10 21 PM
andrewserong commented 2 years ago

Interesting idea! Why do we want to hide the controls when text blocks are selected? Grouping text blocks can be useful if there are paragraphs and headings that someone wants to highlight together:

highlighting-paragraphs

Or was it more about if text is only partially selected, then we should hide it 🤔

Apologies if the context is clearer from the 6.0 walkthrough, I didn't manage to catch it! 🙂

annezazu commented 2 years ago

Ah to be clear, this is to hide the controls when using the new multi-select feature where you can select text across multiple blocks. At least, this was my interpretation as having all of these controls while using multi select feels like overkill.

Current:

Screen Shot 2022-04-06 at 10 45 47 AM

Proposed:

Screen Shot 2022-04-06 at 10 45 57 AM
andrewserong commented 2 years ago

Thanks for clarifying! I see, yes, looks like we've got two slightly different use cases to look after:

  1. As a user, I want to select multiple text blocks to group them / re-arrange them in a particular way (add spacing / background colours, etc).
  2. As a user, I'm editing the content I'm currently writing, and I only want the controls relevant to me as I copy / paste / cut / rearrange text.

Adding some kind of logic that hides the controls when there's a partial selection of text within heading / paragraph blocks sounds good to me 👍

ntsekouras commented 2 years ago

Someone could argue that the block toolbar and block actions menu are more about handling blocks as whole.. This is the approach we will take regarding the Copy button in block actions, even if we have partial selection. Personally I don't have a strong opinion on this, but I'm leaning to leaving it as is.

andrewserong commented 2 years ago

Personally I don't have a strong opinion on this, but I'm leaning to leaving it as is.

I think I'm leaning slightly that way, too, since it can be difficult to predict intent just from the existence of a partial selection.