Repository navigation
feat: sections shown as tabs - #103
Merged
Merged
Conversation
Consecutive sections flagged `tab` render as one group of tabs, each a whole section; an accordion on a phone. Grouping is read at render time from each mode's settings, never written on a move, delete or insert. - Builder: "Turn into tabs" on the section toolbar (one undo step), "+ Tab" in the group's nav, a click on a tab selects its section, the sidebar's Tab panel (title, subtitle, icon, style, new group). - Tab styles: underline, pills and cards built in; hosts add their own through `content_blocks.section.tab_styles` or a `TabStyleProviderInterface`, with their own fields and tab template. - Nesting: a tab may show its columns as tabs or an accordion on desktop and tablet; on a phone it stacks them under their titles. - The navigator names a tab by its title. - Covered by both published-render immutability nets and a dedicated Playwright spec.
- Headless: each section carries `tab` and `tabGroup` (its group's first section id, by the HTML render's rule); the tree stays flat. - `#anchor-N` inside a section tab now opens the section tab and then the column panel; it stopped after the section tab. - A duplicated, pasted or template-inserted tab joins the group it lands next to: the copy drops `tabNewGroup`, which split the group when its first tab was duplicated. Import and Insert content keep it.
The title and subtitle of a section shown as a tab live in a new table, cb_section_translation, beside the column titles, and follow every flow a block translation does: render with per-field fallback, Publish/Discard, duplicate, template and clipboard, export/import, the workbench and the machine run. Core gains SectionSettingsResolverInterface and SectionCloneObserverInterface for it.
A saved tab shows its tab on the library thumbnail, the tab icon is hidden from assistive technology (the SEO audit no longer reports it), the guide joins the docs site, and the backward-compatibility page covers the tab styles, the new seams, the tab template's variables and the new table.
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.
Summary
Sections can be shown as tabs: when a tab needs its own columns, background or spacing, each tab is a whole section. Consecutive sections flagged
tabform one group.The branch also carries the groundwork it builds on (first commit): section anchors, tabs and panels opened from the URL, the slider peek and a section gutter.
Core (
klehm/content-blocks)POST /section/{id}/tabs, adds a second tab, one undo step). Start a new tab group splits a run. At most 20 tabs per group.underline(default),pills,cards. Hosts add, restyle or hide one throughcontent_blocks.section.tab_stylesorTabStyleProviderInterface. ATabStylenames the fields its tab shows and may bring its own template. Host fields join the Tab panel through a form type extension andSectionSettingsType::tabStyleCondition()..cb-col-titleheadings instead (the sidebar offers only Grid and Slider on mobile there).#anchoropens a tab, and#anchor-Nits N-th column.tab,tabGroup) show tabs.SectionSettingsResolverInterfaceandSectionCloneObserverInterface, the section twins of the column ones.i18n (
klehm/content-blocks-i18n)cb_section_translation(migrationVersion20261203120000in the sandbox).section-{id}) and machine translation.Docs
docs/guide/section-tabs.md, added to the site menu.docs/internals/rendering.md#section-tabsanddocs/internals/i18n.md#section-tabs-are-translated-beside-the-section.Test plan
section-tabs.spec.js, the immutability net and the workbench translating a section tab; Encore suite 11/11