gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

List View: Explore Naming Blocks

Open richtabor opened this issue 5 years ago • 46 comments

What problem does this address?

The list view is out of context from the block content area, making it very difficult to actually tell what each list item represents among a sea of blocks, unless its interacted with and the user identifies the corresponding block on the right.

While we do support having anchors within the List view, why don't we instead allow naming of these list items, essentially treating them like layers in Figma/Photoshop/Sketch/etc.

What is your proposed solution?

A simple interaction where one can double-click to rename a block within the list view. This would provide instant context to what that block/group consists of.

rename-list

richtabor avatar Jul 20 '21 21:07 richtabor

I really like this idea and I would add one more request to add also other functionality like deleting to the list view. I find myself often wanting to remove a block using this interface and having a true layer interaction space would be very useful in the editor.

karmatosed avatar Jul 21 '21 10:07 karmatosed

I like the new list view. I find myself intuitively wanting to go in and change the name of the groups, rearrange blocks, and name the groups. Having the ability to do this would make it more useful. I was about to request this feature and I see that someone already put in the work and included a beautiful graphic.

deborah86 avatar Jul 21 '21 21:07 deborah86

Great idea!

CHEWX avatar Jul 23 '21 14:07 CHEWX

This would be great for productivity and page management.

dgwyer avatar Jul 23 '21 14:07 dgwyer

Providing the ability to name blocks seems like a forgone UX conclusion: it would be next-level helpful, especially for creating bespoke tutorials for clients. I'm VERY excited to see this added to the list view.

tomfinitely avatar Jul 23 '21 15:07 tomfinitely

I very much support this. It seems like, if this is added, the same field/label should also be available in the block sidebar (outside of list view) so you can name (let’s call it “label”) them while writing/editing/creating content.

JiveDig avatar Jul 23 '21 15:07 JiveDig

Nice!

It seems like, if this is added, the same field/label should also be available in the block sidebar

^ Sharing a previous sketch that could potentially compliment this proposal 😀

https://user-images.githubusercontent.com/77359364/126808120-c928a47f-6c34-4de7-b059-4065a3bed9a1.mov

critterverse avatar Jul 23 '21 15:07 critterverse

Maybe it should still show the block type? "Features area (Group)"

carolinan avatar Jul 24 '21 08:07 carolinan

Maybe it should still show the block type? "Features area (Group)"

Or show block type when hovered over? It might add a lot of visual 'noise' displaying a custom label and the block type together?

dgwyer avatar Jul 24 '21 09:07 dgwyer

Should a custom block label be a different color to the default block type label to indicate it has been changed? Or be italicized etc?

dgwyer avatar Jul 24 '21 09:07 dgwyer

#GreatIdea 👍🏽

heyjoecampbell avatar Jul 24 '21 14:07 heyjoecampbell

This was previously proposed for group blocks - https://github.com/WordPress/gutenberg/issues/16296, and there are some comments on that issue. It could be worth going back and closing that one as a duplicate if this issue gets more traction.

For some background, there have been some alternative ideas that have been explored along similar lines:

  • Being able to edit parts of a block directly in List View, though I don't think is going to progress any further (https://github.com/WordPress/gutenberg/issues/20748, https://github.com/WordPress/gutenberg/pull/22210)
  • The navigation link and template part blocks display their 'labels' in List View and more block types could do this (https://github.com/WordPress/gutenberg/pull/17519)

Technically the name would probably have to be stored as an attribute on a block. I don't want to come across as being negative about the idea, but thinking realistically, that constraint might make it difficult to add this for all block types, but naming a group block could work. Some other blocks also already have names/titles, like the reusable block, and my understanding is the navigation block will also get a label in the future.

A simple interaction where one can double-click to rename a block within the list view.

This needs some thoughts around accessibility, and how keyboard interaction would work. There's been a lot of push back around introducing more controls in list view in the past (this is the article that's always cited - https://adrianroselli.com/2020/07/aria-grid-as-an-anti-pattern.html), which is why other functionality like block movers and settings are not exposed. As a first iteration, naming only in the inspector might be worth exploring. With the persistent list view it's easy to have the inspector open side-by-side with list view.

talldan avatar Jul 26 '21 06:07 talldan

💯

amongthestones avatar Jul 27 '21 10:07 amongthestones

I wanted to surface a discussion I had with @draganescu. Andrei asked:

could we do some magic that makes the HTML Anchor attribute that all blocks have be human readable at all times but properly encoded at all times

To which I replied:

Let's see what HTML spec says... https://html.spec.whatwg.org/multipage/browsers.html#scroll-to-fragid To find a potential indicated element given a string fragment, run these steps:

  1. If there is an element in the document tree that has an ID equal to fragment, then return the first such element in tree order.
  2. If there is an a element in the document tree that has a name attribute whose value is equal to fragment, then return the first such element in tree order.
  3. Return null.

Which then became a matter of having either a invisible <a name="Human readable name"/>, or using whitespaces in IDs.

According to developer.mozilla.com:

id’s value must not contain whitespace (spaces, tabs etc.). Browsers treat non-conforming IDs that contain whitespace as if the whitespace is part of the ID

Still, technically this worked:

Zrzut ekranu 2021-07-27 o 15 42 45

adamziel avatar Jul 27 '21 13:07 adamziel

very similar/overlaps with https://github.com/WordPress/gutenberg/issues/21452 which proposes to use a block's content as the name

skorasaurus avatar Aug 11 '21 18:08 skorasaurus

Read the Full Discussion thread in slack..

General agreement is that this would enhance the editing experience in using gutenberg as a publishing platform. The proposed initial implementation would keep the renaming feature to the list view only.

Two versions of the idea were proposed: just renaming to anything the user set, or explicitly defining the block type, e.g. "About Section" vs. Group: "About Section" to remind the user of the type of block.

General resolution is that the existing block icon display is sufficient enough to remind user of the block type, and for now just keep it to be the user renamed label.

fwazeter avatar Aug 24 '21 17:08 fwazeter

General resolution is that the existing block icon display is sufficient enough to remind user of the block type, and for now just keep it to be the user renamed label.

For core blocks this may be so, but not necessarily for 3rd party blocks? Perhaps showing the block type on icon hover would be prudent for consistent block type discovery, when using the list view?

Otherwise it might be a bit confusing when faced with a long list of (renamed) blocks and you just quickly want to know which block is which.

dgwyer avatar Aug 24 '21 17:08 dgwyer

Having built a block theme over the weekend, in my opinion this is something we could/should be looking at implementing.

@gwwar has been working a lot on List View. I wonder if she has bandwidth to explore this?

getdave avatar Sep 13 '21 08:09 getdave

The UI for this is pretty straightforward, but the interesting part is where we decide to store the data. Have we given some thought to where we'd serialize this? For example is this a name attribute on a group block or something more generic like a named alias for any block (which might be stored as metadata).

I may free up later if I can help finish wrangling some perf/dragging issues.

gwwar avatar Sep 13 '21 15:09 gwwar

Custom block labels in the List view is a must-have. It improves productivity and adds psychological order/control over the layout.

Personally, I think popovers should only be used for extra long edge-case custom labels as I imagine most labels will be 2-3 words max, which allows for:

image

Could even make the block type name smaller to provide bit extra space: image

Edge case of a really long label:

image

On hover, perhaps show a popover:

image

chrisbellboy avatar Oct 08 '21 11:10 chrisbellboy