Problem Statement
When a response field nested inside a section is selected and its Logic Editor Required control is changed, the change is applied to the parent section instead of the nested child field.
Sections can be required. This ticket does not change section-required behavior. It fixes the Logic Editor update target when editing a child within a selected section.
Root Cause
EditPanel correctly resolves the nested child as logicField when a section and child are selected. However, onUpdateDef uses handleUpdate, which calls selectedField_.update(patch). selectedField_ is bound to selectedFieldId, the parent section.
For a root field, selectedFieldId and logicField.definition.id are the same, so the control works. For a nested child, they differ, so the parent section receives the Required patch.
Proposed Solution
Bind the Logic Editor update callback to logicField.definition.id rather than the selected parent field. Retain the existing selected-field callback for the Edit tab, which edits the selected field itself.
Implementation Checklist
Technical Considerations
- Core
updateField(fieldId, patch) supports nested field IDs, so no core validation or renderer changes are required.
- Do not hide Required for sections or remove sections from
NON_INPUT_TYPES; that was based on an incorrect interpretation of the reported issue.
- The issue affects other Logic Editor definition updates routed through
onUpdateDef, not only the Required segmented control. The regression test should exercise the callback path generally where practical.
Success Criteria
- Changing Required for a nested child updates that child definition.
- The parent section definition is unchanged.
- Required behavior remains unchanged for sections and root-level response fields.
- Automated coverage prevents a parent/child callback binding regression.
Related Files
packages/builder/src/lib/components/edit-panel/EditPanel.tsx
packages/builder/src/lib/components/edit-panel/LogicEditor.tsx
Problem Statement
When a response field nested inside a section is selected and its Logic Editor Required control is changed, the change is applied to the parent section instead of the nested child field.
Sections can be required. This ticket does not change section-required behavior. It fixes the Logic Editor update target when editing a child within a selected section.
Root Cause
EditPanelcorrectly resolves the nested child aslogicFieldwhen a section and child are selected. However,onUpdateDefuseshandleUpdate, which callsselectedField_.update(patch).selectedField_is bound toselectedFieldId, the parent section.For a root field,
selectedFieldIdandlogicField.definition.idare the same, so the control works. For a nested child, they differ, so the parent section receives the Required patch.Proposed Solution
Bind the Logic Editor update callback to
logicField.definition.idrather than the selected parent field. Retain the existing selected-field callback for the Edit tab, which edits the selected field itself.Implementation Checklist
packages/builder/src/lib/components/edit-panel/EditPanel.tsxso Logic Editor definition patches targetlogicField.definition.id.pnpm format:check.Technical Considerations
updateField(fieldId, patch)supports nested field IDs, so no core validation or renderer changes are required.NON_INPUT_TYPES; that was based on an incorrect interpretation of the reported issue.onUpdateDef, not only the Required segmented control. The regression test should exercise the callback path generally where practical.Success Criteria
Related Files
packages/builder/src/lib/components/edit-panel/EditPanel.tsxpackages/builder/src/lib/components/edit-panel/LogicEditor.tsx