fix(mothership): block subflow re-parenting in embedded workflow view (#5418)

This commit is contained in:
Theodore Li
2026-07-04 18:18:44 -04:00
committed by GitHub
parent 82eff5435d
commit acf4afb1b5
@@ -3153,6 +3153,14 @@ const WorkflowContent = React.memo(
updateContainerDimensionsDuringMove(node.id, node.position)
}
// Embedded (mship panel) canvases allow repositioning but never
// re-parenting: skip container-intersection detection so a drag over a
// subflow neither highlights it nor arms potentialParentId. Both drag-stop
// paths bail when potentialParentId still equals the drag-start parent, so
// positions persist but a block can never be inserted into (or pulled out
// of) a loop/parallel from the embedded view.
if (embedded) return
// Check if this is a starter block - starter blocks should never be in containers
const isStarterBlock = node.data?.type === 'starter'
if (isStarterBlock) {
@@ -3268,6 +3276,7 @@ const WorkflowContent = React.memo(
getNodes,
potentialParentId,
blocks,
embedded,
getNodeAbsolutePosition,
getNodeDepth,
isDescendantOf,
@@ -4120,7 +4129,9 @@ const WorkflowContent = React.memo(
edgesUpdatable={!embedded && effectivePermissions.canEdit}
className={`workflow-container h-full bg-[var(--bg)] transition-opacity duration-150 ${reactFlowStyles} ${canvasOpacityClass} ${isHandMode ? 'canvas-mode-hand' : 'canvas-mode-cursor'}`}
onNodeDrag={effectivePermissions.canEdit ? onNodeDrag : undefined}
onNodeDragStop={effectivePermissions.canEdit ? onNodeDragStop : undefined}
onNodeDragStop={
!embedded && effectivePermissions.canEdit ? onNodeDragStop : undefined
}
onSelectionDragStart={
effectivePermissions.canEdit ? onSelectionDragStart : undefined
}
@@ -4128,7 +4139,9 @@ const WorkflowContent = React.memo(
onSelectionDragStop={
effectivePermissions.canEdit ? onSelectionDragStop : undefined
}
onNodeDragStart={effectivePermissions.canEdit ? onNodeDragStart : undefined}
onNodeDragStart={
!embedded && effectivePermissions.canEdit ? onNodeDragStart : undefined
}
snapToGrid={snapToGrid}
snapGrid={snapGrid}
elevateEdgesOnSelect={false}