-
Notifications
You must be signed in to change notification settings - Fork 2k
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
FSE: Remove template block settings and UI #35115
Conversation
- Disables all configuration options for post content - Disables anchor for FSE templates. Enables custom class name so we can inject the correct classname for the header/footer
This means that you can't see any reference to their settings! Note that we cannot do this same patch for the post content block because once the block has been disabled, you can't edit the inner blocks. Will have to find a different patch for that.
fe2f04c
to
20e8c2f
Compare
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
👍 This all works for me, and tested on gutenberg 6.1 & 6.2 and didn't notice any issues.
Works fine for me too, but I've got an additional suggestion. What do you say if we went with something like this? - title: __( 'Content Slot' ),
- description: __( 'Placeholder for a post or a page.' ),
+ title: __( 'Content' ),
+ description: __( 'The page content.' ), (suggestions appreciated for the description, though 🙂 ) |
That's an awesome idea! I think that people won't be confused by that nomenclature if it pops up in a couple of places. |
Since users can see this in a few places, we want to make sure they aren't confused when it does pop up.
Tested all of this last night and worked great for me. |
The goal of this PR is to improve the UX of FSE by removing a lot of visual clutter caused by our container blocks. With this PR enabled, you'll see virtually nothing related to them while clicking around! @shaunandrews was definitely right on here.
Here's what it looks like: (lol my gif software speeds it up a ton)
Changes proposed in this Pull Request
Hiding template settings
Diving into that last item, I used a little hack that's available in core. The SiteTitle block actually deselects itself when you click into it (you'll notice you see no block settings when clicking the site title block because of that). So I also applied that to the template block. When you click on it, we just dispatch an action deselecting it. This means that you don't see the settings panel for it. And it's totally transparent, it visually just looks like not much happens when you click on it.
Trying to hide post content settings
I tried to extend this approach to the post content block, but it turns out that when the post content block is deselected, you can't select or edit or do anything to the inner blocks. So that was a no go. This caveat is still there in v6.2, but it turns out they're reverting that behavior: WordPress/gutenberg#16888. I'm not sure there's a ton more we can do unless we want to use a css hack to
display:none;
that bad boy. It will be really nice if WordPress/gutenberg#7469 gets implemented. Then all of this will be resolved. :)What does this mean, then? You can still see information related to the post content block in two places.
Why not fix those now?
I think it would be high effort and low impact, so I figured I'd get a PR up for the rest of it for now. :)
Testing instructions
This goes a long way towards fixing #34751, but it may not be completely fixed. Need to do some more testing on that.
Resolves #35094.