-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Improve Inserter experience when blocks cannot be inserted #60991
Comments
Agreed, I shared it almost rethorically to support the point that it really shouldn't be empty. Good thoughts, though, I wonder what would be the smallest thing to do. Is it to have the suggested followed by all sections and ensure blocks in the all section insert in the nearest allowed context that follows after the selected block? |
Perhaps this would be more work, but the upside is it would capture all of these flows. I don't have strong opinions either way, but I find myself tripping over the example in the OP quite often, and would lean towards prioritising a fix for that if we want to try something laser-focussed. |
I agree with this sentiment. It's a bit of a needle to thread, but for blocks with restricted inner blocks—like the List block—it's unexpected to not see any other blocks. I wonder if another course of action would be to categorize/prioritize the blocks that can be inserted within the given block, (List Item block for example) and have all other blocks below it. Edit: Ha, same as @joen mentioned:
|
Agreed. What would it read? Select a different block to add different blocks? 😅 |
I guess my 2 second inspector mockup wasn't very clear 🙈, but this is exactly what I was getting at 👍 Overall the path forward seems to be:
Happy to mock this up in more detail, and update the OP if there's consensus. |
This issue is closely related: #55151 |
Seems solid to me. |
I'm noticing this also when a template part is selected; generally much more often lately. I think we need to iron this out before 6.6. |
Agree this should be prioritised |
@jameskoster there is a broken picture in the description if you can remember what it was, after the text:
|
Oh, it's the same image as the one in this comment. Apparently github prefers me to upload the same image twice. I updated the OP. |
Adding this to the 6.6 board as I agree this is increasingly becoming more visible with some of the new features like overrides. |
Quick thoughts: I dig this. I think all of this combined with enhancements to drag & drop, like showing a X when you can't drop something in a certain area, will help step us forward here. |
Coming back to this one, it's arguably a bug, and has been since the initial implementation. It's just become more visible with recent changes to the inserter. |
The problem
When opened, the Inserter checks where to place blocks and patterns. When the logic is unable to find an appropriate position then the UI turns up empty.
A common example is page editing in the site editor with the template preview turned on; if you select the Title or Featured Image block, then open the Inserter, you see this:
It's quite unexpected to be presented with an empty Inserter, and the lack of explanation further confuses things.
Solution – always show blocks / patterns in the Inserter
allowedBlocks
. E.g. when a List block (or a descendant thereof) is selected, opening the Inserter could show:The label can be polished in a PR. "Based on your selection" could be an alternative to "Suggested".
Original idea
Ideally the Inserter should never appear empty, so as to eliminate that initial point of confusion.One option could be to update the logic so that it falls back to the closest insertable location based on the current parameters. In the scenario above, 95% of the time that would result in blocks being added to the Content block which seems reasonable and expected.
When there are genuinely no insertable locations in the current document, a dialog could appear when a block / pattern is clicked or dragged that explains the situation.
cc @WordPress/gutenberg-design for other ideas.
The text was updated successfully, but these errors were encountered: