-
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
Remove block icon from InstalledBlocksPrePublishPanel. #69046
Remove block icon from InstalledBlocksPrePublishPanel. #69046
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: -124 B (-0.01%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in dd10a65. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/13158257836
|
@@ -13,6 +13,7 @@ import InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel | |||
import getInstallMissing from './get-install-missing'; | |||
|
|||
registerPlugin( 'block-directory', { | |||
icon: undefined, |
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.
Do you mind adding a small inline comment here so it's not reverted in the future?
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.
Makes sense
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, @afercia!
What?
See #68688
See #69045
When a block is installed from the block directory,
InstalledBlocksPrePublishPanel
renders a panel in the pre-publish sidebar with information about the newly installed block.This panel also shows a
block
icon that doesn't add value and is inconsistent with its intended usage.Under the hood, it uses
PluginPrePublishPanel
. In fact, the block-directory is registered as a plugin. However,PluginPrePublishPanel
is intended to show an icon for external plugins. #53302 introduced simple logic to 1) render an icon if passed 2) otherwise show the icon registered with the plugin. The intent is to show an icon to make users understand the panel is added by a plugin.In this case the panel is added by the editor core though. It's an editor feature and it should not show a meaningless, unnecessary,
block
icon.Why?
The editor should not show unnecessary, confusing, icons.
How?
undefined
in theblock-directory
plugin registration.icon
prop specifically passed to the block directoryInstalledBlocksPrePublishPanel
.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast