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

Post Content Block creates confusing UX when deleting content within the block #31798

Closed
annezazu opened this issue May 13, 2021 · 10 comments
Closed
Labels
[Block] Post Content Affects the Post Content Block [Feature] Template Editing Mode Related to the template editor available in the Block Editor

Comments

@annezazu
Copy link
Contributor

Description

When trying to add the post content block to a new blank template that's been customized in template editing mode, the block sometimes gets added multiple times and, upon removal, gets removed in all locations including the original post. cc @youknowriad

Step-by-step reproduction instructions

  1. Have a site set up with template editing mode
  2. Add a new blank template
  3. Remove and re-add the post content block with
  4. Notice it sometimes gets added in multiple times.
  5. Try removing one of the instances only to find it removes the post content everywhere.

Expected behaviour

Expect the block not to be duplicated or mass removed.

Actual behaviour

Block is duplicated + mass removed.

Screenshots or screen recording (optional)

post.content.block.bug.mov

WordPress information

  • WordPress version: 5.7
  • Gutenberg version: 10.6
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? TT1 Blocks

Device information

  • Device: Desktop
  • Operating system: MacOS
  • Browser: Chrome
@annezazu annezazu added [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release [Block] Post Content Affects the Post Content Block [Feature] Template Editing Mode Related to the template editor available in the Block Editor labels May 13, 2021
@annezazu
Copy link
Contributor Author

Just replicated this with a brand new test site using Gutenberg 10.6.1 and WordPress 5.7.2:

replicating.post.content.block.mov

At first, I wasn't able to replicate until I started just trying to add, edit, remove, etc a few times.

@bobbingwide
Copy link
Contributor

See also #26923

@youknowriad
Copy link
Contributor

I think this is now fixed. Anyone can do some tests and confirm?

@annezazu
Copy link
Contributor Author

On my list for today and will loop back to confirm.

@annezazu
Copy link
Contributor Author

annezazu commented May 20, 2021

I am still seeing some strange behavior. Here's as specific as I can get right now with the first item listed the bigger problem to solve:

  1. Because the Post Content Block acts as a container of sorts in the Template Editor, it's very easy to accidentally delete the content of the post itself rather than just the block. Here's a video showing this happening where I think I'm deleting the post content block but am actually editing the post content directly and removing the paragraph block. This is a super confusing UX:
post.content.block.deletion.mov
  1. I think the duplication is due to there being a Post Content Block "container" where, if the content block is empty, the "Type / to choose block" prompt comes up making it seem as if it's just a paragraph block rather than a paragraph block within the Post Content block. This causes the "Block cannot be rendered inside itself" error to show up, causes the duplication effect, and makes it tricky to fully remove the post content block:
post.content.block.container.mov

Note that the "Block cannot be rendered inside itself." error isn't visible when placed inside the Cover Block for some reason.

@annezazu annezazu changed the title Template Editing Mode causes strange duplication and deletion behavior with Post Content Block Post Content Block creates confusing UX when deleting content within the block May 20, 2021
@annezazu
Copy link
Contributor Author

Updated my comment above and the issue description to be more specific as the issue is more about how there is a parent/child dynamic between the Post Content Block and the actual contents of the post content (paragraph, image, etc).

@youknowriad
Copy link
Contributor

@WordPress/gutenberg-core This one is worth-investigating if anyone has time.

@youknowriad
Copy link
Contributor

Because the Post Content Block acts as a container of sorts in the Template Editor, it's very easy to accidentally delete the content of the post itself rather than just the block. Here's a video showing this happening where I think I'm deleting the post content block but am actually editing the post content directly and removing the paragraph block. This is a super confusing UX:

This is not an issue for me, you can edit the post content in template mode, that's a fact but I think @jameskoster and others are exploring adding friction to these blocks separately.

@youknowriad
Copy link
Contributor

The second item is also not a bug. So I'm going to update the issue to reflect its state.

@youknowriad youknowriad removed [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release labels Jun 3, 2021
@annezazu
Copy link
Contributor Author

Closing this out as I can no long replicate what's described here. I do still find it confusing that you can edit the post content directly, including deleting items, while in template editing mode but that's not a true bug :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Content Affects the Post Content Block [Feature] Template Editing Mode Related to the template editor available in the Block Editor
Projects
None yet
Development

No branches or pull requests

3 participants