MCPcopy Create free account
hub / github.com/ShipSecAI/studio / deserializeEdges

Function deserializeEdges

frontend/src/utils/workflowSerializer.ts:231–252  ·  view source on GitHub ↗
(workflow: { graph: { edges: BackendEdge[] } })

Source from the content-addressed store, hash-verified

229 * Preserves edge type to maintain curved arrow appearance
230 */
231export function deserializeEdges(workflow: { graph: { edges: BackendEdge[] } }): ReactFlowEdge[] {
232 const edges = workflow.graph.edges;
233 return edges.map((edge) => {
234 const normalizedSourceHandle =
235 edge.sourceHandle === 'tool-export' ? 'tools' : edge.sourceHandle;
236 // Use saved type if available, otherwise default to 'default' for bezier curves (curved arrows)
237 return {
238 id: edge.id,
239 source: edge.source,
240 target: edge.target,
241 sourceHandle: normalizedSourceHandle,
242 targetHandle: edge.targetHandle,
243 type: (edge.type || 'default') as 'default' | 'smoothstep' | 'step' | 'straight' | 'bezier',
244 animated: false, // Default for ReactFlow, backend doesn't store this
245 markerEnd: {
246 type: MarkerType.Arrow,
247 width: 22,
248 height: 22,
249 },
250 };
251 });
252}

Callers 3

loadWorkflowFunction · 0.90
useWorkflowImportExportFunction · 0.90
loadVersionForRunFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected