Skip to content

Fix/153 pin connections sometimes get destroyed#227

Merged
felix-schultz merged 2 commits intodevfrom
fix/153-pin-connections-sometimes-get-destroyed
Aug 23, 2025
Merged

Fix/153 pin connections sometimes get destroyed#227
felix-schultz merged 2 commits intodevfrom
fix/153-pin-connections-sometimes-get-destroyed

Conversation

@felix-schultz
Copy link
Copy Markdown
Member

This pull request refactors and improves the flow node and pin components in the UI, focusing on better type safety, more robust handling of dynamic pins, and improved user feedback. The changes enhance reliability when updating and removing pins, simplify component interfaces, and improve UI consistency.

Flow Node and Pin Management Improvements:

  • Improved type safety and fallback handling for pin color assignment in flow-node.tsx, ensuring a default type is used when pin data is missing.
  • Refactored the pin removal logic in flow-node.tsx to separately handle input and output pins, preserve sorting, and update indices correctly, making the process more robust and less error-prone.

Flow Pin Component Refactoring:

  • Updated flow-pin.tsx to use useReactFlow instead of useInternalNode, added error feedback with toast notifications, and improved node/pin updates for better reliability and user experience. [1] [2] [3] [4] [5]
  • Made the onPinRemove callback optional and ensured delete buttons only appear when this callback is provided, preventing UI errors and improving clarity. Also restyled delete buttons for better UI consistency. [1] [2]
  • Simplified the rendering logic in FlowPin to always use the memoized inner component and added missing keys for dynamic pins, preventing rendering issues.

Component Interface and Type Updates:

  • Refactored PinEdit in pin-edit.tsx to use an explicit props interface and memoized FC, improving readability and type safety. Also fixed the effect dependency for better reliability. [1] [2] [3]

@felix-schultz felix-schultz merged commit 7873f07 into dev Aug 23, 2025
1 of 4 checks passed
@felix-schultz felix-schultz deleted the fix/153-pin-connections-sometimes-get-destroyed branch August 23, 2025 14:23
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.

1 participant