DYN-10262 - Delete any pinned notes when deleting a node#16982
Merged
jasonstratton merged 5 commits intoApr 1, 2026
Conversation
… note Previously, deleting a node left its pinned note orphaned in the workspace. This fix moves the cascade logic into RecordAndDeleteModels so that deleting a node also deletes any note pinned to it (and vice versa), and the entire operation is recorded as a single atomic undo/redo action. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10262
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an undo/redo corruption edge case by ensuring pinned notes and their pinned nodes are cascade-deleted together as a single atomic undoable action, and removes now-redundant UI-side deletion logic.
Changes:
- Adds cascade delete logic for pinned note ↔ node relationships into
WorkspaceModel.RecordAndDeleteModels(UndoRedo). - Removes the
PinnedNodeViewModel.Removedevent handler fromNoteViewModelthat previously triggeredDeleteCommand. - Adds NUnit UI tests covering delete/undo/redo behaviors for pinned note ↔ node deletion.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| test/DynamoCoreWpf3Tests/NoteViewTests.cs | Adds regression tests for cascading delete + undo/redo around pinned notes/nodes. |
| src/DynamoCoreWpf/ViewModels/Core/NoteViewModel.cs | Removes redundant node-removed event handler that triggered a delete command indirectly. |
| src/DynamoCore/Graph/Workspaces/UndoRedo.cs | Implements cascade delete behavior within undo recording/deletion logic. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ing framework limitation
|
zeusongit
approved these changes
Mar 31, 2026
Contributor
|
The failing test has been fixed in a separate PR |
jasonstratton
added a commit
to jasonstratton/Dynamo
that referenced
this pull request
Apr 8, 2026
jasonstratton
added a commit
that referenced
this pull request
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Edge case discovered during testing of DYN-10130 / DYN-9599. Depends on infrastructure from DYN-10130 (#16942) and DYN-10261 (#16953): When deleting a node that has a pinned note, the note will be orphaned in a pinned state, which leaves the undo/redo stack corrupted
Purpose
This fix moves cascade logic into RecordAndDeleteModels (UndoRedo.cs) so that deleting a node also deletes any pinned note (and vice versa), recorded as a single atomic undo/redo action. The old PinnedNodeViewModel_OnPinnedNodeRemoved event handler is removed as it is now redundant.
Declarations
Check these if you believe they are true
Release Notes
Fixed a bug where deleting a node with a pinned note left the note orphaned in the workspace. Deleting a node now also deletes any note pinned to it (and vice versa), with full undo/redo support.
FYIs
Detailed notes can be found here: https://git.autodesk.com/strattj/DynaNotes/blob/main/DYN-10262/README.md