@@ -13,7 +13,7 @@ import { useCallback } from 'react'
1313import { trace } from '@/lib/perf-trace'
1414import { $anchorNodes , removeAnchorNode , updateAnchorNodeParent , updateAnchorNodePosition , updateAnchorNodeSelection } from '@/store/edges/anchor-nodes'
1515import { $activeFlowMetadata } from '@/store/flow'
16- import { $nodes , removeNodeFromFlow , updateNodePosition , updateNodePositionOnly , updateNodeUI } from '@/store/nodes'
16+ import { $nodes , removeNodeFromFlow , updateNodeDimensionsLocal , updateNodePosition , updateNodePositionOnly , updateNodeUI } from '@/store/nodes'
1717import { positionInterpolator } from '@/store/nodes/position-interpolation-advanced'
1818import { getNodePositionInFlow , getNodePositionInsideParent } from '../utils/node-position'
1919import { calculateNodeDepth , roundPosition } from './useFlowUtils'
@@ -263,15 +263,31 @@ export function useNodeChanges() {
263263
264264 case 'dimensions' :
265265 {
266- // SKIP all dimension changes from XYFlow's onNodesChange
267- // XYFlow reports measured DOM sizes which conflict with resize handle positions
268- //
269- // Dimension sources are now:
270- // - Width: NodeResizeControl onResize handler (user intent)
271- // - Height: useElementResize content detection (for regular nodes)
272- // - Both: NodeResizer onResize handler (for GroupNode)
273- //
274- // GroupNode is also skipped here as it handles dimensions in its own component
266+ // Sync XYFlow's dimension changes to our Effector stores
267+ // This prevents XYFlow from being reset to old dimensions on re-render
268+ if ( ! change . dimensions )
269+ break
270+
271+ const node = currentNodes [ change . id ]
272+ if ( ! node )
273+ break
274+
275+ // Only update if dimensions actually changed
276+ const currentDims = node . metadata . ui ?. dimensions
277+ const newWidth = change . dimensions . width
278+ const newHeight = change . dimensions . height
279+
280+ if ( currentDims ?. width !== newWidth || currentDims ?. height !== newHeight ) {
281+ updateNodeDimensionsLocal ( {
282+ flowId : activeFlow . id ! ,
283+ nodeId : change . id ,
284+ dimensions : {
285+ width : newWidth ,
286+ height : newHeight ,
287+ } ,
288+ version : node . getVersion ( ) ,
289+ } )
290+ }
275291 break
276292 }
277293
0 commit comments