Skip to content

DYN-10964: Undo/redo clears AI highlight for all node edits - #17387

Open
ivaylo-matov wants to merge 2 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-10964-Undo-clears-AI-node-highlight
Open

ivaylo-matov wants to merge 2 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-10964-Undo-clears-AI-node-highlight

Conversation

@ivaylo-matov

Copy link
Copy Markdown
Contributor

Purpose

This is a small PR to follow-up to #17360 (AI-modified node highlight).

Undo/redo did not clear the AI highlight when the undone edit was a rename, lacing, preview, freeze or position change. Those edits don't raise Modified, which is what normally clears the highlight.

Fix: WorkspaceModel.ReloadModel (used by every undo/redo of a node) now clears IsRecentlyModifiedByAI on the node it restores. Undo and redo now count as the user touching the node.

Tests added in AIHighlightUndoRedoTests:

  • undo clears the highlight (and redo doesn't bring it back) for name, lacing, preview, freeze, position and value edits
  • undo leaves the highlight on nodes it doesn't touch

Declarations

Check these if you believe they are true

Release Notes

Undo/redo now clears the AI-modified highlight on nodes for all edit types.

Reviewers

@DynamoDS/eidos
@jasonstratton
@johnpierson

FYIs

@dnenov

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

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://autodesk.atlassian.net/browse/DYN-10964

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@ivaylo-matov
ivaylo-matov marked this pull request as ready for review October 9, 2026 07:43
@ivaylo-matov
ivaylo-matov requested a review from a team as a code owner October 9, 2026 07:43
@ivaylo-matov
ivaylo-matov requested review from jasonstratton and a balanced review from Copilot October 9, 2026 07:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Redo clearing is implemented but not directly exercised with an active highlight.

1 open finding
What changed in this PR

Ensures undo/redo clears AI-modified node highlights when restoring edited nodes.

Changes:

  • Clears IsRecentlyModifiedByAI after undo/redo deserialization.
  • Adds coverage for common node edits and untouched nodes.
File Description
src/​DynamoCore/​Graph/​Workspaces/​UndoRedo.cs Clears AI highlights when restoring nodes.
test/​DynamoCoreTests/​Graph/​Nodes/​AIHighlightUndoRedoTests.cs Tests highlight behavior across undo/redo scenarios.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

// does not raise Modified, which is what clears the highlight for other edits.
if (model is NodeModel node)
{
node.IsRecentlyModifiedByAI = false;

This branch has not been deployed

No deployments
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