Skip to content

Conversation

@antlio
Copy link
Contributor

@antlio antlio commented Dec 1, 2025

description
this pr is a proposal to:

  • increase node handle hit area on desktop
  • connect edge to handle automatically on over the node release
state preview
after
after.mov

@vercel
Copy link
Contributor

vercel bot commented Dec 1, 2025

@antlio is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@antlio antlio force-pushed the anthony/feat-react-flow-handles branch from e4855f3 to 1705bcb Compare December 1, 2025 22:18
@antlio antlio force-pushed the anthony/feat-react-flow-handles branch from 1705bcb to fa13f06 Compare December 1, 2025 22:20
@ctate
Copy link
Collaborator

ctate commented Dec 2, 2025

Great work on this! The drop-on-node connection feature is a nice UX improvement

One small thing I noticed: when dragging from a target handle and dropping on empty canvas, the edge direction might be inverted. In handleConnectionToNewNode, the edge is always created with the connecting node as the source:

const newEdge = {
  id: nanoid(),
  source: sourceNodeId,
  target: newNode.id,
  type: "animated",
};

But if dragging from a target handle, the new node should feed into the connecting node. You could mirror the logic from handleConnectionToExistingNode:

const fromSource = connectingHandleType.current === "source";

const newEdge = {
  id: nanoid(),
  source: fromSource ? sourceNodeId : newNode.id,
  target: fromSource ? newNode.id : sourceNodeId,
  type: "animated",
};

Let me know if I'm missing something!

@antlio
Copy link
Contributor Author

antlio commented Dec 2, 2025

@ctate great catch thank you for the feedback, just added in your suggestion without extracting it as there are only two occurrences but let me know!

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.

2 participants