DYN-9092: fix port entry issue and refactor#16326
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9092
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue with port entry mapping and refactors how cluster and single auto-complete results are represented and filtered.
- Changed
Probabilityfrom string to double and updated related filtering logic - Refactored
SingleResultItemto inherit fromClusterResultItemand consolidated properties - Simplified result population in
NodeAutoCompleteBarViewModel, removed redundant lists, and introduced direct mapping toDNADropdownViewModel
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/NodeAutoCompleteViewExtension/Views/NodeAutoCompletePanelView.xaml.cs | Updated Probability property type from string to double |
| src/NodeAutoCompleteViewExtension/ViewModels/SingleResultItem.cs | Made SingleResultItem inherit from ClusterResultItem and replaced old score/port fields |
| src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs | Adjusted confidence threshold, removed FullSingleResults, simplified filtering and item addition |
| src/NodeAutoCompleteViewExtension/ViewModels/DNADropdownViewModel.cs | Added ClusterResultItem to carry underlying result data |
| src/DynamoCore/Search/NodeAutocompleteSearch.cs | Changed data contract of Probability from string to double |
Comments suppressed due to low confidence (4)
src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs:781
- The parameter name
filterredIndexcontains a typo and is ambiguous. Rename tofilteredIndexfor clarity.
internal void AddCluster(int filterredIndex)
src/DynamoCore/Search/NodeAutocompleteSearch.cs:286
- Changing
Probabilityfromstringtodoubleis a breaking change in the data contract. Update any API documentation and ensure consumers handle the new numeric type.
internal double Probability { get; set; }
src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs:171
- This updated filtering logic should be covered by unit tests to verify that results are correctly included or excluded based on the new
minClusterConfidenceScorethreshold.
return FullResults.Results.Where(x => x.Probability > minClusterConfidenceScore);
src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs:988
- This collection initialization uses
[], which is invalid for aDictionary. Replace withnew Dictionary<string, ImageSource>()or a valid C# 12 collection expression for dictionaries.
Dictionary<string, ImageSource> dict = [];
|
LGTM! |
ff76015 to
0a11150
Compare
solved a merge conflict by rebase, lets check that the pipeline runs successfully |
Purpose
Fix port entry issue and refactor Cluster and Single results. Related to PR #16281 where seach filtering was introduced.
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Fix port entry issue and refactor Cluster and Single results.
Reviewers
@BogdanZavu
@johnpierson
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of