From 21ba3c63de6384e8be88956ef4c56b7217e19b60 Mon Sep 17 00:00:00 2001 From: Jennifer Player Date: Wed, 14 Feb 2024 14:52:48 -0500 Subject: [PATCH] cleanup --- .../src/common/components/IAISortableItem.tsx | 45 ------------------- .../features/dnd/components/AppDndContext.tsx | 1 - .../features/dnd/components/DndSortable.tsx | 2 +- .../web/src/features/dnd/types/index.ts | 9 ---- .../Invocation/fields/LinearViewField.tsx | 2 +- 5 files changed, 2 insertions(+), 57 deletions(-) delete mode 100644 invokeai/frontend/web/src/common/components/IAISortableItem.tsx diff --git a/invokeai/frontend/web/src/common/components/IAISortableItem.tsx b/invokeai/frontend/web/src/common/components/IAISortableItem.tsx deleted file mode 100644 index fd390b6f1d..0000000000 --- a/invokeai/frontend/web/src/common/components/IAISortableItem.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { Box } from '@invoke-ai/ui-library'; -import { useDroppableTypesafe } from 'features/dnd/hooks/typesafeHooks'; -import type { TypesafeDroppableData } from 'features/dnd/types'; -import { isValidDrop } from 'features/dnd/util/isValidDrop'; -import { AnimatePresence } from 'framer-motion'; -import type { ReactNode } from 'react'; -import { memo, useRef } from 'react'; -import { v4 as uuidv4 } from 'uuid'; - -import IAIDropOverlay from './IAIDropOverlay'; - -type IAISortableItemProps = { - dropLabel?: ReactNode; - disabled?: boolean; - data?: TypesafeDroppableData; -}; - -const IAISortableItem = (props: IAISortableItemProps) => { - const { dropLabel, data, disabled } = props; - const dndId = useRef(uuidv4()); - - const { isOver, setNodeRef, active } = useDroppableTypesafe({ - id: dndId.current, - disabled, - data, - }); - - return ( - - - {isValidDrop(data, active) && } - - - ); -}; - -export default memo(IAISortableItem); diff --git a/invokeai/frontend/web/src/features/dnd/components/AppDndContext.tsx b/invokeai/frontend/web/src/features/dnd/components/AppDndContext.tsx index 799fa7135c..f800e5c869 100644 --- a/invokeai/frontend/web/src/features/dnd/components/AppDndContext.tsx +++ b/invokeai/frontend/web/src/features/dnd/components/AppDndContext.tsx @@ -19,7 +19,6 @@ const AppDndContext = (props: PropsWithChildren) => { const handleDragStart = useCallback( (event: DragStartEvent) => { - console.log('handling drag start', event.active.data.current); log.trace({ dragData: parseify(event.active.data.current) }, 'Drag started'); const activeData = event.active.data.current; if (!activeData) { diff --git a/invokeai/frontend/web/src/features/dnd/components/DndSortable.tsx b/invokeai/frontend/web/src/features/dnd/components/DndSortable.tsx index 0e2f5d537a..de82af796f 100644 --- a/invokeai/frontend/web/src/features/dnd/components/DndSortable.tsx +++ b/invokeai/frontend/web/src/features/dnd/components/DndSortable.tsx @@ -23,7 +23,7 @@ const DndSortable = (props: Props) => { const sensors = useSensors(mouseSensor, touchSensor); return ( - + {props.children} ); diff --git a/invokeai/frontend/web/src/features/dnd/types/index.ts b/invokeai/frontend/web/src/features/dnd/types/index.ts index d4dc59de98..a13ac821fe 100644 --- a/invokeai/frontend/web/src/features/dnd/types/index.ts +++ b/invokeai/frontend/web/src/features/dnd/types/index.ts @@ -80,14 +80,6 @@ export type NodeFieldDraggableData = BaseDragData & { }; }; -export type LinearViewFieldDraggableData = BaseDragData & { - payloadType: 'LINEAR_VIEW_FIELD'; - payload: { - nodeId: string; - fieldName: string; - }; -}; - export type ImageDraggableData = BaseDragData & { payloadType: 'IMAGE_DTO'; payload: { imageDTO: ImageDTO }; @@ -100,7 +92,6 @@ export type GallerySelectionDraggableData = BaseDragData & { export type TypesafeDraggableData = | NodeFieldDraggableData - | LinearViewFieldDraggableData | ImageDraggableData | GallerySelectionDraggableData; diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/LinearViewField.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/LinearViewField.tsx index 2aad446ddf..106e307889 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/LinearViewField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/LinearViewField.tsx @@ -23,7 +23,7 @@ const LinearViewField = ({ nodeId, fieldName }: Props) => { const dispatch = useAppDispatch(); const { isMouseOverNode, handleMouseOut, handleMouseOver } = useMouseOverNode(nodeId); const { t } = useTranslation(); - + const handleRemoveField = useCallback(() => { dispatch(workflowExposedFieldRemoved({ nodeId, fieldName })); }, [dispatch, fieldName, nodeId]);