Skip to content

[6.x] Fieldset sections#14297

Open
jackmcdade wants to merge 5 commits into6.xfrom
fieldset-sections
Open

[6.x] Fieldset sections#14297
jackmcdade wants to merge 5 commits into6.xfrom
fieldset-sections

Conversation

@jackmcdade
Copy link
Member

@jackmcdade jackmcdade commented Mar 19, 2026

Adds support for sections inside fieldsets and makes blueprint fieldset imports section-aware.

  • Fieldsets can now be authored with section structure (while flat fieldsets remain supported).
  • Blueprint imports now support section_behavior with preserve (default) or flatten.
  • CP import UI now indicates when a linked fieldset has sections and exposes section behavior controls only when relevant.

Notes

  • Flat fieldsets are kept flat on save (single default “Fields” section is collapsed back to fields).
  • Preserved sections will split the current section out wherever it is. If there are fields after it, they will be in their own section below the imported fieldset section.
  • Includes backend + CP updates and test coverage for parsing, rendering, import behavior, and persistence.
CleanShot 2026-03-18 at 22 14 57@2x CleanShot 2026-03-18 at 22 15 24@2x CleanShot 2026-03-18 at 22 48 53@2x

References statamic/ideas#988


Note

Medium Risk
Introduces a new sections structure for fieldsets and changes how blueprint tabs expand imported fieldsets, which can affect persisted YAML shape and publish UI rendering. Risk is mitigated by normalization/back-compat handling and added test coverage, but impacts core field configuration flows.

Overview
Fieldsets can now be authored and edited with sections, and the CP fieldset editor has been updated to use the shared Sections UI (including section/field drag-and-drop) while still collapsing a single default “Fields” section back to flat fields on save.

Blueprint fieldset imports are now section-aware: when importing a sectioned fieldset, imports can either preserve sections (expanding them into publish sections) or flatten them into the current section. The import UI exposes this via a new Section Behavior setting and shows badges indicating when a linked fieldset has sections.

Backend support includes fieldset normalization for legacy field syntax inside sections, new has_sections/sections_count metadata in fieldset props, FieldTransformer support for serializing section_behavior, and updated controllers/tests to cover section persistence, conversion between flat/sectioned forms, and publish expansion behavior.

Written by Cursor Bugbot for commit 0889c06. This will update automatically on new commits. Configure here.

@jackmcdade jackmcdade requested a review from jasonvarga March 19, 2026 02:18
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

:initial-sections="sections"
:show-section-collapsible-field="true"
@updated="sections = $event"
/>
Copy link

Choose a reason for hiding this comment

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

Missing exclude-fieldset allows self-referencing fieldset imports

Medium Severity

The old code passed :exclude-fieldset="fieldset.handle" to the Fields component, which filtered the current fieldset out of the "Link Fields" dropdown to prevent self-referencing imports. The new code uses the Sections component, which doesn't accept or propagate an exclude-fieldset prop down to its inner Fields component. This allows users to link a fieldset to itself, which would cause a recursion error only caught at save time by validateRecursion().

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant