@@ -113,10 +113,10 @@ export const createNodeAtCenter = (
113113) : void => {
114114 // Generate UUID for the node ID
115115 const id = uuidv4 ( )
116-
116+
117117 // Create a human-readable title (similar to previous ID format)
118118 const nodeTitle = generateNewNodeTitle ( nodes , nodeType )
119-
119+
120120 const center = reactFlowInstance . screenToFlowPosition ( {
121121 x : window . innerWidth / 2 ,
122122 y : window . innerHeight / 2 ,
@@ -165,8 +165,8 @@ export const duplicateNode = (nodeId: string, dispatch: AppDispatch, getState: (
165165
166166 // Generate a new unique ID for the duplicated node using UUID
167167 const newNodeId = uuidv4 ( )
168-
169- // Create a title based on the original node's title
168+
169+ // Create a title based on the original node's title
170170 const newNodeTitle = generateNewNodeTitle ( nodes , sourceNode . type || 'default' )
171171
172172 // Create the new node with an offset position
@@ -221,7 +221,7 @@ export const duplicateNode = (nodeId: string, dispatch: AppDispatch, getState: (
221221 childNodes . forEach ( ( childNode ) => {
222222 const newChildId = uuidv4 ( )
223223 idMapping [ childNode . id ] = newChildId
224-
224+
225225 // Create readable title for the child node
226226 const newChildTitle = generateNewNodeTitle ( nodes , childNode . type || 'default' )
227227 const newChildNode = {
@@ -304,14 +304,18 @@ export const insertNodeBetweenNodes = (
304304 return
305305 }
306306
307- const id = generateNewNodeId ( nodes , nodeType )
307+ // Generate UUID for the node ID
308+ const id = uuidv4 ( )
309+
310+ // Create a human-readable title (similar to previous ID format)
311+ const nodeTitle = generateNewNodeTitle ( nodes , nodeType )
308312 const newPosition = {
309313 x : ( sourceNode . position . x + targetNode . position . x ) / 2 ,
310314 y : ( sourceNode . position . y + targetNode . position . y ) / 2 ,
311315 }
312316
313317 // Create the new node
314- const result = createNode ( nodeTypes , nodeType , id , newPosition )
318+ const result = createNode ( nodeTypes , nodeType , id , newPosition , null , null , nodeTitle )
315319 if ( ! result ) {
316320 console . error ( 'Failed to create node' )
317321 return
0 commit comments