-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Hide block transforms in contentOnly mode for non-content blocks #65394
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +57 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
andrewserong
left a comment
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 is testing well for me, and seems like a reasonable approach as it's only affecting this particular area where block variation transforms might be visibile.
Is this to prescriptive? We should check carefully whether there are situations where transforms are necessary even in contentOnly. I'm thinking about the Social Icons block or the Navigation block for example.
I don't think it's too proscriptive — the Social icons blocks don't set their variations to use the transform scope, so their icons aren't visible in this component anyway. In searching the repo for blocks that include variations that also use scope of transform, the main example I could find is with form blocks. And in that case, I think in content only mode, we'd also want to hide the transforms, as in this case the user wouldn't be switching out form elements? Here's the UI I mean:
So, I'd expect that to be hidden, too in content-only mode 👍
Is this performant?
Good question, but IMO this feels like a good place for the check to me.
Giving this a slightly tentative ✅, but overall seems like a good approach to me! 🚀
Thanks @andrewserong! I'll leave it open a little longer and if no more feedback I'll merge it. |
) * Hide transforms in contentOnly * Apply only to non-content blocks Co-authored-by: getdave <[email protected]> Co-authored-by: andrewserong <[email protected]>
|
I just cherry-picked this PR to the wp/6.7 branch to get it included in the next release: 33ede7b |
What?
Hides any block transforms when block is in
contentOnlyblock editing mode and it is not a "content" block.Related #65396
Why?
The user should be focused on content not on transforming. Removes additional UI noise.
How?
Returns early from relevant component based on the mode. This is to avoid having to re-render the inspector controls entirely by adding a subscription to
getBlockEditingModewhich runs often.Concerns
contentOnly. I'm thinking about the Social Icons block or the Navigation block for example.Testing Instructions
contentOnly:Testing Instructions for Keyboard
Screenshots or screencast
Screen.Capture.on.2024-09-17.at.10-17-28.mp4