Skip to content

Conversation

@dnenov
Copy link
Collaborator

@dnenov dnenov commented Jun 30, 2025

Purpose

Addresses this jira thread: https://jira.autodesk.com/browse/DYN-8656

Previously, rehosting Node connectors (wires) would cause Pins to be 'lost' in the undo/redo stack. This PR fixes that and now Pins will correctly be recreated when undoing changes.

As an additional change, triggering this behavior will now correctly raise undo/redo changes activating the undo button.

Changes

DynamoSandbox_4oLXaHIx8d

Declarations

Check these if you believe they are true

  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB
  • This PR introduces new feature code involve network connecting and is tested with no-network mode.

Release Notes

  • fixed the flow of the shift-reconnect routine
  • first of all, added the connection deletion as part of the recordanddelete logic
  • secondly, now recording the pins as part of the saved Models to be group when the new stack of wires is created. The order of savedModels matter
  • added tests
  • raises undoredo changes

Reviewers

@jasonstratton
@reddyashish
@zeusongit

FYIs

@achintyabhat

- fixed the flow of the shift-reconnect routine
- first of all, added the connection deletion as part of the recordanddelete logic
- secondly, now recording the pins as part of the saved Models to be group when the new stack of wires is created. The order of savedModels matter
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-8656

@dnenov dnenov requested a review from jasonstratton June 30, 2025 18:08
- added test
- now raises undoredo event when triggering the command
@dnenov dnenov marked this pull request as ready for review June 30, 2025 18:22
dnenov added 2 commits July 2, 2025 09:36
- increase the popup await to allow for the system to initialize the popup window - test fix
@dnenov
Copy link
Collaborator Author

dnenov commented Jul 8, 2025

I don't see any failing tests, but I am not sure if there are things to be resolved on this one.

image

@jasonstratton
Copy link
Contributor

I don't see any failing tests, but I am not sure if there are things to be resolved on this one.

I'm not sure why the tests are failing, but I thought there might be an issue with other PR as well. @zeusongit, is there a build issue currently?

@jasonstratton jasonstratton requested a review from Copilot July 8, 2025 18:39
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 ensures that connector pins are correctly handled in the undo/redo stack when reconnecting wires, raises the undo/redo UI state for connection commands, and adds tests to validate the new behavior.

  • Record and delete connector pins in the undo/redo workflow for reconnections
  • Trigger the undo/redo UI button when connection commands complete
  • Add and update tests (and the .dyn test graph) to cover connector-pin reconnection scenarios

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/UI/ConnectorPinTests.dyn Expanded the test graph with a new code block node and updated connector visibility schema
test/DynamoCoreWpfTests/ConnectorViewModelTests.cs Added CanUndoShiftReconnectionWithConnectorPin test
test/DynamoCoreWpf2Tests/ViewExtensions/NotificationsExtensionTests.cs Increased popup-wait timeout in UI test
src/DynamoCoreWpf/Commands/DynamoCommands.cs Added RaiseCanExecuteUndoRedo() on MakeConnectionCommand completion
src/DynamoCore/Models/DynamoModelCommands.cs Removed manual connector deletes in BeginShiftReconnections
src/DynamoCore/Graph/Workspaces/UndoRedo.cs Enhanced RecordAndDeleteModels/SaveAndDeleteModels to include connector pins
Comments suppressed due to low confidence (2)

test/UI/ConnectorPinTests.dyn:88

  • Using the property IsHidden instead of the expected IsVisible may not be recognized by the Dynamo graph loader; please revert to IsVisible or confirm that IsHidden is supported in the .dyn schema.
      "IsHidden": "False"

src/DynamoCore/Graph/Workspaces/UndoRedo.cs:6

  • The Autodesk.DesignScript.Geometry using directive is not used in this file and can be removed to keep imports clean.
using Autodesk.DesignScript.Geometry;

}
return false;
}, 180);
}, 300);
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider extracting the hardcoded timeout 300 into a named constant or configuration value to clarify its purpose and make future adjustments easier.

Suggested change
}, 300);
}, NotificationPopupTimeout);

Copilot uses AI. Check for mistakes.
@zeusongit
Copy link
Contributor

I don't see any failing tests, but I am not sure if there are things to be resolved on this one.

I'm not sure why the tests are failing, but I thought there might be an issue with other PR as well. @zeusongit, is there a build issue currently?

Yes, there have been multiple issues today

@zeusongit
Copy link
Contributor

@zeusongit
Copy link
Contributor

Running here: https://master-5.jenkins.autodesk.com/job/Dynamo/job/DynamoSelfServe/job/pullRequestValidation/18125/

One test failure, but unrelated, merging

@zeusongit zeusongit merged commit ebc7217 into DynamoDS:master Jul 9, 2025
25 of 28 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.

3 participants