close
Skip to content

Tabs: Rename tabs blocks to follow WCAG Tabs pattern#77418

Merged
t-hamano merged 11 commits into
WordPress:trunkfrom
shrivastavanolo:blocks/tabs-rename-inner-blocks
Apr 22, 2026
Merged

Tabs: Rename tabs blocks to follow WCAG Tabs pattern#77418
t-hamano merged 11 commits into
WordPress:trunkfrom
shrivastavanolo:blocks/tabs-rename-inner-blocks

Conversation

@shrivastavanolo
Copy link
Copy Markdown
Contributor

@shrivastavanolo shrivastavanolo commented Apr 16, 2026

What?

Closes #77341

Updates the naming of Tabs inner blocks to follow a clearer pattern aligned with WCAG Tabs pattern

Why?

The current naming of Tabs-related blocks (e.g., “Tabs Menu”, “Tab Menu Item”) can be confusing for users.

How?

  • Updated block titles in block.json files:

    • Tabs MenuTab List
    • Tab Menu ItemTab
    • TabTab Panel
    • Tab PanelTab Panels
  • Updated generated documentation to reflect the new naming.

No changes were made to block names (core/...), only user-facing labels/titles were updated.

Testing Instructions

  1. Open a post or page in the editor
  2. Insert the Tabs block
  3. Verify the inner blocks:
    • “Tab List” appears instead of “Tabs Menu”
    • “Tab” appears instead of “Tab Menu Item”
    • “Tab Panels” container is correctly labeled
    • “Tab Panel” is used for individual panels
  4. Add a new tab using the toolbar
    • Confirm the default label reflects the updated naming
  5. Ensure functionality of tabs (switching, adding, removing) remains unchanged

Screenshots or screencast

Before After
before after

Use of AI Tools

Used AI assistance (Claude.ai) for drafting the PR description. All code changes were implemented and reviewed manually.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Apr 16, 2026
@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Tabs Affects the Tabs Block labels Apr 16, 2026
@shrivastavanolo shrivastavanolo force-pushed the blocks/tabs-rename-inner-blocks branch from cf4bad5 to 50cd83c Compare April 16, 2026 12:38
@shrivastavanolo shrivastavanolo marked this pull request as ready for review April 16, 2026 13:39
@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: shrivastavanolo <shreya0shrivastava@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: mikachan <mikachan@git.wordpress.org>

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

Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

No changes were made to block names (core/...), only user-facing labels/titles were updated.

I think changing only the visual title can be confusing because it creates an inconsistency between the title and the block name or CSS class name.

Fortunately, as this block is still in an experimental status, we can make breaking changes. Could you confirm and make changes based on the following points?

  • Directory name (Example: from packages/block-library/src/tab to packages/block-library/src/tab-panel)
  • Block name (Example: from core/tab to core/tab-panel)
  • CSS classname and CSS selector (Example: from .wp-block-tab to .wp-block-tab-panel)
  • name, parent, allowedBlocks field in block.json
  • Context keys (Example: from core/tabs-menu-item-label to `core/tabs-tab-label)

Most of the work should be complete with bulk replacement in a code editor.

Alternatively, it should be sufficient to instruct the AI agent to change directory names, file names, variable names, etc., in accordance with the visual title change of the tab-related block., for example.

@shrivastavanolo
Copy link
Copy Markdown
Contributor Author

@t-hamano Thanks for the review, that makes sense. I’ll go ahead and make the changes.

Quick question: do we also want to update any icon names (if they reference the old block naming), or should those remain unchanged?

@t-hamano
Copy link
Copy Markdown
Contributor

Quick question: do we also want to update any icon names (if they reference the old block naming), or should those remain unchanged?

That's a good question. I think we should update all related icon names as well.

As a point of caution, this would be a breaking change for consumers who use the @wordpress/icons package, so it would be good to update the CHANGELOG.

You can create a new "Breaking Changes" section under the "Unreleased" section.

@shrivastavanolo shrivastavanolo force-pushed the blocks/tabs-rename-inner-blocks branch from a9b388f to 6ff9c6d Compare April 17, 2026 12:33
@github-actions github-actions Bot added the [Package] Icons /packages/icons label Apr 17, 2026
@shrivastavanolo
Copy link
Copy Markdown
Contributor Author

@t-hamano Thanks for the clarification! I’ve made the updates accordingly.

Summary of changes:

  • Renamed Tabs-related blocks to align with the new naming (directory names, block names, and block.json updates)
  • Updated corresponding CSS classnames and selectors
  • Updated context keys and related references
  • Renamed associated icons in @wordpress/icons to match the new naming
  • Added a Breaking Changes entry in the CHANGELOG for the icon updates

Tested on my end (adding/ removing tabs, etc.)

Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the update! This might be a bit detailed, but I think we can update the following as well.

  • use-tab-menu-sync.js > use-tab-list-sync.js
  • useTabMenuSync >useTabListSync
  • tabsMenuClientId > tabListClientId
  • menuItems, menuItemCountChange, menuItemsInserted, prevMenuItems, newMenuItemBlock etc. > It would probably be best to replace menuItems with tabs.
  • tabPanelClientId > tabPanelClientId

Maintaining consistency in terminology throughout the project will be helpful for other contributors when they read the code in the future.

@shrivastavanolo shrivastavanolo force-pushed the blocks/tabs-rename-inner-blocks branch from 17f9dbb to e5d06a0 Compare April 21, 2026 10:02
@shrivastavanolo
Copy link
Copy Markdown
Contributor Author

Hi @t-hamano I’ve updated the remaining references to keep the terminology consistent (useTabListSync, tabListClientId, tabs, etc.) + tested the functionality (adding, reordering tabs, etc.). Let me know if anything else needs adjustment.

Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! I believe everything has been processed correctly. Please check the last feedback I left.

Comment thread packages/icons/CHANGELOG.md Outdated
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
@t-hamano t-hamano added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Apr 22, 2026
@github-actions github-actions Bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Apr 22, 2026
@t-hamano t-hamano merged commit 3e22181 into WordPress:trunk Apr 22, 2026
44 of 45 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.1 milestone Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Tabs Affects the Tabs Block [Package] Block library /packages/block-library [Package] Icons /packages/icons [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tabs: Rename tabs blocks

2 participants