Skip to content

The show button text label feature should not rely on a global classname #46025

Open

Description

@youknowriad

Description

If you toggle the "show button text label" feature, a classname "show-icon-labels" is added as a top level element of the editors and components from the "block-editor" package check the presence of a global classname to trigger or not text labels on icon buttons.

I see two issues with this approach:

  • The classname is not an actual API, it could be considered but I think it's not ideal.
  • Performance could be impacted since changing a global classname re-renders all components that are children of the root component where the classname is applied.

Potential approaches:

  • Adding a showIconLabels prop to UI components like BlockToolbar...
  • or Adding a showIconLabels setting to the BlockEditorProvider settings prop.

I think I prefer the first approach if possible but the second is ok too.

Step-by-step reproduction instructions

Trigger the "show button text labels" option in the preferences modal.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Activity

  1. added
    [Priority] LowUsed to indicate that the issue at hand isn't a top priority to address and can be handled later
    [Type] Code QualityIssues or PRs that relate to code quality
    on Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Priority] LowUsed to indicate that the issue at hand isn't a top priority to address and can be handled later[Type] Code QualityIssues or PRs that relate to code quality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions