Skip to content

Commit

Permalink
fix: node zoom effect only if node outputs are available
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanKaddour committed Jan 6, 2025
1 parent 17580f0 commit 0ee938b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/src/components/nodes/DynamicNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const DynamicNode: React.FC<DynamicNodeProps> = ({
const totalHandles = Math.max(inputLabels.length, outputLabels.length)
const handleHeight = 30 // height per handle in pixels
const padding = 40 // padding for top and bottom
const minNodeHeight = 500 // minimum height
const minNodeHeight = 150 // minimum height
const finalHeight = Math.max(minNodeHeight, totalHandles * handleHeight + padding)
setNodeHeight(`${finalHeight}px`)
}, [nodeData, cleanedInputMetadata, cleanedOutputMetadata, predecessorNodes, nodeWidth])
Expand Down Expand Up @@ -329,11 +329,11 @@ const DynamicNode: React.FC<DynamicNodeProps> = ({

const baseNodeStyle = useMemo(
() => ({
width: isHoveringOutput ? '600px' : nodeWidth,
height: isHoveringOutput ? '800px' : nodeHeight,
width: isHoveringOutput && nodeData?.run !== undefined ? '600px' : nodeWidth,
height: isHoveringOutput && nodeData?.run !== undefined ? '800px' : nodeHeight,
transition: 'width 0.3s ease, height 0.3s ease',
}),
[nodeWidth, nodeHeight, isHoveringOutput]
[nodeWidth, nodeHeight, isHoveringOutput, nodeData?.run]
)

return (
Expand Down

0 comments on commit 0ee938b

Please sign in to comment.