-
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
De-duplicate block toolbar icons for patterns #65054
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: +37 B (0%) Total Size: 1.78 MB
ℹ️ View Unchanged
|
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.
Thank you, @talldan!
This fixes the duplicate block icon issue.
To solve this I've added to the already complicated check on whether to render the BlockSwitcher.
I think there's a better fix somewhere, probably refactoring how the custom block icon for patterns works. This fix will be quicker though, so I think would be worth merging first.
Agreed. Let's create a separate issue, so this doesn't get lost. Maintaining those conditions will only get complicated.
Flaky tests detected in c864b26. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10702657258
|
It seems to work fine 🙂 I'm wondering if the "Pattern overrides toolbar controls" are really needed or if they can be removed now 🤔 It seems it only adds an indicator, right? |
I've made an issue for it - Pattern Overrides: Refactor block toolbar indicator There's the indicator, but it also has a purple color and a message in the dropdown. |
What?
Fixes the issue mentioned here - #64694 (comment)
How?
There seems to be a filter for pattern blocks that adds a custom block icon in the toolbar, and it relied on there being no existing block icon for blocks in contentOnly mode. So when #64694 introduced a block icon, two icons were shown.
To solve this I've added to the already complicated check on whether to render the
BlockSwitcher
.I think there's a better fix somewhere, probably refactoring how the custom block icon for patterns works. This fix will be quicker though, so I think would be worth merging first.
Testing Instructions
Screenshots or screencast
Synced pattern
Before
After
ContentOnly group (still looks the same)