[MOOSE-360] FE: Refactor Horizontal Tabs Block#333
Merged
GeoffDusome merged 4 commits intomainfrom Mar 30, 2026
Merged
Conversation
dpellenwood
approved these changes
Mar 27, 2026
Collaborator
dpellenwood
left a comment
There was a problem hiding this comment.
🟢 This is an impressive improvement to the tabs block, Geoff. Nice work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this do/fix?
Reordering
@dnd-kit/coreand@dnd-kit/sortablewithhorizontalListSortingStrategy).moveBlockToPositionso the block tree (and saved content) stays in the correct order.innerBlocksviauseSelectanduseMemoinstead of syncing into attributes inuseEffect, so the list re-renders as soon as the block order changes.Dynamic block refactor
render.phpand no longer usessave.jsfor the outer markup.<InnerBlocks.Content />in the block’s save), so tab order comes from the saved block order.Horizontal_Tabs_Block_Controllerinplugins/core/src/Components/Blocks/builds the tab list from$block->parsed_block['innerBlocks']so order is a single source of truth and survives save/reload.Active tab behavior
Editor UX
onFocushandler that callsonSelectTab(tab.id).Accessibility
role="button",tabIndex={0},aria-pressed, and anonKeyDownhandler so Enter/Space activate the tab; key handling is skipped when focus is inside the label’scontenteditable.Theming
Buttoncomponent andvariant="link"as the delete button so it shares theme styles.--horizontal-tabs-editor-delete-colorand--horizontal-tabs-editor-delete-hover-colorineditor.pcssso they stay visible in light/dark (and brand) themes.Files changed
horizontal-tabs/edit.js,horizontal-tabs/render.php,horizontal-tabs/editor.pcss,horizontal-tabs/block.json,horizontal-tabs/index.js; removedhorizontal-tabs/save.js.Horizontal_Tabs_Block_Controller.php; no changes to the horizontal-tab child block.QA
Links to relevant issues
Screenshots/video:
Pull request checklist