From 4f2de2674e3496a37aca0ce58759fcbb27df6623 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Thu, 20 Feb 2025 15:44:45 +1000 Subject: [PATCH] feat(ui): remove extraneous formContainerChildrenReordered action --- .../nodes/components/sidePanel/builder/dnd-hooks.ts | 8 ++++---- .../web/src/features/nodes/store/workflowSlice.ts | 10 ---------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/components/sidePanel/builder/dnd-hooks.ts b/invokeai/frontend/web/src/features/nodes/components/sidePanel/builder/dnd-hooks.ts index af115cd98b..3f285a04e3 100644 --- a/invokeai/frontend/web/src/features/nodes/components/sidePanel/builder/dnd-hooks.ts +++ b/invokeai/frontend/web/src/features/nodes/components/sidePanel/builder/dnd-hooks.ts @@ -28,8 +28,8 @@ import { import { getEditModeWrapperId } from 'features/nodes/components/sidePanel/builder/shared'; import { selectNodesSlice } from 'features/nodes/store/selectors'; import { - formContainerChildrenReordered, formElementAdded, + formElementContainerDataChanged, formElementReparented, selectFormRootElementId, selectWorkflowSlice, @@ -260,7 +260,7 @@ export const useBuilderDndMonitor = () => { const container = getElement(targetElement.parentId, isContainerElement); const startIndex = container.data.children.indexOf(sourceElement.id); const indexOfTarget = container.data.children.indexOf(targetElement.id); - const reorderedLayout = reorderWithEdge({ + const reorderedChildren = reorderWithEdge({ list: container.data.children, startIndex, indexOfTarget, @@ -268,9 +268,9 @@ export const useBuilderDndMonitor = () => { axis: container.data.layout === 'row' ? 'horizontal' : 'vertical', }); dispatchAndFlash( - formContainerChildrenReordered({ + formElementContainerDataChanged({ id: container.id, - children: reorderedLayout, + changes: { children: reorderedChildren }, }), sourceElement.id ); diff --git a/invokeai/frontend/web/src/features/nodes/store/workflowSlice.ts b/invokeai/frontend/web/src/features/nodes/store/workflowSlice.ts index 48965c2c88..de1483bae8 100644 --- a/invokeai/frontend/web/src/features/nodes/store/workflowSlice.ts +++ b/invokeai/frontend/web/src/features/nodes/store/workflowSlice.ts @@ -182,15 +182,6 @@ export const workflowSlice = createSlice({ removeElement({ form, id }); delete state.formFieldInitialValues[id]; }, - formContainerChildrenReordered: (state, action: PayloadAction<{ id: string; children: string[] }>) => { - const { form } = state; - const { id, children } = action.payload; - const container = form.elements[id]; - if (!container || !isContainerElement(container)) { - return; - } - container.data.children = children; - }, formElementReparented: (state, action: PayloadAction<{ id: string; newParentId: string; index: number }>) => { const { form } = state; const { id, newParentId, index } = action.payload; @@ -338,7 +329,6 @@ export const { formElementAdded, formElementRemoved, formElementReparented, - formContainerChildrenReordered, formElementHeadingDataChanged, formElementTextDataChanged, formElementNodeFieldDataChanged,