fix: don't auto-save on edge delete

Persisting the workflow is a separate intent from "delete this edge",
the same way it's separate from "delete this node" (useNodeHandlers
doesn't auto-save either). The Save button in the edit dialog conveys
the save semantics; trash buttons shouldn't piggy-back on them.

After this, all delete paths (node toolbar trash, edge toolbar trash,
Backspace on node, Backspace on edge) mark the workflow dirty and
leave persistence to Cmd+S or the header Save button.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Abhishek Kumar 2026-05-26 13:29:35 +00:00
parent 6292118473
commit 3827dbbf74

View file

@ -260,10 +260,9 @@ export default function CustomEdge(props: CustomEdgeProps) {
await saveWorkflow();
}, [id, updateEdge, saveWorkflow]);
const handleDeleteEdge = useCallback(async () => {
const handleDeleteEdge = useCallback(() => {
deleteEdge(id);
await saveWorkflow();
}, [id, deleteEdge, saveWorkflow]);
}, [id, deleteEdge]);
return (
<>