You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the mship chat panel's embedded workflow view, dragging a block over a loop/parallel highlighted it and dropped the block INTO the subflow as a persistent collaborative op — with no way to undo it from the panel. Dragging itself is fine; the insertion is the bug.
Fix: in embedded mode, onNodeDrag skips container-intersection detection entirely, so a drag over a subflow never highlights it and never arms potentialParentId. Both drag-stop paths already bail when potentialParentId equals the drag-start parent, so block positions still move normally but a block can never be inserted into (or pulled out of) a subflow from the embedded view.
Standalone editor untouched (the skip is embedded-only).
Type of Change
Bug fix
Testing
Tested manually in the embedded panel with a loop workflow: dragging a block still works, dragging it directly onto the loop shows no drop-target highlight, and after dropping on the loop the block's parentId is unchanged (verified via API). Standalone editor drag/reparent behavior unchanged. bun run lint, bun run check:api-validation:strict pass.
Low Risk
Scoped to the embedded workflow canvas path; standalone editor drag behavior is unchanged aside from shared callback dependencies.
Overview Embedded mothership workflow previews were still running full drag lifecycle hooks when the user could edit, which could persist re-parenting (dropping blocks into loop/parallel subflows) as collaborative updates even though the panel is meant to stay read-only for structure changes.
This change aligns drag behavior with other embedded gates (onConnect, nodesDraggable, etc.): onNodeDragStart and onNodeDragStop are only wired when !embedded && canEdit, so drag-start state and drag-stop collaborative parent/position commits do not run in the embedded view.
During drag in embedded mode, onNodeDrag returns early after optional in-container resize logic, skipping subflow hit-testing, highlight, and potentialParentId updates so blocks cannot be armed for insert/remove from subflows from the panel canvas.
Reviewed by Cursor Bugbot for commit b00a661. Bugbot is set up for automated code reviews on this repo. Configure here.
This PR fixes a bug where nodes in the embedded (mothership chat panel) workflow view could still be dragged despite the surface being intended as read-only. The root cause was that per-node draggable properties override ReactFlow's global nodesDraggable={false}, and the onNodeDrag* handlers were not gated on !embedded.
Adds !embedded to both per-node draggable computation sites (lines ~2472 and ~2517) so the override can no longer bypass the global lock.
Adds !embedded to onNodeDrag, onNodeDragStop, and onNodeDragStart handler bindings, matching the convention already used by the connect/edges handlers.
Confidence Score: 4/5
Safe to merge; the root cause (per-node draggable overriding the global lock) is correctly addressed at both call sites, and the handler bindings now match the pattern used elsewhere in the file.
The core fix is tight and well-targeted. One minor gap remains: the three selection-drag handlers (onSelectionDragStart, onSelectionDrag, onSelectionDragStop) still lack !embedded, leaving them inconsistent with the node-drag handlers that were just patched. In practice they cannot fire in embedded mode because ReactFlow's global nodesDraggable and elementsSelectable props already block selection. But this is the same class of inconsistency that caused the original bug, so it is worth closing before a future refactor reintroduces the issue.
Only workflow.tsx is changed; the selection drag handler bindings (lines 4115–4121) warrant a second look for the inconsistency described above.
Adds !embedded guard to per-node draggable props and onNodeDrag* handlers; selection drag handlers (onSelectionDragStart/Drag/Stop) are not updated but remain protected by global nodesDraggable and elementsSelectable props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
onNodeDragskips container-intersection detection entirely, so a drag over a subflow never highlights it and never armspotentialParentId. Both drag-stop paths already bail whenpotentialParentIdequals the drag-start parent, so block positions still move normally but a block can never be inserted into (or pulled out of) a subflow from the embedded view.Type of Change
Testing
Tested manually in the embedded panel with a loop workflow: dragging a block still works, dragging it directly onto the loop shows no drop-target highlight, and after dropping on the loop the block's parentId is unchanged (verified via API). Standalone editor drag/reparent behavior unchanged.
bun run lint,bun run check:api-validation:strictpass.Checklist