Skip to content

feat: Disable node dragging and conditionally display Source section - #302

Merged
lornakelly merged 2 commits into
open-workflow-specification:mainfrom
kumaradityaraj:nodeDrag
Aug 4, 2026
Merged

feat: Disable node dragging and conditionally display Source section#302
lornakelly merged 2 commits into
open-workflow-specification:mainfrom
kumaradityaraj:nodeDrag

Conversation

@kumaradityaraj

Copy link
Copy Markdown
Contributor

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

  • Disabled node dragging regardless of isReadOnly.
  • Disabled canvas (diagram) dragging regardless of isReadOnly.
  • Kept node positioning fully managed by the auto-layout engine.
  • Updated the side panel so the Source section is only displayed when isReadOnly is true.
  • Hid the Source section in editable mode while keeping the structured Properties section available.
  • Updated and added tests.

Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Copilot AI lite review requested due to automatic review settings August 4, 2026 07:10
@netlify

netlify Bot commented Aug 4, 2026

Copy link
Copy Markdown

Deploy Preview for openworkflow-editor ready!

Name Link
🔨 Latest commit 767d0ba
🔍 Latest deploy log https://app.netlify.com/projects/openworkflow-editor/deploys/6a71918a55b5ff0008911bae
😎 Deploy Preview https://deploy-preview-302--openworkflow-editor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isReadOnly is true, 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.

Comment thread packages/open-workflow-diagram-editor/tests/react-flow/diagram/Diagram.test.tsx Outdated
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Copilot AI review requested due to automatic review settings August 4, 2026 07:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@lornakelly lornakelly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lornakelly
lornakelly merged commit 123a530 into open-workflow-specification:main Aug 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Disable node dragging and conditionally display Source section

4 participants