Skip to content

DYN-9724: Allow Pins to Stay Until Connector is Actually Disconnected#16909

Open
ivaylo-matov wants to merge 8 commits intoDynamoDS:masterfrom
ivaylo-matov:DYN-9724-260217
Open

DYN-9724: Allow Pins to Stay Until Connector is Actually Disconnected#16909
ivaylo-matov wants to merge 8 commits intoDynamoDS:masterfrom
ivaylo-matov:DYN-9724-260217

Conversation

@ivaylo-matov
Copy link
Contributor

Purpose

This PR addresses DYN-9724

The changes in the code aim to improve the connector reconnection behavior so connector pins are preserved while a wire is being reconnected, instead of being dropped immediately when drag starts.

Changes:
Core reconnection/pin persistence

  • preserved pin locations during reconnection and reapplied them to the newly created permanent connector
  • added a centralized pin snapshot API on ConnectorModel (GetPinLocations) and reused it from both core and WPF reconnection flows

Transient connector/pin behavior

  • transient pins are now explicitly non-interactive
  • added IsInteractive to ConnectorPinViewModel
  • bound pin hit testing to IsInteractive in ConnectorPinView.xaml
  • transient pins are created with IsInteractive = false; permanent pins remain interactive.

Added a dedicated test:
ShiftReconnectionUsesNonInteractiveTransientPinsAndPersistsPins that verifies transient connector is used during drag and pins persist/recover as interactive on the final connector

DYN-9724-Fix

Declarations

Check these if you believe they are true

Release Notes

Improved connector reconnection so pins are preserved through drag using non-interactive transient pins and restored on the final connector, with added safety hardening and dedicated test coverage.

Reviewers

@zeusongit
@DynamoDS/eidos

FYIs

@dnenov
@johnpierson

cursoragent and others added 4 commits February 17, 2026 12:57
…onnect

Co-authored-by: Ivo Petrov <ivaylo-matov@users.noreply.github.com>
Connector pin reconnection behavior
Update ConnectorViewModelTests.cs
Copilot AI review requested due to automatic review settings February 20, 2026 13:08
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9724

Copy link
Contributor

Copilot AI left a comment

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 addresses DYN-9724 by implementing connector pin persistence during reconnection operations. When users perform shift-reconnections (dragging a wire to a different port), connector pins are now preserved through the operation using non-interactive transient pins during the drag, and restored as interactive pins on the final connector.

Changes:

  • Added pin location snapshot and restoration logic in both DynamoCore and DynamoCoreWpf
  • Introduced IsInteractive property to ConnectorPinViewModel to distinguish transient (non-interactive) from permanent (interactive) pins
  • Enhanced null safety throughout connector and pin view models for transient connector scenarios
  • Added comprehensive test coverage for the new reconnection behavior

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/DynamoCore/Graph/Connectors/ConnectorModel.cs Added GetPinLocations() method to provide centralized pin location snapshot API
src/DynamoCore/Models/DynamoModelCommands.cs Implemented pin location recording and consumption during reconnection workflows with dictionary-based tracking
src/DynamoCoreWpf/ViewModels/Core/ConnectorViewModel.cs Added SetTransientConnectorPinPositions() and enhanced null safety for transient connector scenarios
src/DynamoCoreWpf/ViewModels/Core/ConnectorPinViewModel.cs Introduced IsInteractive property to control pin interactivity
src/DynamoCoreWpf/Views/Core/ConnectorPinView.xaml Bound IsHitTestVisible to IsInteractive property
src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs Updated reconnection logic to preserve and restore pins through transient connectors
src/DynamoCoreWpf/PublicAPI.Unshipped.txt Added public API entries for IsInteractive property
test/DynamoCoreWpfTests/ConnectorViewModelTests.cs Added new test and updated existing test to verify pin persistence behavior

Comment on lines 334 to 345
public ConnectorPinViewModel(WorkspaceViewModel workspaceViewModel, ConnectorPinModel model)
{
this.WorkspaceViewModel = workspaceViewModel;
this.model = model;
InitializeCommands();
model.PropertyChanged += OnPinPropertyChanged;
ZIndex = ++StaticZIndex; // places the pin on top of all nodes/notes

DynamoSelection.Instance.Selection.CollectionChanged += SelectionOnCollectionChanged;

AddPinToGroupIfConnectedNodesInSameGroup();
}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The 'IsInteractive' property should be initialized to 'true' by default in the constructor to ensure non-transient pins created through normal workflows are interactive. Currently, the field defaults to false, which means regular pins would incorrectly be non-interactive unless explicitly set. Consider adding 'isInteractive = true;' in the ConnectorPinViewModel constructor, or alternatively, initialize the field with 'private bool isInteractive = true;'.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in ConnectorPinViewModel, IsInteractive is already initiated with

private bool isInteractive = true;

we also explicitly set IsInteractive = !isTransientPin in AddConnectorPinViewModel

@johnpierson
Copy link
Member

Testing locally, the speed is noticeable, which feels odd.

Also, this interaction is still confusing:
image

Copy link
Member

@johnpierson johnpierson left a comment

Choose a reason for hiding this comment

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

With testing between @jnealb and I, it feels ok when there is 1 or 2 pins on a wire. A larger amount is noticeable and laggy, but most folks will not have this many pins (I hope).

The lag still makes me hesitant to launch this at all, but I think the gain of not losing pins is worth it. Would appreciate your thoughts @Amoursol @achintyabhat

However, the weirdness when disconnecting the port on the left side of the wire does need fixed before considering merging this.

@ivaylo-matov
Copy link
Contributor Author

With testing between @jnealb and I, it feels ok when there is 1 or 2 pins on a wire. A larger amount is noticeable and laggy, but most folks will not have this many pins (I hope).

The lag still makes me hesitant to launch this at all, but I think the gain of not losing pins is worth it. Would appreciate your thoughts @Amoursol @achintyabhat

However, the weirdness when disconnecting the port on the left side of the wire does need fixed before considering merging this.

Sorry @johnpierson , it should be working now

2026-02-2515-26-33-ezgif com-video-to-gif-converter

@sonarqubecloud
Copy link

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.

4 participants