-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Select Mode: Updates to the block toolbar #65485
base: trunk
Are you sure you want to change the base?
Conversation
if ( isEmpty ) { | ||
return null; | ||
} | ||
|
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 the only change to this file, the isEmpty flag was added and the dropdown is not rendered if empty.
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. |
@@ -35,36 +35,40 @@ function BlockSwitcherDropdownMenuContents( { | |||
clientIds, | |||
hasBlockStyles, | |||
canRemove, | |||
isUsingBindings, |
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.
No need to pass this prop from up to down, it's better to collocate the call.
@@ -196,7 +200,7 @@ const BlockIndicator = ( { icon, showTitle, blockTitle } ) => ( | |||
</> | |||
); | |||
|
|||
export const BlockSwitcher = ( { clientIds, disabled, isUsingBindings } ) => { |
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.
Collocated both of these props.
( isDefaultEditingMode || | ||
( isContentOnlyEditingMode && ! hasParentPattern ) || | ||
isSynced ) && ( | ||
! hasParentPattern && ( |
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.
I left this exception in place but I believe we should remove it as well (we need to move the pattern binding to block-editor package first) cc @talldan
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.
Made an issue here - #65486
Size Change: +58 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Love this! Feeling much more like an editing experience centred around page building using patterns. |
973b495
to
fad0d9e
Compare
Flaky tests detected in b941814. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10958244637
|
I'm most likely not understanding this point, for me there's no inconsistency, can you clarify? |
Both of these are things we can explore. I want to focus on the minimal changes to the toolbar for the current PR (just reuse what we have already).
I will look into it. It might be a bit hard to know whether there's a tool or not though 😬 (given all the extensibility APIs)
Yep, I can reproduce, I'll look into it but that feels separate from the current PR though, we should add it to the todo list in the issue to track it/fix it. |
Yes, so it's actually very hard to "detect" when a toolbar is empty or not. My best guess at the moment would be to actually do some CSS hack with Given that we want to explore adding names and potentially shuffle buttons, I was wondering whether the current state could be an acceptable tradeoff for this PR. |
fad0d9e
to
b941814
Compare
@jameskoster The bug about the in between inserter showing up is being fixed separately here #65529 |
I can't reproduce the issue, for me it works. I'm suspecting there's a bug in the way some of the selectors are memoized. Causing different results depending on what you did before.
Well, these are not "content" blocks, so yeah, it is just the algorithm of "contentOnly" basically. |
The double border issue is fixed. Note that if you notice an editor crash (some kind of infinite loop) when testing this PR, it's mostly likely due to this unrelated PR #65494 (ignore that error for now) |
I suppose it should be discussed separately but I feel like there may be a nuance there. I suspect folks would expect the title to be editable regardless of mode. |
Ok, I found the bug where sometimes the list of blocks in list view is not refreshed properly. It exists in trunk too but I included the fix here in the last commit (it's a small one) ac423e4 |
ac423e4
to
b5476d9
Compare
Builds on top of #65204
This PR makes some changes to the block toolbar behavior for "sections" (content-only containers, select mode, reusable blocks...) and simplifies things a little bit.
Here's the list of changes that I made so far:
Testing instructions