[6.x] Forms 2: Logic Tree#14811
Merged
Merged
Conversation
…s be "above" the destination
…rray between browsers (Safari and Chrome)
grouped fields were half-removed in 6e6fa36, but alot of related code still remained. this commit finishes getting rid of them, simplifying the code. (groups only have 1 field in them, so it's a pretty safe refactor)
duncanmcclean
approved these changes
Jul 6, 2026
Member
|
Thanks, Jay! I've refactored some things behind the scenes to make things more consistent w/ the form builder, added the ability to reorder fields and utilised the When you're back, you might want to tweak the design of the splitter/logic box. I just went with what Claude generated but not sure that's necessarily what we want. Up to you! 😄 |
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 implements a tree view for the form Logic tab — a visual, column-per-page overview of a form's pages, sections and fields, with drag-and-drop reordering and inline editing of each field's (or page's) logic.
This PR also refactors the Logic page to share the form builder's nested form-fields data model, so both tabs serialise fields through a single path.
Tree view
A new List / Tree toggle sits on the Logic tab (the chosen view is remembered per user).
The tree renders one column per page, with:
Fieldset imports appear as a single grouped node, mirroring how they're treated in the form builder.
Editing logic
Clicking a field or page opens a resizable panel beneath the tree (using the
Splittercomponent) to edit its logic without leaving the view:Pressing escape deselects. The final page and imported fields aren't selectable, since they can't hold logic.
Reordering
Fields — and whole fieldset imports — can be dragged to reorder them within a section, between sections, and across pages. The new order is persisted on save.
Shared data model
Previously the Logic page kept its own flattened representation of a form's fields and a bespoke merge on save. This PR reworks it to hold the same nested
formFieldsstructure as the form builder and round-trip it through the sharedFormFieldTransformer.The
toVue/fromVueconversion now lives in theManagesFormFieldstrait, used by both the builder and logic controllers. As a resultFormLogicControllersheds its bespoke serialisation/merge code, and reordering, imported fields and referenced-field logic (stored underconfig) all round-trip consistently between the two tabs.Screenshot
Related: #14909