Skip to content

Try: Remove Tab (Tab list item) block #77439

Merged
t-hamano merged 6 commits into
trunkfrom
remove-tabs-menu-item-block
Jun 11, 2026
Merged

Try: Remove Tab (Tab list item) block #77439
t-hamano merged 6 commits into
trunkfrom
remove-tabs-menu-item-block

Conversation

@t-hamano

@t-hamano t-hamano commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Part of #73230

What?

This PR attempts to completely remove the 'Tab' block (the tab button block that lives inside 'Tab List') and instead manage the tab count and labels as a tabs attribute on the Tab List block, rendering them as button elements rather than blocks.

Before After
image image

Why?

The main issue is that when styling individual Tab buttons at the block instance level, you either have to style each Tab button individually or select them all beforehand. Furthermore, you need to apply the styles every time you add a tab. This problem becomes even more complex if you want to control the styling of the active Tab button using @current in the future.

A similar issue occurs with Tab Panels, but many users would likely want to style the Tab buttons rather than the panel itself.

How?

This approach has its advantages and disadvantages. Personally, I believe the advantages outweigh the disadvantages, but I would like to hear your thoughts.

  • The relationship between Tab buttons and Tab Panels becomes weak.
  • It becomes impossible to apply styles to individual Tab buttons separately.

Testing Instructions

  • Smoke test the Tabs block.
  • Select the Tab List block and try applying styles.
  • Adding or removing tabs will function as before.

Use of AI Tools

This PR was authored with Claude Code (claude-opus-4-6). All changes were reviewed and approved by the contributor.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Apr 17, 2026
@github-actions

github-actions Bot commented Apr 17, 2026

Copy link
Copy Markdown

Size Change: -733 B (-0.01%)

Total Size: 8.46 MB

📦 View Changed
Filename Size Change
build/scripts/block-library/index.min.js 323 kB -431 B (-0.13%)
build/scripts/patterns/index.min.js 7.96 kB +1 B (+0.01%)
build/styles/block-library/editor-rtl.css 12.5 kB -16 B (-0.13%)
build/styles/block-library/editor-rtl.min.css 10.3 kB -24 B (-0.23%)
build/styles/block-library/editor.css 12.5 kB -16 B (-0.13%)
build/styles/block-library/editor.min.css 10.3 kB -25 B (-0.24%)
build/styles/block-library/style-rtl.css 21.7 kB +6 B (+0.03%)
build/styles/block-library/style-rtl.min.css 18.2 kB +5 B (+0.03%)
build/styles/block-library/style.css 21.8 kB +6 B (+0.03%)
build/styles/block-library/style.min.css 18.1 kB +6 B (+0.03%)
build/styles/block-library/tab-list/editor-rtl.css 196 B +89 B (+83.18%) 🆘
build/styles/block-library/tab-list/editor-rtl.min.css 164 B +67 B (+69.07%) 🆘
build/styles/block-library/tab-list/editor.css 196 B +89 B (+83.18%) 🆘
build/styles/block-library/tab-list/editor.min.css 163 B +66 B (+68.04%) 🆘
build/styles/block-library/tab-list/style-rtl.css 424 B +424 B (new file) 🆕
build/styles/block-library/tab-list/style-rtl.min.css 380 B +380 B (new file) 🆕
build/styles/block-library/tab-list/style.css 425 B +425 B (new file) 🆕
build/styles/block-library/tab-list/style.min.css 381 B +381 B (new file) 🆕
build/styles/block-library/tab/editor-rtl.css 0 B -160 B (removed) 🏆
build/styles/block-library/tab/editor-rtl.min.css 0 B -148 B (removed) 🏆
build/styles/block-library/tab/editor.css 0 B -160 B (removed) 🏆
build/styles/block-library/tab/editor.min.css 0 B -148 B (removed) 🏆
build/styles/block-library/tab/style-rtl.css 0 B -409 B (removed) 🏆
build/styles/block-library/tab/style-rtl.min.css 0 B -365 B (removed) 🏆
build/styles/block-library/tab/style.css 0 B -410 B (removed) 🏆
build/styles/block-library/tab/style.min.css 0 B -366 B (removed) 🏆

compressed-size-action

@t-hamano t-hamano self-assigned this Apr 17, 2026
@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Tabs Affects the Tabs Block labels Apr 17, 2026
@t-hamano t-hamano changed the title Tabs: Remove tabs-menu-item block in favor of tabs-menu attributes Try: Remove Tab Menu Item block Apr 17, 2026
@t-hamano t-hamano mentioned this pull request Apr 17, 2026
14 tasks
@github-actions

github-actions Bot commented Apr 17, 2026

Copy link
Copy Markdown

Flaky tests detected in ffa2219.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27316480276
📝 Reported issues:

@t-hamano t-hamano marked this pull request as ready for review April 21, 2026 08:14
@github-actions

github-actions Bot commented Apr 21, 2026

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: t-hamano <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: iamtakashi <[email protected]>

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

@t-hamano t-hamano force-pushed the remove-tabs-menu-item-block branch from c1582fb to ed353e2 Compare April 22, 2026 05:54
@t-hamano t-hamano changed the title Try: Remove Tab Menu Item block Try: Remove Tab block Apr 22, 2026
@t-hamano t-hamano force-pushed the remove-tabs-menu-item-block branch 2 times, most recently from b2c0b14 to 5842bef Compare April 22, 2026 06:02
@t-hamano t-hamano changed the title Try: Remove Tab block Try: Remove Tab (Tab list item) block Apr 22, 2026
@t-hamano t-hamano force-pushed the remove-tabs-menu-item-block branch from 5842bef to 97c311a Compare May 8, 2026 02:34
@t-hamano t-hamano force-pushed the remove-tabs-menu-item-block branch from 97c311a to 22d2bb7 Compare May 21, 2026 08:26
@iamtakashi

iamtakashi commented Jun 1, 2026

Copy link
Copy Markdown

@t-hamano, will this change break the contents that use the current experimental tabs block?

@t-hamano

t-hamano commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

will this change break the contents that use. the current experimental tabs block?

That's right. The reason we are keeping this block in an experimental status is to make disruptive changes like this PR.

@iamtakashi

Copy link
Copy Markdown

That's fair. Do you have any idea when the block will officially launch?

@jasmussen

Copy link
Copy Markdown
Contributor

I very much endorse this PR, it works well in my testing, and makes the block substantially easier to interact with. It even simplifies the styling aspect, avoiding the need to clone styles from one tab to the other. The downside—the theoretical inability to style individual tabs individually—feels like a valid tradeoff to make: there's room for plugin-tab-blocks that offer such a level of customisation, as it's a level that doesn't feel like it belongs in core.

Is there anything I can do to help this PR ship?

@t-hamano

t-hamano commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback!

It even simplifies the styling aspect, avoiding the need to clone styles from one tab to the other.

That's right. Another advantage is that if active tab styling is supported via "State" in the future, styling can be simplified. One of my ideas is to support "attribute" states in the future, in addition to the viewport and pseudo-states. This means something like the following:

tab-list.mp4

I'm thinking this approach might also be useful for applying styles when the Details block is opened (open attribute) or when the Accordion Heading block is expanded (aria-expanded="true" attribute), but this is just a thought. cc @talldan @tellthemachines

Is there anything I can do to help this PR ship?

One thing we need to decide is whether to remove the tab block icon from the icons package in this PR. What are your thoughts?

@jasmussen

Copy link
Copy Markdown
Contributor

Love it. Keep in mind Navigation menu active state too! I think that may already be planned (CC: @MaggieCabrera), and we can unify the approach here.

One thing we need to decide is whether to remove the tab block icon from the icons package in this PR. What are your thoughts?

If it hasn't been published yet in the library, yes, let's remove. The SVG values are around, they're easy to resurrect if we need them, and I always defer to starting with less then re-adding if necessary.

t-hamano and others added 2 commits June 8, 2026 19:23
The Tab block was removed, and it was the only consumer of the `tab`
icon. Drop the icon's source SVG and manifest entry, regenerate the
library, and note the breaking change in the changelog.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@github-actions github-actions Bot added the [Package] Icons /packages/icons label Jun 8, 2026
t-hamano and others added 2 commits June 8, 2026 20:12
Rendering RichText with tagName="button" made the editable element a
native button, which consumes the Space key for activation and prevents
inserting spaces in the label. Wrap a tagName="span" RichText inside the
button instead, matching the prior structure the focus logic already
assumes (it queries the button for a contenteditable child).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The Tab block was removed, so regenerate the docs manifest to remove its
now-dangling reference to the deleted tab README.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@t-hamano

t-hamano commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

@mikachan @sethrubenstein @carolinan, I welcome any feedback on this PR.

@jasmussen jasmussen self-requested a review June 11, 2026 07:59

@jasmussen jasmussen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

From an experience and simplicity POV, this feels like the right path to me and a much leaner user experience.

@t-hamano

Copy link
Copy Markdown
Contributor Author

Let's try this PR. Since this block is still in experimental status, we can change the approach later if necessary.

@t-hamano t-hamano merged commit 0c36e05 into trunk Jun 11, 2026
43 checks passed
@t-hamano t-hamano deleted the remove-tabs-menu-item-block branch June 11, 2026 09:17
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 11, 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.

3 participants