Skip to content

Pattern Overrides: Refactor block toolbar indicator #65058

Open
@talldan

Description

See #65054
Related #62514

Inner blocks of patterns currently use a custom filter to add a block icon to the toolbar. See this code:

return hasPatternOverrides && hasParentPattern ? (
<BlockControls group="parent">
<PatternOverridesToolbarIndicator clientIds={ clientIds } />
</BlockControls>

It was implemented this way in #62514 to try to extract the pattern specific code from the block editor package. It also worked since the pattern block leveraged contentOnly mode where selected blocks didn't have a block icon. That is until #64694 added a block icon for contentOnly blocks.

It's pretty clear now that the abstraction for pattern overrides needs to be changed, so that rather than adding a custom icon, the normal block icon is used instead. Here's the tasks:

  • Remove the filter approach and instead use the regular block icon in the toolbar, revert De-duplicate block toolbar icons for patterns #65054 in the process
  • Find a way to make the overridden block icons have the purple color, maybe a declarative way to mark the overridden blocks as 'synced'.
  • Find a way to display this message in the block switcher dropdown, or reconsider whether it's needed:
Screenshot 2024-09-04 at 3 09 39 PM

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions