Try: Block Patterns: Add support for icons and display next to the pattern title in the inserter #29022
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is an exploration into adding icon support to block patterns, similar to how we can add an icon when registering a block pattern. The idea is that a plugin or theme might want to include an icon when registering a block pattern, to help highlight or distinguish between different kinds of block patterns.
For a user, when plugins or themes use an icon, it might make it easier to see where your patterns are coming from.
How has this been tested?
Manually. This is a draft PR at the moment, so I've hard-coded a test pattern that you can see under the Text category to demonstrate how it might look.
To-dos
Note: if this idea has merit, more work will need to be done to properly filter / update the icon object. For example:
pattern.icon
through normalizeIconObjectScreenshots
An example of a (very) simple pattern with an icon added:
Types of changes
New feature (non-breaking change — patterns without an icon continue to render as before in the pattern inserter).
Checklist: