Skip to content

Commit

Permalink
improvements (#14497)
Browse files Browse the repository at this point in the history
  • Loading branch information
QilongTang authored Oct 20, 2023
1 parent afb6b39 commit 172d7a5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
36 changes: 18 additions & 18 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1721,13 +1721,13 @@ Next assemblies were loaded several times:
</data>
<data name="PackageFilterUpdatedTooltip" xml:space="preserve">
<value>Updated in the last 30 days</value>
</data>
</data>
<data name="PackageFilterDeprecatedTooltip" xml:space="preserve">
<value>Discontinued packages</value>
</data>
<data name="PackageFilterByDependency" xml:space="preserve">
<value>DEPENDENCY</value>
</data>
</data>
<data name="PackageFilterHasDependenciesTooltip" xml:space="preserve">
<value>Packages that require other packages to be installed</value>
</data>
Expand Down Expand Up @@ -3450,10 +3450,10 @@ You can manage this in Preferences -&gt; Security.</value>
<value>Node Autocomplete</value>
<comment>Preferences | Features | Node Autocomplete</comment>
</data>
<data name="HideNodesBelowSpecificConfidenceLevel" xml:space="preserve">
<value>Hide nodes below a specified confidence level</value>
<data name="PreferredConfidenceLevel" xml:space="preserve">
<value>Preferred confidence level</value>
</data>
<data name="HideNodesBelowSpecificConfidenceLevelInfo" xml:space="preserve">
<data name="PreferredConfidenceLevelInfo" xml:space="preserve">
<value>Confidence level appears next to each recommended node and represents estimated probability that the node is a good choice. When toggled on, this setting hides recommended nodes that don’t meet the specified confidence level. You can click the Low Confidence header to show the nodes.</value>
</data>
<data name="MLRecommendationNumberOfResults" xml:space="preserve">
Expand Down
6 changes: 3 additions & 3 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3437,10 +3437,10 @@ You can manage this in Preferences -&gt; Security.</value>
<value>Node Autocomplete</value>
<comment>Preferences | Features | Node Autocomplete</comment>
</data>
<data name="HideNodesBelowSpecificConfidenceLevel" xml:space="preserve">
<value>Hide nodes below a specified confidence level</value>
<data name="PreferredConfidenceLevel" xml:space="preserve">
<value>Preferred confidence level</value>
</data>
<data name="HideNodesBelowSpecificConfidenceLevelInfo" xml:space="preserve">
<data name="PreferredConfidenceLevelInfo" xml:space="preserve">
<value>Confidence level appears next to each recommended node and represents estimated probability that the node is a good choice. When toggled on, this setting hides recommended nodes that don’t meet the specified confidence level. You can click the Low Confidence header to show the nodes.</value>
</data>
<data name="MLRecommendationNumberOfResults" xml:space="preserve">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,13 @@ internal NodeAutoCompleteSearchViewModel(DynamoViewModel dynamoViewModel) : base
internal void ResetAutoCompleteSearchViewState()
{
DisplayAutocompleteMLStaticPage = false;
DisplayLowConfidence = false;
DisplayLowConfidence = PreferenceSettings.Instance.HideNodesBelowSpecificConfidenceLevel;
AutocompleteMLMessage = string.Empty;
AutocompleteMLTitle = string.Empty;
FilteredResults = new List<NodeSearchElementViewModel>();
FilteredHighConfidenceResults = new List<NodeSearchElementViewModel>();
FilteredLowConfidenceResults = new List<NodeSearchElementViewModel>();
searchElementsCache = new List<NodeSearchElementViewModel>();
}

private void InitializeDefaultAutoCompleteCandidates()
Expand Down Expand Up @@ -410,10 +411,10 @@ internal void DisplayMachineLearningResults()
}
}

// Show low confidence section if there are some results under threshold.
DisplayLowConfidence = FilteredLowConfidenceResults.Count() > 0;
// Show low confidence section if there are some results under threshold and feature enabled
DisplayLowConfidence = FilteredLowConfidenceResults.Any() && PreferenceSettings.Instance.HideNodesBelowSpecificConfidenceLevel;

if (FilteredHighConfidenceResults.Count() == 0)
if (!FilteredHighConfidenceResults.Any())
{
DisplayAutocompleteMLStaticPage = true;
AutocompleteMLTitle = Resources.AutocompleteLowConfidenceTitle;
Expand All @@ -422,7 +423,7 @@ internal void DisplayMachineLearningResults()
}

// By default, show only the results which are above the threshold
FilteredResults = FilteredHighConfidenceResults;
FilteredResults = PreferenceSettings.Instance.HideNodesBelowSpecificConfidenceLevel? FilteredHighConfidenceResults : results ;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@
IsChecked="{Binding Path=HideNodesBelowSpecificConfidenceLevelIsChecked}"
Style="{StaticResource EllipseToggleButton1}"
IsEnabled="{Binding Path=EnableHideNodesToggle}"/>
<Label Content="{x:Static p:Resources.HideNodesBelowSpecificConfidenceLevel}"
<Label Content="{x:Static p:Resources.PreferredConfidenceLevel}"
Margin="10,0,0,0"
VerticalAlignment="Center"
Foreground="{StaticResource PreferencesWindowFontColor}"
Expand All @@ -970,7 +970,7 @@
Style="{StaticResource QuestionIcon}"
ToolTipService.ShowDuration="30000">
<Image.ToolTip>
<ToolTip Content="{x:Static p:Resources.HideNodesBelowSpecificConfidenceLevelInfo}" Style="{StaticResource GenericToolTipLight}"/>
<ToolTip Content="{x:Static p:Resources.PreferredConfidenceLevelInfo}" Style="{StaticResource GenericToolTipLight}"/>
</Image.ToolTip>
</Image>
</StackPanel>
Expand Down

0 comments on commit 172d7a5

Please sign in to comment.