Skip to content

Commit 6299db7

Browse files
Mary HippMary Hipp
authored andcommitted
knip cleanup
1 parent c08f7ff commit 6299db7

File tree

8 files changed

+6
-48
lines changed

8 files changed

+6
-48
lines changed

invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/canvasWorkflowFieldChanged.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,10 @@ export const addCanvasWorkflowFieldChangedListener = (startListening: AppStartLi
100100

101101
// Check if this node exists in canvas workflow nodes
102102
const canvasWorkflowNode = state.canvasWorkflowNodes.nodes.find((n: AnyNode) => n.id === nodeId);
103-
const regularNode = state.nodes.present.nodes.find((n: AnyNode) => n.id === nodeId);
104-
105-
console.log('[canvasWorkflowFieldChanged] Field changed:', {
106-
nodeId,
107-
hasCanvasNode: !!canvasWorkflowNode,
108-
hasRegularNode: !!regularNode,
109-
action: action.type,
110-
payload: action.payload,
111-
});
112103

113104
// If the node exists in canvas workflow, redirect the action
114105
// This ensures canvas workflow fields always update the canvas workflow nodes slice
115106
if (canvasWorkflowNode) {
116-
console.log('[canvasWorkflowFieldChanged] Redirecting to canvas workflow nodes:', canvasAction.type);
117107
dispatch(canvasAction(action.payload));
118108
}
119109
},

invokeai/frontend/web/src/features/controlLayers/components/CanvasWorkflowElementContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type CanvasWorkflowElementContextValue = {
1515

1616
const CanvasWorkflowElementContext = createContext<CanvasWorkflowElementContextValue | null>(null);
1717

18-
export const CanvasWorkflowElementProvider = memo(({ children }: PropsWithChildren) => {
18+
const CanvasWorkflowElementProvider = memo(({ children }: PropsWithChildren) => {
1919
const nodesState = useAppSelector(selectCanvasWorkflowNodesSlice);
2020

2121
const value = useMemo<CanvasWorkflowElementContextValue>(

invokeai/frontend/web/src/features/controlLayers/components/CanvasWorkflowFormElementComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { DividerElement } from 'features/nodes/components/sidePanel/builder/Divi
1212
import { HeadingElement } from 'features/nodes/components/sidePanel/builder/HeadingElement';
1313
import { NodeFieldElementViewMode } from 'features/nodes/components/sidePanel/builder/NodeFieldElementViewMode';
1414
import { TextElement } from 'features/nodes/components/sidePanel/builder/TextElement';
15-
import { CONTAINER_CLASS_NAME } from 'features/nodes/types/workflow';
1615
import {
16+
CONTAINER_CLASS_NAME,
1717
isContainerElement,
1818
isDividerElement,
1919
isHeadingElement,

invokeai/frontend/web/src/features/controlLayers/components/CanvasWorkflowInvocationContext.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ export const CanvasWorkflowInvocationNodeContextProvider = memo(
128128
createSelector(selectNodeInputsOrThrow, (inputs) => {
129129
const field = inputs[fieldName];
130130
if (field === undefined) {
131-
console.error(
132-
`[CanvasWorkflowContext] Cannot find input field with name ${fieldName} in node ${nodeId}. Available fields:`,
133-
Object.keys(inputs)
134-
);
135131
throw new Error(`Cannot find input field with name ${fieldName} in node ${nodeId}`);
136132
}
137133
return field;

invokeai/frontend/web/src/features/controlLayers/components/StagingArea/shared.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('StagingAreaApi Utility Functions', () => {
6464
expect(getOutputImageName(queueItem)).toBe('test-output.png');
6565
});
6666

67-
it('should return null when no canvas output node found', () => {
67+
it('should use fallback when no canvas output node found', () => {
6868
const queueItem = {
6969
item_id: 1,
7070
status: 'completed',
@@ -93,7 +93,8 @@ describe('StagingAreaApi Utility Functions', () => {
9393
},
9494
} as unknown as S['SessionQueueItem'];
9595

96-
expect(getOutputImageName(queueItem)).toBe(null);
96+
// Fallback mechanism finds image in other nodes when no canvas_output node exists
97+
expect(getOutputImageName(queueItem)).toBe('test-output.png');
9798
});
9899

99100
it('should return null when output node has no results', () => {

invokeai/frontend/web/src/features/controlLayers/store/canvasWorkflowNodesSlice.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,11 @@ const slice = createSlice({
126126
name: 'canvasWorkflowNodes',
127127
initialState: getInitialState(),
128128
reducers: {
129-
canvasWorkflowNodesCleared: () => getInitialState(),
130129
// Field value mutations - these update the shadow nodes when fields are changed
131130
fieldValueReset: (state, action: FieldValueAction<StatefulFieldValue>) => {
132131
fieldValueReducer(state, action, zStatefulFieldValue);
133132
},
134133
fieldStringValueChanged: (state, action: FieldValueAction<StringFieldValue>) => {
135-
console.log('[canvasWorkflowNodesSlice] fieldStringValueChanged:', action.payload);
136134
fieldValueReducer(state, action, zStringFieldValue);
137135
},
138136
fieldStringCollectionValueChanged: (state, action: FieldValueAction<StringFieldCollectionValue>) => {
@@ -268,7 +266,6 @@ const slice = createSlice({
268266
});
269267

270268
export const {
271-
canvasWorkflowNodesCleared,
272269
fieldStringValueChanged,
273270
fieldIntegerValueChanged,
274271
fieldFloatValueChanged,

invokeai/frontend/web/src/features/controlLayers/store/canvasWorkflowSlice.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const slice = createSlice({
217217
},
218218
});
219219

220-
export const { canvasWorkflowCleared, canvasWorkflowFieldValueChanged } = slice.actions;
220+
export const { canvasWorkflowCleared } = slice.actions;
221221

222222
export const canvasWorkflowSliceConfig: SliceConfig<typeof slice> = {
223223
slice,
@@ -242,24 +242,3 @@ export const canvasWorkflowSliceConfig: SliceConfig<typeof slice> = {
242242
};
243243

244244
export const selectCanvasWorkflowSlice = (state: RootState) => state.canvasWorkflow;
245-
246-
export const selectCanvasWorkflowStatus = (state: RootState) => selectCanvasWorkflowSlice(state).status;
247-
248-
export const selectCanvasWorkflowError = (state: RootState) => selectCanvasWorkflowSlice(state).error;
249-
250-
export const selectCanvasWorkflowSelection = (state: RootState) => selectCanvasWorkflowSlice(state).selectedWorkflowId;
251-
252-
export const selectCanvasWorkflowData = (state: RootState) => selectCanvasWorkflowSlice(state).workflow;
253-
254-
export const selectCanvasWorkflowNodeIds = (state: RootState) => ({
255-
inputNodeId: selectCanvasWorkflowSlice(state).inputNodeId,
256-
outputNodeId: selectCanvasWorkflowSlice(state).outputNodeId,
257-
});
258-
259-
export const selectIsCanvasWorkflowActive = (state: RootState) => {
260-
const sliceState = selectCanvasWorkflowSlice(state);
261-
return (
262-
Boolean(sliceState.workflow && sliceState.inputNodeId && sliceState.outputNodeId) &&
263-
(sliceState.status === 'succeeded' || sliceState.status === 'idle')
264-
);
265-
};

invokeai/frontend/web/src/features/nodes/store/workflowLibraryModal.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,3 @@ export const useWorkflowLibraryModal = () => {
4040
};
4141

4242
export { $isWorkflowLibraryModalOpen };
43-
44-
export const openWorkflowLibraryModal = (context?: WorkflowLibraryContext) => {
45-
$workflowLibraryContext.set(context ?? defaultContext);
46-
$isWorkflowLibraryModalOpen.set(true);
47-
};

0 commit comments

Comments
 (0)