diff --git a/invokeai/frontend/web/src/features/nodes/components/Invocation/InvocationNode.tsx b/invokeai/frontend/web/src/features/nodes/components/Invocation/InvocationNode.tsx index 6c610d7f34..03b69faf78 100644 --- a/invokeai/frontend/web/src/features/nodes/components/Invocation/InvocationNode.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/Invocation/InvocationNode.tsx @@ -33,9 +33,7 @@ const InvocationNode = ({ nodeId, isOpen, label, type, selected }: Props) => { <> { borderBottomRadius: withFooter ? 0 : 'base', }} > - + {outputFieldNames.map((fieldName) => ( { return ( { shouldWrapChildren > { - const { data } = props; - const dispatch = useAppDispatch(); - - const handleChangeIsIntermediate = useCallback( - (e: ChangeEvent) => { - dispatch( - fieldBooleanValueChanged({ - nodeId: data.id, - fieldName: 'is_intermediate', - value: e.target.checked, - }) - ); - }, - [data.id, dispatch] - ); - - return ( - } - /> - } - > - - - - - ); -}; - -export default memo(NodeSettings); diff --git a/invokeai/frontend/web/src/features/nodes/components/Invocation/NodeTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/Invocation/NodeTitle.tsx index 6b14d4e952..ee85c38ecc 100644 --- a/invokeai/frontend/web/src/features/nodes/components/Invocation/NodeTitle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/Invocation/NodeTitle.tsx @@ -45,7 +45,6 @@ const NodeTitle = ({ nodeId, title }: Props) => { return ( { noOfLines={1} /> { - const dispatch = useAppDispatch(); - - const selectNode = useCallback( - (e: MouseEvent) => { - dispatch(nodeClicked({ nodeId, ctrlOrMeta: e.ctrlKey || e.metaKey })); - }, - [dispatch, nodeId] - ); - - return selectNode; -}; - type NodeWrapperProps = PropsWithChildren & { nodeId: string; selected: boolean; @@ -35,7 +16,7 @@ type NodeWrapperProps = PropsWithChildren & { }; const NodeWrapper = (props: NodeWrapperProps) => { - const { width, children, nodeId, selected } = props; + const { width, children, selected } = props; const [ nodeSelectedOutlineLight, @@ -49,24 +30,23 @@ const NodeWrapper = (props: NodeWrapperProps) => { 'shadows.base', ]); - const selectNode = useNodeSelect(nodeId); + const dispatch = useAppDispatch(); const shadow = useColorModeValue( nodeSelectedOutlineLight, nodeSelectedOutlineDark ); - const shift = useAppSelector((state) => state.hotkeys.shift); const opacity = useAppSelector((state) => state.nodes.nodeOpacity); - const className = useMemo( - () => (shift ? DRAG_HANDLE_CLASSNAME : 'nopan'), - [shift] - ); + + const handleClick = useCallback(() => { + dispatch(contextMenusClosed()); + }, [dispatch]); return ( { transitionProperty: 'common', transitionDuration: '0.1s', shadow: selected ? shadow : undefined, + cursor: 'grab', opacity, }} > diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/FieldTitle.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/FieldTitle.tsx index a84358bf78..42e42fcf8a 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/FieldTitle.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/FieldTitle.tsx @@ -53,7 +53,6 @@ const FieldTitle = forwardRef((props: Props, ref) => { return ( { noOfLines={1} /> + ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/ControlNetModelInputField.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/ControlNetModelInputField.tsx index 492ec51d20..3192e7583b 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/ControlNetModelInputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/ControlNetModelInputField.tsx @@ -85,7 +85,7 @@ const ControlNetModelInputFieldComponent = ( return ( diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/ImageInputField.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/ImageInputField.tsx index 21b89c2231..7db48f5248 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/ImageInputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/ImageInputField.tsx @@ -68,6 +68,7 @@ const ImageInputFieldComponent = ( return ( 0 ? 'Select a LoRA' : 'No LoRAs available'} data={data} diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/MainModelInputField.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/MainModelInputField.tsx index 681a597235..3847e14ae2 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/MainModelInputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/MainModelInputField.tsx @@ -123,7 +123,7 @@ const MainModelInputFieldComponent = ( Loading... ) : ( )} - {isSyncModelEnabled && } + {isSyncModelEnabled && } ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/NumberInputField.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/NumberInputField.tsx index df5c3f763e..bd670bd394 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/NumberInputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/NumberInputField.tsx @@ -64,7 +64,7 @@ const NumberInputFieldComponent = ( step={isIntegerField ? 1 : 0.1} precision={isIntegerField ? 0 : 3} > - + diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/RefinerModelInputField.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/RefinerModelInputField.tsx index 0eec884de0..5ba3ad529d 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/RefinerModelInputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/RefinerModelInputField.tsx @@ -96,7 +96,7 @@ const RefinerModelInputFieldComponent = ( ) : ( 0 ? 'Select a model' : 'No models available'} @@ -107,7 +107,7 @@ const RefinerModelInputFieldComponent = ( /> {isSyncModelEnabled && ( - + )} diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/SDXLMainModelInputField.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/SDXLMainModelInputField.tsx index e904aad246..1240cb95a0 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/SDXLMainModelInputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/SDXLMainModelInputField.tsx @@ -123,7 +123,7 @@ const ModelInputFieldComponent = ( ) : ( 0 ? 'Select a model' : 'No models available'} @@ -132,7 +132,7 @@ const ModelInputFieldComponent = ( disabled={data.length === 0} onChange={handleChangeModel} /> - {isSyncModelEnabled && } + {isSyncModelEnabled && } ); }; diff --git a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/StringInputField.tsx b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/StringInputField.tsx index c172e928d0..4561f9cc32 100644 --- a/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/StringInputField.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/fields/fieldTypes/StringInputField.tsx @@ -31,6 +31,7 @@ const StringInputFieldComponent = ( if (fieldTemplate.ui_component === 'textarea') { return ( - ) => { - const { nodeId, ctrlOrMeta } = action.payload; - state.nodes.forEach((node) => { - if (node.id === nodeId) { - node.selected = true; - } else if (!ctrlOrMeta) { - node.selected = false; - } - }); - }, notesNodeValueChanged: ( state, action: PayloadAction<{ nodeId: string; value: string }> @@ -665,7 +652,6 @@ export const { connectionMade, connectionStarted, connectionEnded, - nodeClicked, shouldShowFieldTypeLegendChanged, shouldShowMinimapPanelChanged, nodeTemplatesBuilt, diff --git a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton.tsx b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton.tsx index 6405fba1a7..33ee345ef7 100644 --- a/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton.tsx +++ b/invokeai/frontend/web/src/features/ui/components/tabs/ModelManager/subpanels/ModelManagerSettingsPanel/SyncModelsButton.tsx @@ -1,18 +1,19 @@ -import { makeToast } from 'features/system/util/makeToast'; +import { ButtonProps } from '@chakra-ui/react'; import { useAppDispatch } from 'app/store/storeHooks'; import IAIButton from 'common/components/IAIButton'; import IAIIconButton from 'common/components/IAIIconButton'; import { addToast } from 'features/system/store/systemSlice'; +import { makeToast } from 'features/system/util/makeToast'; import { useTranslation } from 'react-i18next'; import { FaSync } from 'react-icons/fa'; import { useSyncModelsMutation } from 'services/api/endpoints/models'; -type SyncModelsButtonProps = { +type SyncModelsButtonProps = ButtonProps & { iconMode?: boolean; }; export default function SyncModelsButton(props: SyncModelsButtonProps) { - const { iconMode = false } = props; + const { iconMode = false, ...rest } = props; const dispatch = useAppDispatch(); const { t } = useTranslation(); @@ -50,6 +51,7 @@ export default function SyncModelsButton(props: SyncModelsButtonProps) { isLoading={isLoading} onClick={syncModelsHandler} minW="max-content" + {...rest} > Sync Models @@ -61,6 +63,7 @@ export default function SyncModelsButton(props: SyncModelsButtonProps) { isLoading={isLoading} onClick={syncModelsHandler} size="sm" + {...rest} /> ); }