Skip to content

DYN-10964: Add transient changed by assistant node highlight - #17360

Merged
ivaylo-matov merged 9 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-10964-Add-transient-changed_by_assistant-node-highlight
Oct 8, 2026
Merged

ivaylo-matov merged 9 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-10964-Add-transient-changed_by_assistant-node-highlight

Conversation

@ivaylo-matov

@ivaylo-matov ivaylo-matov commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

This PR aims to address DYN-10964.
This is the Dynamo side of DYN-10798.

After an AI assistant creates, edits, or moves nodes, those nodes are highlighted on the canvas so the user can see what changed. The highlight is separate from warning and error states. It is not saved in the .dyn file, and clearing it does not mark the graph unsaved

Dynamo does not turn the highlight on. DynamoMCP marks the nodes it touched. A later edit by the user clears the highlight on that node only. An edit that happens while an AI call is still in progress does not change the highlight

A separate PR on DynamoMCP side to follow once this is merged

Changes:

  • NodeModel.IsRecentlyModifiedByAI stores the highlight. It is ignored by file save and by undo
  • WorkspaceModel.IsAiEditInProgress tells Dynamo that an AI call is in progress. While it is true, a node edit does not clear the highlight. While it is false, a user edit clears it. The flag never turns the highlight on
  • the canvas draws the highlight zoomed in and zoomed out, and it stays visible when the node also has a warning or error.
  • the canvas context menu Clear AI Highlights clears every highlight without marking the graph unsaved
  • new public members are listed in PublicAPI.Unshipped
  • unit tests in WorkspaceModelTests cover clear-on-user-edit, no change during an AI call, one node only, transient nodes, unsaved state, undo, and file save
DYN-10798-Demo Screenshot 2026-10-01 122858 Screenshot 2026-10-01 122905

Declarations

Check these if you believe they are true

Release Notes

Nodes created, edited, or moved by an AI assistant are highlighted on the canvas until the user edits them or clears the highlights. The highlight is not saved with the graph.

Reviewers

@DynamoDS/eidos
@jasonstratton
@johnpierson

FYIs

@dnenov

Copilot AI balanced review requested due to automatic review settings October 1, 2026 12:06

@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

@ivaylo-matov ivaylo-matov changed the title DYN-10964: Add transient "changed by assistant" node highlight DYN-10964: Add transient changed by assistant node highlight Oct 1, 2026

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.

Copilot review overview

🟡 Changes recommended

Node dragging does not clear the highlight, and some combined low-zoom states can hide warning/error indicators.

Review effort: Balanced
Findings: 2 Medium severity · 2 Low severity

Open (4)
What changed in this PR

Adds transient canvas highlights for nodes modified by an AI assistant without affecting graph persistence or undo state.

Changes:

  • Adds core AI-edit/highlight state and clearing behavior.
  • Renders highlights across zoom levels and adds a clear-all context-menu command.
  • Adds API tracking, localization, and model tests.
File Description
test/​DynamoCoreTests/​Graph/​Workspaces/​WorkspaceModelTests.cs Tests highlight lifecycle and persistence.
src/​DynamoCoreWpf/​Views/​Core/​WorkspaceView.xaml.cs Refreshes clear-command availability.
src/​DynamoCoreWpf/​Views/​Core/​WorkspaceView.xaml Adds the clear-highlights menu item.
src/​DynamoCoreWpf/​Views/​Core/​NodeView.xaml.cs Renders the zoomed-in highlight.
src/​DynamoCoreWpf/​ViewModels/​Core/​WorkspaceViewModel.cs Implements highlight clearing.
src/​DynamoCoreWpf/​ViewModels/​Core/​NodeViewModel.cs Exposes and renders highlight state.
src/​DynamoCoreWpf/​UI/​Themes/​Modern/​DynamoColorsAndBrushes.xaml Defines the highlight brush.
src/​DynamoCoreWpf/​PublicAPI.Unshipped.txt Tracks new WPF APIs.
src/​DynamoCoreWpf/​Properties/​Resources.resx Adds the menu label resource.
src/​DynamoCoreWpf/​Properties/​Resources.en-US.resx Adds the English menu label.
src/​DynamoCoreWpf/​Properties/​Resources.Designer.cs Exposes the generated resource property.
src/​DynamoCoreWpf/​Commands/​WorkspaceCommands.cs Exposes the clear command.
src/​DynamoCore/​PublicAPI.Unshipped.txt Tracks new core APIs.
src/​DynamoCore/​Graph/​Workspaces/​WorkspaceModel.cs Tracks AI edit activity and clears highlights.
src/​DynamoCore/​Graph/​Nodes/​NodeModel.cs Stores transient highlight state and adjusts port deserialization.
Files not reviewed (1)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Generated file

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

Comment thread src/DynamoCore/Graph/Workspaces/WorkspaceModel.cs Outdated
Comment thread src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs Outdated
Comment thread src/DynamoCore/Graph/Nodes/NodeModel.cs
Comment thread src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs
ivaylo-matov and others added 3 commits October 1, 2026 13:31

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.

Copilot review overview

🔵 Needs a closer look

Frozen-node edits do not clear highlights, and the unrelated deserialization changes require separation or compatibility coverage.

Review effort: Balanced
Findings: None

Resolved since last review (4)
Files not reviewed (1)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Generated file
Previously missed (4)

In code that hasn't changed since last review

Medium severity Remove or test unrelated PortInfo deserialization changes

src/​DynamoCore/​Graph/​Nodes/​NodeModel.cs:2684

This hunk changes legacy PortInfo deserialization behavior—missing indices are now skipped, invalid default values preserve prior state, and list metadata is no longer reset when useLevels is false—but the PR is scoped and tested only for AI highlights. Revert this unrelated behavioral change from this PR, or describe it and add focused compatibility tests so the serialization impact can be reviewed independently.

Medium severity Frozen input edits do not clear AI highlights

src/​DynamoCore/​Graph/​Workspaces/​WorkspaceModel.cs:1711

Frozen nodes never reach this handler: NodeModel.OnNodeModified returns before raising Modified when IsFrozen is true (NodeModel.cs:1519-1526), although editable inputs still change their value and call it (BasicInteractive.cs:23-35). Therefore, editing a highlighted frozen input leaves the AI highlight set, contrary to the stated clear-on-user-edit behavior. Route highlight clearing through a user-edit notification that is not suppressed by the frozen execution guard, and add a frozen-node regression test.

Medium severity Add WPF coverage for clearing all AI highlights

src/​DynamoCoreWpf/​ViewModels/​Core/​WorkspaceViewModel.cs:1655

No test executes this command; the added core tests only toggle an individual model property. Add a WPF view-model test that highlights multiple nodes, executes ClearAIChangedHighlightsCommand, and verifies all highlights are cleared, CanExecute becomes false, and HasUnsavedChanges remains false. Similar workspace commands are exercised through their public command properties in ConnectorContextMenuTests.cs:124-134.

Low severity Use consistent AI acronym in the public member name

src/​DynamoCore/​Graph/​Workspaces/​WorkspaceModel.cs:1064

This new public member spells the acronym as Ai, while the other APIs introduced by this change use AI (IsRecentlyModifiedByAI and ClearAIChangedHighlightsCommand). Rename it to IsAIEditInProgress before the API ships, and update its PublicAPI entry and callers, so the permanent public surface is internally consistent.

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.

Copilot review overview

🟡 Changes recommended

Some user edits retain highlights, and the core PublicAPI declaration has incorrect casing.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Files not reviewed (1)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Generated file
Previously missed (1)

In code that hasn't changed since last review

Medium severity Clear AI highlights for non-position user edits

src/​DynamoCore/​Graph/​Workspaces/​WorkspaceModel.cs:1721

Clearing only from NodeModel.Modified misses user edits whose setters do not call OnNodeModified. For example, inline rename executes UpdateModelValueCommand for NodeModel.Name (NodeView.xaml.cs:1858-1859), but the Name setter only raises PropertyChanged (NodeModel.cs:468-475); visibility and freezing follow the same pattern. These edits mark the graph unsaved yet leave the AI highlight set, contrary to the stated clear-on-user-edit behavior. Clear the flag for affected nodes in the non-AI model-update path (while preserving intentional position and undo behavior) and cover one such edit with a regression test.

Comment thread src/DynamoCore/PublicAPI.Unshipped.txt Outdated

@jasonstratton jasonstratton 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.

Looks good. Just a couple of comments to address. Thanks.

Comment thread src/DynamoCoreWpf/Views/Core/WorkspaceView.xaml
Comment thread src/DynamoCore/PublicAPI.Unshipped.txt Outdated
Comment thread src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs
Comment thread src/DynamoCoreWpf/ViewModels/Core/NodeViewModel.cs Outdated
@ivaylo-matov
ivaylo-matov requested a review from a team as a code owner October 8, 2026 05:14

@jasonstratton jasonstratton 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.

Looks good and the demo we had during checkin was looking good too.

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@ivaylo-matov
ivaylo-matov merged commit 4187cfb into DynamoDS:master Oct 8, 2026
31 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