Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const ToolBrushWidth = memo(() => {
}, [width]);

useRegisteredHotkeys({
id: 'incrementToolWidth',
id: 'decrementToolWidth',
category: 'canvas',
callback: decrement,
options: { enabled: isSelected && !imageViewer.isOpen },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const ToolEraserWidth = memo(() => {
}, [width]);

useRegisteredHotkeys({
id: 'incrementToolWidth',
id: 'decrementToolWidth',
category: 'canvas',
callback: decrement,
options: { enabled: isSelected && !imageViewer.isOpen },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useStore } from '@nanostores/react';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { $activeScopes } from 'common/hooks/interactionScopes';
import { $activeScopes, INTERACTION_SCOPES } from 'common/hooks/interactionScopes';
import { useAssertSingleton } from 'common/hooks/useAssertSingleton';
import { $canvasRightPanelTab } from 'features/controlLayers/store/ephemeral';
import { imagesToDeleteSelected } from 'features/deleteImageModal/store/slice';
Expand Down Expand Up @@ -38,6 +38,7 @@ export const useGalleryHotkeys = () => {
const upDownHotkeysEnabled = useStore($upDownHotkeysEnabled);
const canvasRightPanelTab = useStore($canvasRightPanelTab);
const appTab = useAppSelector(selectActiveTab);
const isWorkflowsScopeActive = useStore(INTERACTION_SCOPES.workflows.$isActive);

// When we are on the canvas tab, we need to disable the delete hotkey when the user is focused on the layers tab in
// the right hand panel, because the same hotkey is used to delete layers.
Expand Down Expand Up @@ -212,7 +213,7 @@ export const useGalleryHotkeys = () => {
}
dispatch(imagesToDeleteSelected(selection));
},
options: { enabled: leftRightHotkeysEnabled && isDeleteEnabledByTab },
dependencies: [leftRightHotkeysEnabled, isDeleteEnabledByTab],
options: { enabled: leftRightHotkeysEnabled && isDeleteEnabledByTab && !isWorkflowsScopeActive },
dependencies: [leftRightHotkeysEnabled, isDeleteEnabledByTab, selection, isWorkflowsScopeActive],
});
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useGlobalMenuClose, useToken } from '@invoke-ai/ui-library';
import { useStore } from '@nanostores/react';
import { useAppDispatch, useAppSelector, useAppStore } from 'app/store/storeHooks';
import { INTERACTION_SCOPES, useScopeImperativeApi } from 'common/hooks/interactionScopes';
import { INTERACTION_SCOPES, useScopeImperativeApi, useScopeOnFocus } from 'common/hooks/interactionScopes';
import { useConnection } from 'features/nodes/hooks/useConnection';
import { useCopyPaste } from 'features/nodes/hooks/useCopyPaste';
import { useSyncExecutionState } from 'features/nodes/hooks/useExecutionState';
Expand Down Expand Up @@ -91,6 +91,7 @@ export const Flow = memo(() => {
const store = useAppStore();
const isWorkflowsActive = useStore(INTERACTION_SCOPES.workflows.$isActive);
const workflowsScopeApi = useScopeImperativeApi('workflows');
useScopeOnFocus('workflows', flowWrapper);

useWorkflowWatcher();
useSyncExecutionState();
Expand Down Expand Up @@ -318,7 +319,8 @@ export const Flow = memo(() => {
id: 'deleteSelection',
category: 'workflows',
callback: deleteSelection,
dependencies: [deleteSelection],
options: { preventDefault: true, enabled: isWorkflowsActive },
dependencies: [deleteSelection, isWorkflowsActive],
});

return (
Expand Down