DYN-5654 - Fix Watch node data preview for dictionary keys containing ':'#17080
DYN-5654 - Fix Watch node data preview for dictionary keys containing ':'#17080
Conversation
…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>
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 - answer only, would any of these changes be considered a breaking api change? |
No breaking API changes. Specifically:
No entries need to be added to |
|
from copilot: "No breaking API changes. Specifically: DictionaryKey is internal, so it is not part of the public API surface at all. |
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-5654
There was a problem hiding this comment.
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 updatedViewPathto use it when present. - Updated
DefaultWatchHandlerto populateDictionaryKeyfor dictionary children across relevant processing paths. - Added an NUnit test validating full key display (including
:) inViewPath.
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. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|



Purpose
DYN-5654: Fix Watch node displaying truncated labels for dictionary keys containing
:.WatchViewModel.ViewPathsplitPathon:and returnedsplits.Last(). SinceDefaultWatchHandlerbuilds child paths astag + ":" + 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— AddedDictionaryKeyinternal property;ViewPathreturns it directly when set, bypassing the path-split fallbackDefaultWatchHandler— Setschild.DictionaryKey = e.keyin all threeProcessThingoverloads (DesignScript.Builtin.Dictionary,IDictionary,MirrorData)WatchNodeTests— AddedWatchDictionaryWithColonInKey_ViewPathDisplaysFullKeyunit test verifying full key including:characters is preservedDeclarations
Check these if you believe they are true
Release Notes
Fixed Watch node displaying empty or truncated labels for dictionary keys that contain colons.
Reviewers
@DynamoDS/eidos
FYIs
@JacobSmall