feat: [US-029] - Select and delete edges

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gustavo Henrique Santos Souza de Miranda 2026-01-21 17:21:27 -03:00
parent ccd88b39d1
commit 4c7a289714
1 changed files with 8 additions and 0 deletions

View File

@ -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