Add the possibility to define field layout tabs - #789
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for organizing field layout sections into tabs, providing a cleaner UI for complex page forms. The translation key for "Status" has been moved from panel-specific (panel.pages.page.status) to general page translations (page.status) for better reusability.
- Introduced
TabandTabCollectionclasses to manage tab definitions in field layouts - Updated the sections view to render tabs and group sections by tab assignment
- Added JavaScript component for client-side tab switching behavior
- Enhanced CSS styling for tab UI components with focus states
Reviewed Changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| site/schemes/pages/page.yaml | Added tabs configuration and assigned sections to tabs (content/options) |
| site/schemes/pages/blog.yaml | Updated blog section to reference parent tabs via tab: options |
| panel/views/pages/tree.php | Updated translation key from panel.pages.page.status to page.status |
| panel/views/pages/editor.php | Removed unnecessary wrapper div around fields insertion |
| panel/views/fields/layout/sections.php | Implemented tab rendering with grouped sections and tab panels |
| panel/views/fields.php | Added conditional logic to pass tabs collection to layout view |
| panel/translations/*.yaml | Removed panel.pages.page.status entries across all language files |
| formwork/translations/*.yaml | Added page.status entries across all language files |
| panel/src/ts/components/tabs.ts | New TypeScript component for tab switching functionality |
| panel/src/ts/app.ts | Integrated Tabs component into application initialization |
| panel/src/scss/components/_tabs.scss | Enhanced tab styles with borders, focus states, and panel visibility |
| formwork/src/Fields/Layout/TabCollection.php | New collection class for managing Tab instances |
| formwork/src/Fields/Layout/Tab.php | New class representing individual tabs with name, label, and order |
| formwork/src/Fields/Layout/SectionCollection.php | Updated to pass section name to Section constructor |
| formwork/src/Fields/Layout/Section.php | Added name property and getter, updated docstring |
| formwork/src/Fields/Layout/Layout.php | Added tabs support, deprecated type property, added tabs() getter |
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
giuscris
force-pushed
the
feature/layouts-tabs
branch
2 times, most recently
from
November 18, 2025 22:12
544c435 to
22d53d9
Compare
giuscris
force-pushed
the
feature/layouts-tabs
branch
from
November 19, 2025 00:03
22d53d9 to
486d1b7
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated 7 comments.
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This pull request introduces a new tab system for layouts in the Formwork CMS, including backend PHP classes for managing tabs, frontend SCSS and TypeScript for rendering and interaction, and updates to translation files to support the new "status" field in multiple languages. The changes are grouped into backend logic for tabs, frontend tab UI implementation, and translation updates.
Backend: Tab System Implementation
TabandTabCollectionclasses to manage tab data within layouts, similar to how sections are managed. (formwork/src/Fields/Layout/Tab.php[1]formwork/src/Fields/Layout/TabCollection.php[2]Layoutclass to support tabs: added atabsproperty, atabs()method for retrieving them, and adjusted the constructor and type property handling. (formwork/src/Fields/Layout/Layout.php[1] [2]SectionandSectionCollectionclasses to include section names as properties and constructor arguments, aligning them with the new tab structure. (formwork/src/Fields/Layout/Section.php[1] [2]formwork/src/Fields/Layout/SectionCollection.php[3]Frontend: Tab UI Implementation
panel/src/scss/components/_tabs.scsspanel/src/scss/components/_tabs.scssR18-R55)TabsTypeScript class to handle tab switching logic in the panel UI, and registered it in the main app initialization. (panel/src/ts/components/tabs.ts[1]panel/src/ts/app.ts[2] [3]Translations
formwork/translations/de.yaml[1]formwork/translations/en.yaml[2]formwork/translations/es.yaml[3]formwork/translations/fr.yaml[4]formwork/translations/it.yaml[5]formwork/translations/nl.yaml[6]formwork/translations/pl.yaml[7]formwork/translations/pt.yaml[8]formwork/translations/ro.yaml[9]formwork/translations/ru.yaml[10]formwork/translations/uk.yaml[11]These changes lay the groundwork for layouts with tabbed interfaces in both backend data structures and the frontend panel, and ensure that the new "status" field is properly localized.