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

Site Editor: duplicate inserters in template parts that can't be removed #24360

Closed
vindl opened this issue Aug 4, 2020 · 9 comments
Closed
Labels
[Type] Bug An existing feature does not function as intended

Comments

@vindl
Copy link
Member

vindl commented Aug 4, 2020

Describe the bug

When block within template part is focused two placeholder paragraph blocks appear at the end of it, causing the content below it to shift.

To reproduce
Steps to reproduce the behavior:

  1. Enable Site Editor in Gutenberg's experiments page.
  2. Open the site editor with a block based theme that provides some default FSE templates.
  3. Click on some block in the header template part.
  4. Notice the two paragraph block that appear at the bottom of the template part.
  5. These blocks are not rendered on the front end.
  6. They disappear when you focus some block in post content for editing.

Screenshots

Without focus With focus
Screenshot 2020-08-04 at 23 17 59 Screenshot 2020-08-04 at 23 18 10
@vindl vindl added [Type] Bug An existing feature does not function as intended [Feature] Full Site Editing labels Aug 4, 2020
@vindl vindl added this to Ready to create (needs dev) in Full site editing Aug 4, 2020
@noahtallen
Copy link
Member

I'm pretty sure this has to do with the "default block appender area thing" which appears at the end of many different inner_blocks sections. Do we need to disable this in some views? I wonder what criteria we could use to do so.

@jeyip jeyip self-assigned this Aug 24, 2020
@Addison-Stavlo
Copy link
Contributor

Addison-Stavlo commented Aug 26, 2020

+1 on Noah's comment about the default block appender. This is probably expected behavior when selecting a block that allows inserting inner blocks.

Note that 2 inserters are not added for the template part. In seedlet that template part is wrapped by a group block. So when you select the template part, it triggers this for both the group block and the template part. Adding 1 inserter at the bottom of the template part, and 1 at the bottom of the group block. There probably shouldn't be a group block around the template part in that template, and that would mean when selecting the template part only 1 inserter would appear, which is probably the core intention for allowing a user to add blocks? 🤔

@jeyip
Copy link
Contributor

jeyip commented Aug 27, 2020

Noah and Addison are spot-on. Each inner block is rendering an inserter. When they are nested, it looks as if the inserters are duplicated, but in reality, they are inserters for different sets of inner blocks.

There was some discussion as a team around how best to approach this problem:

  1. One path forward is the solution I've drafted here Block Editor: Fix Multiple Trailing Inserters for Nested Inner Blocks #24836. It only displays one trailing inserter at any given time.
  2. Another solution might be to reintroduce the idea of an inserter with no vertical height. @noahtallen, would you mind elaborating more on this?
  3. The last approach might be to leave everything as is. Although each inserter does place a block in its own distinct set of inner blocks, the affordances aren't clear. Currently, this UX interaction, to me, seems confusing, but I do recognize that there have been discussions surrounding the inserter in the past. There might be reasoning behind this behavior, and I'm curious if @MichaelArestad @shaunandrews have any insight.

@MichaelArestad
Copy link
Contributor

The last approach might be to leave everything as is.

Let's definitely not leave everything as is. There should be one inserter shown at a time in this scenario. #24836 looks like it's headed in the right direction. Nice work so far!

@noahtallen
Copy link
Member

I'd love to get more feedback on this, but in the context of the site editor, is the paragraph block the most common tool? I'm not sure it is. I wonder if the "WYSIWYG" experience is the more important aspect in the site editor, so what if we placed an inserter button center aligned along the bottom border of the template part block? Possibly with some extra indication of where it would insert the block, but this could show up at the same time as the other inserter normally would, and would be a quick way to "insert at the end of the block" without inserting anything up front.

@MichaelArestad
Copy link
Contributor

in the context of the site editor, is the paragraph block the most common tool?

@noahtallen I suppose that remains to be seen. It might be.

I wonder if the "WYSIWYG" experience is the more important aspect in the site editor, so what if we placed an inserter button center aligned along the bottom border of the template part block?

You mean like the inline inserter that shows up between blocks? Or maybe the group block?

@noahtallen
Copy link
Member

Something more like that, yeah! So the "plus button" would be center aligned at the bottom of the template part without taking any extra vertical space, and inserting a block via that button would insert it at the end of the template part. Or something like that :) I personally feel like that would be a more straightforward interaction in this context

@jeyip jeyip removed their assignment Sep 15, 2020
@carolinan
Copy link
Contributor

The original issue with the multiple inserters has been solved, can this issue be closed, and a new issue opened for changing the default block of the inserter?

@carolinan carolinan changed the title Site Editor: placeholder blocks in template parts that can't be removed Site Editor: duplicate inserters in template parts that can't be removed Mar 24, 2021
@vindl
Copy link
Member Author

vindl commented Mar 30, 2021

The original issue with the multiple inserters has been solved, can this issue be closed, and a new issue opened for changing the default block of the inserter?

Yes, I'm fine with closing it. As for the new issue, I think those conversations could be continued in #26404.

@vindl vindl closed this as completed Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
No open projects
Full site editing
  
Ready to create (needs dev)
Development

No branches or pull requests

6 participants