Skip to content

Edit Site: Move show-icon-labels handling to specific edit-site call sites#77287

Merged
mirka merged 2 commits into
WordPress:trunkfrom
yogeshbhutkar:fix(admin-ui)/show-icon-labels
Apr 15, 2026
Merged

Edit Site: Move show-icon-labels handling to specific edit-site call sites#77287
mirka merged 2 commits into
WordPress:trunkfrom
yogeshbhutkar:fix(admin-ui)/show-icon-labels

Conversation

@yogeshbhutkar
Copy link
Copy Markdown
Contributor

What?

Follow up to #77088

This PR extracts the show-icon-labels class handling from the shared/global location and moves it to the specific edit-site call sites that actually require it. This is a preparatory refactoring to simplify an upcoming larger change and ensure proper separation of concerns.

Why?

  1. Proper encapsulation: Since admin-ui doesn't add the show-icon-labels class itself, it shouldn't need to manage or know about it
  2. Avoid overflow risks: Global handling of this class presents overflow risks that are safer to manage locally at the specific call sites where it's actually applied
  3. Reduce PR scope: Extracting this refactoring first allows the main PR to focus on its primary functional changes without mixing them with component cleanup

How?

  • Removed show-icon-labels class handling from admin-ui
  • Added explicit show-icon-labels class management to the two specific edit-site instances that depend on it

Testing Instructions

  1. Enable the "Show button text labels" preference.
  2. Navigate to Appearance → Editor → Styles, and verify header actions display text labels.
  3. Navigate to Appearance → Editor → Patterns → Custom Pattern, and verify header actions display text labels.

Use of AI Tools

Used Claude Sonnet 4.6 to review the changes

@yogeshbhutkar yogeshbhutkar self-assigned this Apr 14, 2026
@yogeshbhutkar yogeshbhutkar added [Type] Code Quality Issues or PRs that relate to code quality [Package] Edit Site /packages/edit-site [Package] Admin UI /packages/admin-ui labels Apr 14, 2026
@yogeshbhutkar yogeshbhutkar requested a review from Copilot April 14, 2026 07:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the show-icon-labels preference styling by removing it from the shared @wordpress/admin-ui Page styles and re-scoping it to the specific edit-site header action areas that need it (Styles sidebar + Patterns page).

Changes:

  • Removed .show-icon-labels header-action button styling from @wordpress/admin-ui Page stylesheet.
  • Added edit-site scoped .show-icon-labels styles for the Styles sidebar and Patterns page header actions.
  • Introduced per-callsite action wrapper class names to target the correct header action buttons.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/edit-site/src/components/sidebar-global-styles/style.scss Adds edit-site scoped .show-icon-labels styling for Styles header actions.
packages/edit-site/src/components/sidebar-global-styles/index.js Adds a class hook on the Styles header actions container.
packages/edit-site/src/components/page-patterns/style.scss Adds edit-site scoped .show-icon-labels styling for Patterns header actions.
packages/edit-site/src/components/page-patterns/actions.js Wraps Patterns actions in an HStack to provide a styling hook.
packages/admin-ui/src/page/style.scss Removes the global .show-icon-labels header actions styling from admin-ui Page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/edit-site/src/components/page-patterns/actions.js Outdated
Comment thread packages/edit-site/src/components/page-patterns/style.scss Outdated
@github-actions
Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@yogeshbhutkar yogeshbhutkar requested a review from mirka April 14, 2026 09:19
Copy link
Copy Markdown
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected. Thanks!

@mirka mirka merged commit 2d8520a into WordPress:trunk Apr 15, 2026
52 of 53 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.1 milestone Apr 15, 2026
@yogeshbhutkar yogeshbhutkar deleted the fix(admin-ui)/show-icon-labels branch April 20, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Admin UI /packages/admin-ui [Package] Edit Site /packages/edit-site [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants