feat: Disable node dragging and conditionally display Source section - #302
Merged
lornakelly merged 2 commits intoAug 4, 2026
Merged
Conversation
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
✅ Deploy Preview for openworkflow-editor ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the diagram editor with the new auto-layout behavior by preventing manual repositioning (node dragging and canvas panning via drag) and streamlining the side panel by only showing the Source section in read-only mode.
Changes:
- Disabled node dragging in React Flow for all modes (
nodesDraggable={false}). - Disabled canvas panning via drag for all modes (
panOnDrag={false}). - Conditionally rendered the side-panel Source section only when
isReadOnlyistrue, with accompanying test updates.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/open-workflow-diagram-editor/src/react-flow/diagram/Diagram.tsx | Disables node dragging and drag-to-pan in React Flow to keep layout engine in full control. |
| packages/open-workflow-diagram-editor/tests/react-flow/diagram/Diagram.test.tsx | Updates expectations for non-draggable nodes and disabled drag panning. |
| packages/open-workflow-diagram-editor/src/side-panel/NodeDetailsView.tsx | Shows the Source section only in read-only mode. |
| packages/open-workflow-diagram-editor/tests/side-panel/NodeDetailsView.test.tsx | Adds coverage to ensure Source is hidden in editable mode. |
Suppressed comments (1)
packages/open-workflow-diagram-editor/tests/react-flow/diagram/Diagram.test.tsx:181
- The test name is now misleading: it claims node interaction is enabled in editable mode, but the assertions verify nodes are not draggable (and panning is disabled). Renaming the test will keep intent aligned with the updated behavior.
expect(reactFlowProps.nodesDraggable).toBe(false);
expect(reactFlowProps.nodesConnectable).toBe(true);
expect(reactFlowProps.panOnDrag).toBe(false);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
kumaradityaraj
requested review from
cheryl7114,
fantonangeli,
handreyrc and
lornakelly
August 4, 2026 07:21
cheryl7114
approved these changes
Aug 4, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #291
Description
This PR updates the diagram editor to align with the new auto-layout behavior by disabling manual node and canvas dragging in all modes. It also simplifies the editing experience by hiding the Source section in the side panel when the editor is in editable mode.
Changes
isReadOnly.isReadOnly.isReadOnlyistrue.