WordPress / gutenberg

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

Navigation Block: prevent submenu items from merging #30164

Open annezazu opened 3 years ago

annezazu commented 3 years ago

Description

If you add multiple sub menu items and then hit backspace at the beginning of the second item, it merges with the first.

Step-by-step reproduction instructions

  1. Add a navigation block
  2. Start new.
  3. Add a Link Block.
  4. Use the toolbar option to add a sub menu item under the link block you just created.
  5. Do this once more.
  6. Go to the very start of the second sub menu item you created and hit the backspace.
  7. Find that the sub menu items merge together.

Expected behaviour

I expect the items to stay separate.

Actual behaviour

They merged :)

Screenshots or screen recording (optional)

https://user-images.githubusercontent.com/26996883/112238003-6d395400-8c09-11eb-8fbf-539d859ce24b.mov

WordPress information

Device information

talldan commented 3 years ago

Oh no, this one was implemented as a feature 😄

Implemented in https://github.com/WordPress/gutenberg/issues/21743.

talldan commented 3 years ago

The button block does the same thing, and I think the two are very comparable and should work similarly.

I suggest we need design feedback on this, as it seems more like a general editor behavior that should be made consistent across blocks.

annezazu commented 3 years ago

Oh whoa interesting! I think if it were more reversible this would be less jarring :D

talldan commented 3 years ago

You can hit enter to split into two blocks again, but the original link url will be lost from the deletion of the block.

annezazu commented 3 years ago

Yeah :) To me, that feels less reversible. Plus once you do that there's no indication that a link is missing.

jasmussen commented 3 years ago

Speaking to the "submenu disappears" aspect (circling the cursor in the video), that should be fixed in #29869.

Edit: and if not by that, then by https://github.com/WordPress/gutenberg/pull/30169

annezazu commented 2 years ago

Looping back on old issues and returned to this one seeing the same behavior in 5.9 (just to get a current snapshot):

https://user-images.githubusercontent.com/26996883/152741063-8f7ce88e-1cf2-4bc9-ae6e-d37e390c3305.mov

I'd be curious to get more design thoughts on this as, to me, this is a pretty surprising thing to have happen. I can see this was originally implemented as a way to allow for an easier time deleting links. However, you can't easily undo this anymore (unless you hit undo) like you could before by separating the menu items back out as shown above.

In my mind, nothing should happen upon taking this action.

talldan commented 2 years ago

However, you can't easily undo this anymore (unless you hit undo) like you could before by separating the menu items back out as shown above.

Yeah, that seems bad, seems like a regression of https://github.com/WordPress/gutenberg/issues/18208.

annezazu commented 2 years ago

Noting that this came up during the FSE Outreach program's usability testing with main menu items when deleting using 6.0 and Gutenberg 13.6:

https://user-images.githubusercontent.com/26996883/178381079-a486e616-56a4-42fa-ad7b-8a0a37c0eacd.mov

This felt like a broken experience to the participant.

jordesign commented 1 year ago

Noting that is still present when testing in WP6.3

annezazu commented 3 weeks ago

Still present in 6.7 RC1.