-
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
Template editor: Show the inserter if the template part is empty #41024
Conversation
Size Change: +1.91 kB (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
Yes I missed a thing in the logic as I reversed it and renamed the constant before submitting the PR :) |
Of the two inserter examples above, I prefer the first one with the outline. I am not sure yet how to change the inserter, will research :) |
Using the Looking at the result, I think it needs space above it. appender.mp4The video shows the template part creation from the Site Editor template part list to the template editor. Once in the template editor, the browser window width is reduced by the user. When I reduce the window width, there is an empty element with the class ".block-editor-block-contextual-toolbar.is-fixed" above the inserter that has a visible bottom border, and this does not look correct. But I confirmed that this is an issue even without the inserter enabled/without this PR. |
I think that second issue is related to the top toolbar: #37946 |
I spent another hour on this, but I was not able to create the custom appender according to the design. |
I don't think we need a custom one, just the regular one would do the trick. The positioning is probably less important. |
The regular one shows the paragraph block placeholder. |
Oh yeah 🤦♂️ Perhaps the empty paragraph approach is ok afterall, if we remove the 100% height on the empty container. What do you think? |
I couldn't find a way to remove the 100% height only when the template part is empty. |
@kevin940726 I believe you implemented the fixed height here, any chance you could take a look? |
@carolinan @jameskoster Just checking in here, how close are we to merging this? Even if we cannot fix the 100% height, having an empty paragraph (or alternative inserter button) is still a massive improvement over the current display and it would be really good to get this into 6.0 and we are hours away from RC3 😅. We can always iterate further in 6.0.1 or 6.1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jameskoster! @gziolo @adamziel we have two approvals on this and tests are passing, so should be good to backport for RC3. |
I just cherry-picked this to wp/6.0 branch to be included in the next release: 1c8ab8f |
I think that's actually a bug. I tried to fix it a while ago, not sure why it came back 🤔. Ideally, the height should fit the content of the frame. |
Maybe related to #38910 ? |
Probably not because that only affects the post editor? Maybe the bug is never fixed correctly, that's also possible 😅. |
What?
Displays the inserter in the template editor if you are editing an empty template part, like a newly created part.
Closes #37524
Why?
When you create a new template part using the Add New button in the Site Editor template part list, the editor is empty.
This PR can be a short term fix until contextual block patterns can be shown. See #41008
How?
Updates the existing condition for showing the inserter to include a check if the template is empty or not.
Testing Instructions
It should show the same regardless of what area is select when creating the part.
Screenshots or screencast