diff --git a/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx index a0c6d5d5d..7db3b0079 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/NodeOutputfield/index.tsx @@ -216,10 +216,19 @@ function NodeOutputField({ ); useEffect(() => { - if (disabledOutput && hidden) { + const outputHasGroupOutputsFalse = + data.node?.outputs?.[index]?.group_outputs === false; + + if (disabledOutput && hidden && !outputHasGroupOutputsFalse) { handleUpdateOutputHide(false); } - }, [disabledOutput, handleUpdateOutputHide, hidden]); + }, [ + disabledOutput, + handleUpdateOutputHide, + hidden, + data.node?.outputs, + index, + ]); const [openOutputModal, setOpenOutputModal] = useState(false); diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 31c9c7d8b..d6406ae3b 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -313,7 +313,11 @@ function GenericNode({ newNode.data.node.outputs[outputIndex].selected = output.selected ?? defaultType; } + + const selectedOutput = newNode.data.node.outputs[outputIndex]?.name; + (newNode.data as NodeDataType).selected_output = selectedOutput; } + return newNode; }); updateNodeInternals(data.id); diff --git a/src/frontend/src/types/api/index.ts b/src/frontend/src/types/api/index.ts index d228d811e..b93b6dd12 100644 --- a/src/frontend/src/types/api/index.ts +++ b/src/frontend/src/types/api/index.ts @@ -104,6 +104,7 @@ export type OutputFieldType = { types: Array; selected?: string; name: string; + group_outputs?: boolean; method?: string; display_name: string; hidden?: boolean; diff --git a/src/frontend/tests/extended/regression/general-bugs-shard-3909.spec.ts b/src/frontend/tests/extended/regression/general-bugs-shard-3909.spec.ts index 7da8f1580..1bd3144fb 100644 --- a/src/frontend/tests/extended/regression/general-bugs-shard-3909.spec.ts +++ b/src/frontend/tests/extended/regression/general-bugs-shard-3909.spec.ts @@ -44,7 +44,7 @@ test( await expect(page.getByTestId("button_run_chat output")).toBeVisible({ timeout: 30000, }); - await expect(page.getByTestId("button_run_openai")).toBeVisible({ + await expect(page.getByTestId("button_run_language model")).toBeVisible({ timeout: 30000, }); await expect(page.getByTestId("button_run_prompt")).toBeVisible({