feat: [US-029] - Select and delete edges
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ccd88b39d1
commit
4c7a289714
|
|
@ -161,6 +161,13 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) {
|
||||||
// TODO: Implement in US-036
|
// TODO: Implement in US-036
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
// Handle edge deletion via keyboard (Delete/Backspace)
|
||||||
|
const onEdgesDelete = useCallback((deletedEdges: Edge[]) => {
|
||||||
|
// Edges are already removed from state by onEdgesChange
|
||||||
|
// This callback can be used for additional logic like logging or dirty state
|
||||||
|
console.log('Deleted edges:', deletedEdges.map((e) => e.id))
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full w-full flex-col">
|
<div className="flex h-full w-full flex-col">
|
||||||
<Toolbar
|
<Toolbar
|
||||||
|
|
@ -178,6 +185,7 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) {
|
||||||
nodeTypes={nodeTypes}
|
nodeTypes={nodeTypes}
|
||||||
onNodesChange={onNodesChange}
|
onNodesChange={onNodesChange}
|
||||||
onEdgesChange={onEdgesChange}
|
onEdgesChange={onEdgesChange}
|
||||||
|
onEdgesDelete={onEdgesDelete}
|
||||||
onConnect={onConnect}
|
onConnect={onConnect}
|
||||||
deleteKeyCode={['Delete', 'Backspace']}
|
deleteKeyCode={['Delete', 'Backspace']}
|
||||||
fitView
|
fitView
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue