Skip to content

DYN-5654 - Fix Watch node data preview for dictionary keys containing ':'#17080

Merged
jasonstratton merged 5 commits into
masterfrom
copilot/fix-dictionary-preview-issue
Apr 30, 2026
Merged

DYN-5654 - Fix Watch node data preview for dictionary keys containing ':'#17080
jasonstratton merged 5 commits into
masterfrom
copilot/fix-dictionary-preview-issue

Conversation

Copilot AI commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Purpose

DYN-5654: Fix Watch node displaying truncated labels for dictionary keys containing :.

WatchViewModel.ViewPath split Path on : and returned splits.Last(). Since DefaultWatchHandler builds child paths as tag + ":" + key, any key containing : (e.g. "Hope:", ":This Isn't Right:") was silently truncated — garbled labels in Watch preview while underlying data remained intact.

Key changes:

  • WatchViewModel — Added DictionaryKey internal property; ViewPath returns it directly when set, bypassing the path-split fallback
  • DefaultWatchHandler — Sets child.DictionaryKey = e.key in all three ProcessThing overloads (DesignScript.Builtin.Dictionary, IDictionary, MirrorData)
  • WatchNodeTests — Added WatchDictionaryWithColonInKey_ViewPathDisplaysFullKey unit test verifying full key including : characters is preserved

Declarations

Check these if you believe they are true

Note: DictionaryKey is internal. IWatchHandler.cs was modified — reviewer should confirm no public API surface changed.

Release Notes

Fixed Watch node displaying empty or truncated labels for dictionary keys that contain colons.

Reviewers

@DynamoDS/eidos

FYIs

@JacobSmall

Copilot AI and others added 2 commits April 28, 2026 14:25
…eview

When a dictionary key contains ':', the WatchViewModel.ViewPath property was
incorrectly splitting the path string on ':' and returning only the last
segment - showing an empty string instead of the full key.

Fix: store the dictionary key explicitly in a new `DictionaryKey` internal
property on WatchViewModel, and use it in ViewPath instead of parsing the
path. Set DictionaryKey in DefaultWatchHandler for all three dictionary
child-building code paths (DesignScript.Builtin.Dictionary, IDictionary,
and MirrorData).

Also adds a unit test that directly verifies ViewPath returns the full
key (including any ':' characters) for dictionary children.

Agent-Logs-Url: https://github.com/DynamoDS/Dynamo/sessions/a4c60d93-4cbe-4a52-832c-9548ee1a4827

Co-authored-by: johnpierson <15744724+johnpierson@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix dictionary with ':' breaking data previews Fix Watch node data preview for dictionary keys containing ':' Apr 28, 2026
Copilot AI requested a review from johnpierson April 28, 2026 14:27
@johnpierson

Copy link
Copy Markdown
Member

@copilot - answer only, would any of these changes be considered a breaking api change?

Copilot AI commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot - answer only, would any of these changes be considered a breaking api change?

No breaking API changes. Specifically:

  • DictionaryKey is internal, so it is not part of the public API surface at all.
  • ViewPath is already in PublicAPI.Shipped.txt — its signature (-> string) is unchanged. The return value now correctly reflects the full dictionary key rather than the truncated-at-colon value, which is a bug fix to existing (broken) behavior, not a contract change.
  • All ProcessThing overloads in DefaultWatchHandler are private — no public surface affected there.

No entries need to be added to PublicAPI.Unshipped.txt.

@johnpierson

Copy link
Copy Markdown
Member

from copilot:

"No breaking API changes. Specifically:

DictionaryKey is internal, so it is not part of the public API surface at all.
ViewPath is already in PublicAPI.Shipped.txt — its signature (-> string) is unchanged. The return value now correctly reflects the full dictionary key rather than the truncated-at-colon value, which is a bug fix to existing (broken) behavior, not a contract change.
All ProcessThing overloads in DefaultWatchHandler are private — no public surface affected there.
No entries need to be added to PublicAPI.Unshipped.txt."

@johnpierson johnpierson changed the title Fix Watch node data preview for dictionary keys containing ':' DYN-5654 - Fix Watch node data preview for dictionary keys containing ':' Apr 28, 2026

@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://jira.autodesk.com/browse/DYN-5654

@johnpierson johnpierson marked this pull request as ready for review April 28, 2026 15:09
Copilot AI review requested due to automatic review settings April 28, 2026 15:09

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.

Pull request overview

Fixes Watch node preview labels being truncated when dictionary keys contain : by avoiding Path-based splitting for dictionary children.

Changes:

  • Added WatchViewModel.DictionaryKey (internal) and updated ViewPath to use it when present.
  • Updated DefaultWatchHandler to populate DictionaryKey for dictionary children across relevant processing paths.
  • Added an NUnit test validating full key display (including :) in ViewPath.

Reviewed changes

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

File Description
test/DynamoCoreWpf3Tests/WatchNodeTests.cs Adds regression test ensuring keys containing : are displayed fully.
src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs Introduces DictionaryKey and updates ViewPath behavior for dictionary children.
src/DynamoCoreWpf/Interfaces/IWatchHandler.cs Sets DictionaryKey on generated child WatchViewModels for dictionaries.

Comment thread src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs Outdated
@sonarqubecloud

Copy link
Copy Markdown

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

LGTM

@jasonstratton

Copy link
Copy Markdown
Contributor

@jasonstratton

Copy link
Copy Markdown
Contributor

SelfServe and Smoke Test jobs successful

Merging

@jasonstratton jasonstratton merged commit 66a0a1c into master Apr 30, 2026
29 of 31 checks passed
@jasonstratton jasonstratton deleted the copilot/fix-dictionary-preview-issue branch April 30, 2026 18:32
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.

Dictionary with a ":" results in broken data previews.

4 participants