mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-04 19:08:40 +02:00
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:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user