-
Notifications
You must be signed in to change notification settings - Fork 4.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
Disable block supports derived design tools when Blocking Editing Mode is not default
#50912
Conversation
6a64a86
to
7ebb626
Compare
Size Change: +35 B (0%) Total Size: 1.41 MB
ℹ️ View Unchanged
|
Flaky tests detected in 7f7b5de. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5082077584
|
1163c2e
to
5a6d5ad
Compare
Block Supports: Disable block supports when Editing Mode is not default Co-authored-by: Alex Lende <5129775+ajlende@users.noreply.github.com> Co-authored-by: Ben Dwyer <275961+scruffian@users.noreply.github.com>
5a6d5ad
to
7f7b5de
Compare
default
Related #50857 |
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 pretty well for me.
The block support design tools aren't rendering when editing the nav block in focus mode.
I did run into one scenario though where the styles tab was still rendered. With a Social Links block within the navigation its icon color and background controls are still rendered to the color panel in the styles tab. They are ad hoc controls so might be a different use case but if we aren't allowing other blocks to change colors, I'm assuming we'd want to tidy this up as well?
Logically this makes sense to me. Hiding these auxiliary panels when the editing mode is 👍 |
Good point but it's not the behaviour we want in #50857. In there, the Post Content block has |
Let's get this in as it fixes an issue @tellthemachines noticed in #50857 while testing. I've tested this by merging this branch into #50857. We should fix the Social Links issue @aaronrobertshaw found in #39286 before that is merged. |
Maybe I'm misunderstanding. I thought that in this case only the Post Content block would be Otherwise I think maybe there's a need to reconsider the term 'contentOnly', and instead call it something different for |
Block Supports: Disable block supports when Editing Mode is not default Co-authored-by: Alex Lende <alex@lende.xyz> Co-authored-by: Alex Lende <5129775+ajlende@users.noreply.github.com> Co-authored-by: Ben Dwyer <275961+scruffian@users.noreply.github.com>
I had to change the semantics around Agree the name sucks. In my mind the inner blocks are "content" and so Lots to think about 🤔 definitely don't think we should make this API public for 6.3. |
Ah, I wondered about that, as I remembered seeing it implemented the other way. Being able to mix different editing modes for parents and their children seems like it could unlock a lot of possibilities, so it'd be a nice thing to explore later. It could finally solve #7694 😄
My understanding is that the 'content' part of the naming was supposed to refer to |
Block Supports: Disable block supports when Editing Mode is not default Co-authored-by: Alex Lende <alex@lende.xyz> Co-authored-by: Alex Lende <5129775+ajlende@users.noreply.github.com> Co-authored-by: Ben Dwyer <275961+scruffian@users.noreply.github.com>
What?
Following on from #50643, this hides block supports when Editing Mode is set to be not the default.
Why?
When blocks are not in
blockEditingMode === 'default'
state then we shouldn't be able to modify their settings via block supports.How?
Disable the hooks when
blockEditingMode !== 'default'
.Testing Instructions
This has to be tested in conjunction with #39286
Checkout that PR and this one and then open the navigation block in focus mode. Check that the inspector controls don't show the anything except the list view panel:
Note
@noisysocks (or anyone else) if you want to take over this PR be my guest