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
|
||||
}, [])
|
||||
|
||||
// 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 (
|
||||
<div className="flex h-full w-full flex-col">
|
||||
<Toolbar
|
||||
|
|
@ -178,6 +185,7 @@ function FlowchartEditorInner({ initialData }: FlowchartEditorProps) {
|
|||
nodeTypes={nodeTypes}
|
||||
onNodesChange={onNodesChange}
|
||||
onEdgesChange={onEdgesChange}
|
||||
onEdgesDelete={onEdgesDelete}
|
||||
onConnect={onConnect}
|
||||
deleteKeyCode={['Delete', 'Backspace']}
|
||||
fitView
|
||||
|
|
|
|||
Loading…
Reference in New Issue