-
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
Pattern panel is blank when clicking on template part canvas in 6.7 beta 1 #65833
Comments
@mikemcalister do you mind providing a little more detail on the context from which you're starting from. The video does not capture it. I know you're in the Site Editor and you're adding a pattern, but are you editing a template, and which template please? |
An interesting use case here. In order to recreate this in WP stable I had to create a new blank template and insert Template Part: header, blank Paragraph block, and Template Part: footer. Then, in the empty middle Paragraph block, open the pattern inserter, insert a pattern, and then click on the Template Part: footer to see how the pattern inserter closes.
Worth noting that the TT5 theme with WP nightly + Gutenberg has a difference experience than the bug reported. So, it might help to clarify what the intended interaction and experience should be. |
I suspect that this may be a regression or odd intersecting use case that may have been impacted by the Zoom Out work for 6.7. I'm adding it to the 6.7 project board, but feel free to remove it. @noisysocks might have some guidance here. |
@colorful-tones Hey Damon, thanks for triaging this. I was not in a template, I was adding a pattern to a standard page in the site editor. I was able to replicate this in Twenty Twenty Five as well as my own theme. Here's another video with Twenty Twenty Five: CleanShot.2024-10-02.at.21.46.55.mp4 |
@mikemcalister Thanks for persisting with reporting this. It's really helpful to narrow down the exact steps. What I can see from your video is that your clicks end up selecting either:
Specifically
In all of those circumstances it is not possible to insert a pattern and thus the inserter is correctly empty. Notice however, that when you select the Group block (the yellow pattern) you do get choices in the Patterns inserter. Do you agree with the above assessment? That said, I can see how it could be confusing that if you're trying to select "the empty canvas" you cannot seem to do this without selecting a block. I believe this may also be impacted by the bug trying to be fixed in #65857. This becomes easier with #65785. Once that is in a 6.7 Beta/RC it will be easier to click "outside" of the canvas. Let me know if I can help further. |
@getdave Hey Dave, thanks for following up. Yes, your assessment is fairly accurate. When clicking in a block, the panel stays open and populated. Similarly, as you can see in this new video, I'm clicking in the white margin to the left of the page content and I'm getting that same empty panel. As a pro user, I know that this belongs to the template, so that's why I'm getting that empty panel. But many average users are going to click that same white space since it feels like it should be a group area (which technically it is). Clicking away into a canvas is also a common pattern for exiting panels and modals, even in WP. Further, you can see when I click near the featured image, it glitches a few times. That may be separate from the initial issue mentioned here. CleanShot.2024-10-07.at.16.30.08.mp4 |
pattern-selection-6-7-bug.mp4I tested this further and believe it's quite a significant UX issue. |
Thanks for removing the I do think that there is likely overlap and side-effects being caused by the Zoom Out work for 6.7, which are likely impacting the canvas root. I do not have a PR/Issue to link to though. FWIW - here is an additional video of clicking around with pattern inserter and Zoom Out stuff activated too, which might help debug or open up the conversation around how the canvas and context of the overall editing experience gets confusing. I'm honestly not sure what to expect at this point when I click on certain things? 😕 pattern-canvas-click-oddity.mp4 |
Ok I'm pretty sure I've figured this one out. If we dive deep into the code that determines what Patterns show up we end up here: gutenberg/packages/block-editor/src/components/inserter/hooks/use-insertion-point.js Lines 108 to 110 in 4f3da91
This gutenberg/packages/block-editor/src/components/inserter/menu.js Lines 247 to 248 in 4f3da91
This is then used to get the patterns that are available by passing it here: Lines 52 to 56 in 4f3da91
The problem is that in Zoom Out mode, the "root" should be the So the solution is to check if the selectedBlockClientId matches the This is easier to show rather than explain so I'll spin up a PR for review. I thought I'd document it here so I can pick up against next week as it's nearly my end of day. |
Noting that this bug does not manifest on Gutenberg |
Trunk has this PR, which 6.7 doesn't have - #65611 - so it will work quite differently. Despite that, I tested latest 6.7, and this issue seems mostly resolved from what I can tell. At least I found it difficult to reproduce the issue with the empty inserter, there's a chance I didn't take the right steps. It'd be great to get some further testing on this before closing the issue. |
I believe the rapid/repeating reloading of Patterns was just fixed in #66162. However, the issue of seeing "No results" still remains. To replicate:
As shown in the video below that's because we're selecting the Screen.Capture.on.2024-10-17.at.15-56-10.mp4I tried to explain why I think that is in this comment. I think we need to pass the |
Yeah, if we can just get this empty section to close, we should be good. |
Draft of a fix in #66214. Might be a bit naive. Will try to evolve again tomorrow if no one else picks it up first. |
Two PRs merged to the A more robust fix is already in Going to close out. |
Description
After you insert a pattern into the page from the slide out panel, if you click a template part in the block editor canvas, the pattern panel clears the patterns but remains open in a blank state.
Pre 6.7 beta, the panel closed entirely if you clicked into the editor canvas. I'm not sure what is the expected behavior here. Are we keeping the panel open now until closed manually? At the very least, we shouldn't see an empty panel here.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Here's the issue demonstrated in a video.
CleanShot.2024-10-02.at.10.10.10.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: