Tabs: Lock top-level structure and disable visibility controls#77370
Tabs: Lock top-level structure and disable visibility controls#77370
Conversation
|
Size Change: +22 B (0%) Total Size: 7.75 MB 📦 View Changed
ℹ️ View Unchanged
|
Prevent users from removing or reordering the tabs menu and panels by locking the parent Tabs template, and hide the visibility panel on tab blocks where per-block hiding is not meaningful. Inner menu items remain editable so tabs can still be added or rearranged.
e3475c8 to
96c2efe
Compare
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 058867b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24494806417
|
mikachan
left a comment
There was a problem hiding this comment.
This tests well for me and the changes look good, thank you! It makes sense to do this for the top-level Tabs Menu and Tab Panel blocks.
Not a blocker, but should we also remove the lock attributes from the TABS_TEMPLATE in tabs/edit.js?
The parent `useInnerBlocksProps` already sets `templateLock: 'all'`,
which cascades to descendants and prevents removal/insertion/move.
The per-child `lock: { remove: true }` entries were therefore no-ops.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Nice catch! Removed in 058867b |
What?
Removes unnecessary block-editor features from the Tabs block and its inner blocks:
Why?
The Tabs block only works when its fixed structure — a single Tabs Menu paired with a Tab Panel — is preserved. Allowing the menu or panel to be deleted, duplicated, or hidden via the visibility control produces broken semantics.
How?
Testing Instructions
Screenshots or screencast
Use of AI Tools
Claude Code was used to assist with code edits and to draft this description. All changes were reviewed by the author.