diff --git a/invokeai/frontend/web/public/assets/images/popoverImages/image-2.png b/invokeai/frontend/web/public/assets/images/popoverImages/image-2.png deleted file mode 100644 index 8db14cde13..0000000000 Binary files a/invokeai/frontend/web/public/assets/images/popoverImages/image-2.png and /dev/null differ diff --git a/invokeai/frontend/web/public/assets/images/popoverImages/image.png b/invokeai/frontend/web/public/assets/images/popoverImages/image.png deleted file mode 100644 index 3c882aec48..0000000000 Binary files a/invokeai/frontend/web/public/assets/images/popoverImages/image.png and /dev/null differ diff --git a/invokeai/frontend/web/src/features/dnd/components/DndSortable.tsx b/invokeai/frontend/web/src/features/dnd/components/DndSortable.tsx index b04980f6cf..786e1ce9c2 100644 --- a/invokeai/frontend/web/src/features/dnd/components/DndSortable.tsx +++ b/invokeai/frontend/web/src/features/dnd/components/DndSortable.tsx @@ -1,5 +1,4 @@ import type { DragEndEvent } from '@dnd-kit/core'; -import { MouseSensor, TouchSensor, useSensor, useSensors } from '@dnd-kit/core'; import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable'; import type { PropsWithChildren } from 'react'; import { memo } from 'react'; @@ -12,18 +11,8 @@ type Props = PropsWithChildren & { }; const DndSortable = (props: Props) => { - const mouseSensor = useSensor(MouseSensor, { - activationConstraint: { distance: 10 }, - }); - - const touchSensor = useSensor(TouchSensor, { - activationConstraint: { distance: 10 }, - }); - - const sensors = useSensors(mouseSensor, touchSensor); - return ( - <DndContextTypesafe onDragEnd={props.onDragEnd} sensors={sensors}> + <DndContextTypesafe onDragEnd={props.onDragEnd}> <SortableContext items={props.items} strategy={verticalListSortingStrategy}> {props.children} </SortableContext> 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 afd64ca0bd..d0a30ecc3c 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 @@ -3,12 +3,13 @@ import { CSS } from '@dnd-kit/utilities'; import { Flex, Icon, IconButton, Spacer, Tooltip } from '@invoke-ai/ui-library'; import { useAppDispatch } from 'app/store/storeHooks'; import NodeSelectionOverlay from 'common/components/NodeSelectionOverlay'; +import { useFieldOriginalValue } from 'features/nodes/hooks/useFieldOriginalValue'; import { useMouseOverNode } from 'features/nodes/hooks/useMouseOverNode'; import { workflowExposedFieldRemoved } from 'features/nodes/store/workflowSlice'; import { HANDLE_TOOLTIP_OPEN_DELAY } from 'features/nodes/types/constants'; import { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; -import { PiDotsSixVerticalBold, PiInfoBold, PiTrashSimpleBold } from 'react-icons/pi'; +import { PiArrowCounterClockwiseBold, PiDotsSixVerticalBold, PiInfoBold, PiTrashSimpleBold } from 'react-icons/pi'; import EditableFieldTitle from './EditableFieldTitle'; import FieldTooltipContent from './FieldTooltipContent'; @@ -21,6 +22,7 @@ type Props = { const LinearViewField = ({ nodeId, fieldName }: Props) => { const dispatch = useAppDispatch(); + const { isValueChanged, onReset } = useFieldOriginalValue(nodeId, fieldName); const { isMouseOverNode, handleMouseOut, handleMouseOver } = useMouseOverNode(nodeId); const { t } = useTranslation(); @@ -62,6 +64,16 @@ const LinearViewField = ({ nodeId, fieldName }: Props) => { <Flex alignItems="center"> <EditableFieldTitle nodeId={nodeId} fieldName={fieldName} kind="input" /> <Spacer /> + {isValueChanged && ( + <IconButton + aria-label={t('nodes.resetToDefaultValue')} + tooltip={t('nodes.resetToDefaultValue')} + variant="ghost" + size="sm" + onClick={onReset} + icon={<PiArrowCounterClockwiseBold />} + /> + )} <Tooltip label={<FieldTooltipContent nodeId={nodeId} fieldName={fieldName} kind="input" />} openDelay={HANDLE_TOOLTIP_OPEN_DELAY}