setIsTriggerHovered(true)}
onMouseLeave={() => setIsTriggerHovered(false)}
diff --git a/web/app/components/workflow/hooks/__tests__/use-nodes-interactions.spec.ts b/web/app/components/workflow/hooks/__tests__/use-nodes-interactions.spec.ts
index 95591c7a844..dba8107f7d4 100644
--- a/web/app/components/workflow/hooks/__tests__/use-nodes-interactions.spec.ts
+++ b/web/app/components/workflow/hooks/__tests__/use-nodes-interactions.spec.ts
@@ -1112,6 +1112,7 @@ describe('useNodesInteractions', () => {
createNode({
id: nodeId,
position: { x: 120, y: 120 },
+ zIndex: 1002,
data: {
type: containerType,
title: containerType === BlockEnum.Iteration ? 'Iteration' : 'Loop',
@@ -1136,6 +1137,7 @@ describe('useNodesInteractions', () => {
expect(newContainer).toBeDefined()
expect(newContainer?.parentId).toBeUndefined()
+ expect(newContainer?.zIndex).toBe(0)
expect(newContainer?.data.isInIteration).toBeFalsy()
expect(newContainer?.data.isInLoop).toBeFalsy()
})
diff --git a/web/app/components/workflow/hooks/use-nodes-interactions.ts b/web/app/components/workflow/hooks/use-nodes-interactions.ts
index 7d57c09cb9d..ec874092a75 100644
--- a/web/app/components/workflow/hooks/use-nodes-interactions.ts
+++ b/web/app/components/workflow/hooks/use-nodes-interactions.ts
@@ -27,10 +27,9 @@ import { consoleQuery } from '@/service/client'
import { collaborationManager } from '../collaboration/core/collaboration-manager'
import {
CUSTOM_EDGE,
- ITERATION_CHILDREN_Z_INDEX,
ITERATION_PADDING,
- LOOP_CHILDREN_Z_INDEX,
LOOP_PADDING,
+ NESTED_ELEMENT_Z_INDEX,
NODE_WIDTH_X_OFFSET,
X_OFFSET,
Y_OFFSET,
@@ -597,11 +596,7 @@ export const useNodesInteractions = () => {
isInLoop,
loop_id: isInLoop ? targetNode?.parentId : undefined,
},
- zIndex: targetNode?.parentId
- ? isInIteration
- ? ITERATION_CHILDREN_Z_INDEX
- : LOOP_CHILDREN_Z_INDEX
- : 0,
+ zIndex: targetNode?.parentId ? NESTED_ELEMENT_Z_INDEX : 0,
}
const nodesConnectedSourceOrTargetHandleIdsMap
= getNodesConnectedSourceOrTargetHandleIdsMap(
@@ -998,11 +993,11 @@ export const useNodesInteractions = () => {
newNode.data.isInLoop = isInLoop
if (isInIteration) {
newNode.data.iteration_id = parentNode.id
- newNode.zIndex = ITERATION_CHILDREN_Z_INDEX
+ newNode.zIndex = NESTED_ELEMENT_Z_INDEX
}
if (isInLoop) {
newNode.data.loop_id = parentNode.id
- newNode.zIndex = LOOP_CHILDREN_Z_INDEX
+ newNode.zIndex = NESTED_ELEMENT_Z_INDEX
}
if (
isInIteration
@@ -1042,11 +1037,7 @@ export const useNodesInteractions = () => {
loop_id: isInLoop ? prevNode!.parentId : undefined,
_connectedNodeIsSelected: true,
},
- zIndex: prevNode!.parentId
- ? isInIteration
- ? ITERATION_CHILDREN_Z_INDEX
- : LOOP_CHILDREN_Z_INDEX
- : 0,
+ zIndex: prevNode!.parentId ? NESTED_ELEMENT_Z_INDEX : 0,
}
}
@@ -1156,11 +1147,11 @@ export const useNodesInteractions = () => {
newNode.data.isInLoop = isInLoop
if (isInIteration) {
newNode.data.iteration_id = parentNode.id
- newNode.zIndex = ITERATION_CHILDREN_Z_INDEX
+ newNode.zIndex = NESTED_ELEMENT_Z_INDEX
}
if (isInLoop) {
newNode.data.loop_id = parentNode.id
- newNode.zIndex = LOOP_CHILDREN_Z_INDEX
+ newNode.zIndex = NESTED_ELEMENT_Z_INDEX
}
}
@@ -1188,11 +1179,7 @@ export const useNodesInteractions = () => {
loop_id: isInLoop ? nextNode.parentId : undefined,
_connectedNodeIsSelected: true,
},
- zIndex: nextNode.parentId
- ? isInIteration
- ? ITERATION_CHILDREN_Z_INDEX
- : LOOP_CHILDREN_Z_INDEX
- : 0,
+ zIndex: nextNode.parentId ? NESTED_ELEMENT_Z_INDEX : 0,
}
}
@@ -1309,11 +1296,11 @@ export const useNodesInteractions = () => {
newNode.data.isInLoop = isInLoop
if (isInIteration) {
newNode.data.iteration_id = parentNode.id
- newNode.zIndex = ITERATION_CHILDREN_Z_INDEX
+ newNode.zIndex = NESTED_ELEMENT_Z_INDEX
}
if (isInLoop) {
newNode.data.loop_id = parentNode.id
- newNode.zIndex = LOOP_CHILDREN_Z_INDEX
+ newNode.zIndex = NESTED_ELEMENT_Z_INDEX
}
}
@@ -1339,11 +1326,7 @@ export const useNodesInteractions = () => {
loop_id: isInLoop ? prevNode.parentId : undefined,
_connectedNodeIsSelected: true,
},
- zIndex: prevNode.parentId
- ? isInIteration
- ? ITERATION_CHILDREN_Z_INDEX
- : LOOP_CHILDREN_Z_INDEX
- : 0,
+ zIndex: prevNode.parentId ? NESTED_ELEMENT_Z_INDEX : 0,
}
}
@@ -1382,11 +1365,7 @@ export const useNodesInteractions = () => {
loop_id: isNextNodeInLoop ? nextNode.parentId : undefined,
_connectedNodeIsSelected: true,
},
- zIndex: nextNode.parentId
- ? isNextNodeInIteration
- ? ITERATION_CHILDREN_Z_INDEX
- : LOOP_CHILDREN_Z_INDEX
- : 0,
+ zIndex: nextNode.parentId ? NESTED_ELEMENT_Z_INDEX : 0,
}
}
const nodesConnectedSourceOrTargetHandleIdsMap
@@ -1627,11 +1606,7 @@ export const useNodesInteractions = () => {
loop_id: isInLoop ? targetNodeForEdge.parentId : undefined,
_connectedNodeIsSelected: false,
},
- zIndex: targetNodeForEdge.parentId
- ? isInIteration
- ? ITERATION_CHILDREN_Z_INDEX
- : LOOP_CHILDREN_Z_INDEX
- : 0,
+ zIndex: targetNodeForEdge.parentId ? NESTED_ELEMENT_Z_INDEX : 0,
})
}
@@ -1667,11 +1642,7 @@ export const useNodesInteractions = () => {
loop_id: newNodeIsInLoop ? newCurrentNode.parentId : undefined,
_connectedNodeIsSelected: false,
},
- zIndex: newCurrentNode.parentId
- ? newNodeIsInIteration
- ? ITERATION_CHILDREN_Z_INDEX
- : LOOP_CHILDREN_Z_INDEX
- : 0,
+ zIndex: newCurrentNode.parentId ? NESTED_ELEMENT_Z_INDEX : 0,
})
}
@@ -2075,7 +2046,7 @@ export const useNodesInteractions = () => {
y: nodeToPaste.position.y + offsetY,
},
extent: nodeToPaste.extent,
- zIndex: nodeToPaste.zIndex,
+ zIndex: 0,
})
newNode.id = newNode.id + index
@@ -2145,7 +2116,7 @@ export const useNodesInteractions = () => {
positionAbsolute: child.positionAbsolute,
parentId: newNode.id,
extent: child.extent,
- zIndex: ITERATION_CHILDREN_Z_INDEX,
+ zIndex: NESTED_ELEMENT_Z_INDEX,
})
newChild.id = `${newNode.id}${newChild.id + childIndex}`
idMapping[child.id] = newChild.id
@@ -2245,7 +2216,7 @@ export const useNodesInteractions = () => {
positionAbsolute: child.positionAbsolute,
parentId: newNode.id,
extent: child.extent,
- zIndex: LOOP_CHILDREN_Z_INDEX,
+ zIndex: NESTED_ELEMENT_Z_INDEX,
})
newChild.id = `${newNode.id}${newChild.id + childIndex}`
idMapping[child.id] = newChild.id
@@ -2290,7 +2261,7 @@ export const useNodesInteractions = () => {
newNode.data.loop_id = !isIteration ? selectedContainerNode.id : undefined
newNode.parentId = selectedContainerNode.id
- newNode.zIndex = isIteration ? ITERATION_CHILDREN_Z_INDEX : LOOP_CHILDREN_Z_INDEX
+ newNode.zIndex = NESTED_ELEMENT_Z_INDEX
newNode.positionAbsolute = {
x: newNode.position.x,
y: newNode.position.y,
@@ -2348,13 +2319,7 @@ export const useNodesInteractions = () => {
loop_id: isInLoop ? parentNode?.id : undefined,
_connectedNodeIsSelected: false,
},
- zIndex: parentNode
- ? isInIteration
- ? ITERATION_CHILDREN_Z_INDEX
- : isInLoop
- ? LOOP_CHILDREN_Z_INDEX
- : 0
- : 0,
+ zIndex: parentNode && (isInIteration || isInLoop) ? NESTED_ELEMENT_Z_INDEX : 0,
}
edgesToPaste.push(newEdge)
}
diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx
index 3562511b0b1..629c2a2c1b7 100644
--- a/web/app/components/workflow/index.tsx
+++ b/web/app/components/workflow/index.tsx
@@ -73,7 +73,6 @@ import { CommentThread } from './comment/thread'
import {
CUSTOM_EDGE,
CUSTOM_NODE,
- ITERATION_CHILDREN_Z_INDEX,
WORKFLOW_DATA_UPDATE,
} from './constants'
import CustomConnectionLine from './custom-connection-line'
@@ -618,13 +617,12 @@ export const Workflow: FC
= memo(({
-
= memo(({
onPaneContextMenu={handlePaneContextMenu}
onSelectionContextMenu={handleSelectionContextMenu}
connectionLineComponent={CustomConnectionLine}
- // NOTE: For LOOP node, how to distinguish between ITERATION and LOOP here? Maybe both are the same?
- connectionLineContainerStyle={{ zIndex: ITERATION_CHILDREN_Z_INDEX }}
defaultViewport={viewport}
multiSelectionKeyCode={null}
deleteKeyCode={null}
@@ -785,6 +781,7 @@ export const Workflow: FC = memo(({
)}
+
)
})
diff --git a/web/app/components/workflow/nodes/_base/components/editor/code-editor/editor-support-vars.tsx b/web/app/components/workflow/nodes/_base/components/editor/code-editor/editor-support-vars.tsx
index 5688f8b1e3d..ed2c59248db 100644
--- a/web/app/components/workflow/nodes/_base/components/editor/code-editor/editor-support-vars.tsx
+++ b/web/app/components/workflow/nodes/_base/components/editor/code-editor/editor-support-vars.tsx
@@ -151,12 +151,10 @@ const CodeEditor: FC
= ({
{isShowVarPicker && createPortal(
{
position: { x: 12, y: 24 },
positionAbsolute: { x: 12, y: 24 },
extent: 'parent',
- zIndex: 7,
+ zIndex: 1002,
data: { type: BlockEnum.Code, title: 'Original', desc: 'child', selected: true },
})
@@ -99,7 +99,7 @@ describe('iteration interaction helpers', () => {
expect(result).toEqual(expect.objectContaining({
parentId: 'iteration-2',
- zIndex: 7,
+ zIndex: 1001,
data: expect.objectContaining({
title: 'blocks.code 3',
iteration_id: 'iteration-2',
diff --git a/web/app/components/workflow/nodes/iteration/use-interactions.helpers.ts b/web/app/components/workflow/nodes/iteration/use-interactions.helpers.ts
index 1af83c4fc2b..a6675080a8a 100644
--- a/web/app/components/workflow/nodes/iteration/use-interactions.helpers.ts
+++ b/web/app/components/workflow/nodes/iteration/use-interactions.helpers.ts
@@ -5,6 +5,7 @@ import type {
} from '../../types'
import {
ITERATION_PADDING,
+ NESTED_ELEMENT_Z_INDEX,
} from '../../constants'
import { CUSTOM_ITERATION_START_NODE } from '../iteration-start/constants'
@@ -108,6 +109,6 @@ export const buildIterationChildCopy = ({
positionAbsolute: child.positionAbsolute,
parentId: newNodeId,
extent: child.extent,
- zIndex: child.zIndex,
+ zIndex: NESTED_ELEMENT_Z_INDEX,
}
}
diff --git a/web/app/components/workflow/nodes/loop/__tests__/use-interactions.helpers.spec.ts b/web/app/components/workflow/nodes/loop/__tests__/use-interactions.helpers.spec.ts
index 283b7a2f48a..7e559e5a5d0 100644
--- a/web/app/components/workflow/nodes/loop/__tests__/use-interactions.helpers.spec.ts
+++ b/web/app/components/workflow/nodes/loop/__tests__/use-interactions.helpers.spec.ts
@@ -87,7 +87,7 @@ describe('loop interaction helpers', () => {
expect(result.newId).toBe('loop-23')
expect(result.params).toEqual(expect.objectContaining({
parentId: 'loop-2',
- zIndex: 1002,
+ zIndex: 1001,
data: expect.objectContaining({
title: 'Code 3',
isInLoop: true,
diff --git a/web/app/components/workflow/nodes/loop/use-interactions.helpers.ts b/web/app/components/workflow/nodes/loop/use-interactions.helpers.ts
index 41fa7de8f2d..380b9754638 100644
--- a/web/app/components/workflow/nodes/loop/use-interactions.helpers.ts
+++ b/web/app/components/workflow/nodes/loop/use-interactions.helpers.ts
@@ -3,8 +3,8 @@ import type {
Node,
} from '../../types'
import {
- LOOP_CHILDREN_Z_INDEX,
LOOP_PADDING,
+ NESTED_ELEMENT_Z_INDEX,
} from '../../constants'
import { CUSTOM_LOOP_START_NODE } from '../loop-start/constants'
@@ -99,7 +99,7 @@ export const buildLoopChildCopy = ({
positionAbsolute: child.positionAbsolute,
parentId: newNodeId,
extent: child.extent,
- zIndex: LOOP_CHILDREN_Z_INDEX,
+ zIndex: NESTED_ELEMENT_Z_INDEX,
}
return {
diff --git a/web/app/components/workflow/style.css b/web/app/components/workflow/style.css
index e0ad7649867..c89738c30f0 100644
--- a/web/app/components/workflow/style.css
+++ b/web/app/components/workflow/style.css
@@ -24,7 +24,7 @@
}
#workflow-container .react-flow__node-custom-note {
- z-index: -1000 !important;
+ z-index: -1 !important;
}
#workflow-container .react-flow__attribution {
diff --git a/web/app/components/workflow/syncing-data-modal.tsx b/web/app/components/workflow/syncing-data-modal.tsx
index 6d5e40a48ea..735096c4103 100644
--- a/web/app/components/workflow/syncing-data-modal.tsx
+++ b/web/app/components/workflow/syncing-data-modal.tsx
@@ -7,7 +7,7 @@ const SyncingDataModal = () => {
return null
return (
-
+
)
}
diff --git a/web/app/components/workflow/update-dsl-modal.tsx b/web/app/components/workflow/update-dsl-modal.tsx
index dfbb3993405..ada3c9bbd52 100644
--- a/web/app/components/workflow/update-dsl-modal.tsx
+++ b/web/app/components/workflow/update-dsl-modal.tsx
@@ -220,7 +220,7 @@ const UpdateDSLModal = ({
-
+
@@ -230,7 +230,7 @@ const UpdateDSLModal = ({