feat: enable edge deletion in group-chat mode

Extend edge deletion to group-chat orchestrator↔agent edges in addition
to handoff agent↔agent edges. Structural edges (user-input/output,
distributor/collector) remain non-deletable across all modes.

Sequential, concurrent, and single modes keep fully structural topologies
with no user-deletable edges.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-24 23:34:38 +01:00
co-authored by Copilot
parent 24bbf1ded3
commit f0d7d44589
3 changed files with 43 additions and 22 deletions
@@ -114,18 +114,11 @@ function PatternGraphCanvasInner({
const handleEdgesChange: OnEdgesChange = useCallback(
(changes) => {
// Block all edge deletions in modes that don't support it
if (!isEdgeDeletionAllowed(pattern.mode)) {
const filtered = changes.filter((c) => c.type !== 'remove');
if (filtered.length > 0) {
onEdgesChange(filtered);
}
return;
}
// For handoff mode, apply removals to the authoritative graph
// Route edge removals through the authoritative graph.
// Non-deletable edges are already protected by the per-edge `deletable`
// flag, so React Flow will not emit removal changes for them.
const removals = changes.filter((c) => c.type === 'remove');
if (removals.length > 0) {
if (removals.length > 0 && isEdgeDeletionAllowed(pattern.mode)) {
let updatedGraph = graph;
for (const removal of removals) {
if (removal.type === 'remove') {