-
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
Fix unexpected unlock control in block toolbar in non-default editing mode #67121
Conversation
Size Change: +2 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Flaky tests detected in ef2be51. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12120348972
|
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 change looks correct to me (see this comment).
I would be happy if @youknowriad , @fabiankaegy , and @ajlende could double-check it.
Yes, I'm not entirely sure whether that was intentional. I guess the question is whether there's a case where the lock toolbar make sense for "zoom-out" or "content-only" blocks. |
I don't know about zoom-out. But I don't see any instance where a content only locked piece should be allowed to get unlocked 🤔 |
I agree. I can't see any use case for unlocking in these modes. That's a highly advanced feature and we should be explosing that in:
|
7877837
to
ef2be51
Compare
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. |
@cbravobernal I've marked this as needing backport to 6.7 point release. Feel free to adjust as you see fit. |
I think this PR also solves the issue with blocks with <!-- wp:group {"layout":{"type":"constrained"}, "templateLock": "contentOnly"} -->
<div class="wp-block-group">
<!-- wp:paragraph -->
<p>Hello World</p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group --> WordPress 6.7.1❌ A lock icon will be displayed on the Paragraph block in the Group block where This PR✅ The lock icon will not be displayed. |
@t-hamano I believe so yes. This is targeting WP 6.7 point release where I believe the bug manifests itself by allowing you to unlock parts of the template which it shouldn't. Thanks for your review. |
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, @getdave!
Update: I just noticed that the target branch is wp/6.7
. Similar fixes should be merged into the trunk and backported into release branches.
@Mamaduka as far as I can tell the target is 6.7 because the bug is unique to 6.7. It does not exist in trunk and was caused by the removal of the zoomed out mode features from 6.7 |
Thanks @Mamaduka. I believe @youknowriad noted it doesn't manifest on |
What?
Hides the Lock controls in the Block toolbar when not in default editing mode.
Closes #67082
Why?
Unlocking is a advanced level action and is not required for
contentOnly
or when blocks aredisabled
.It makes little sense in Zoom Out either.
How?
Adjust conditional to include
isDefaultEditingMode
.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before
After