Skip to content

Commit

Permalink
RC2.19.5 CherryPicks (#14989)
Browse files Browse the repository at this point in the history
* Re-work watch node display logic (#14841)

* improvements (#14497)

* [DYN-6455] Add warning text to selection node's initial warning (#14833)

* Fix PostDiff job

* Update Selection.cs

* made the warning persistent and then add removal code

* [DYN-6585] Fix Export workspace as Image option from Menu Item (#14809)

* Fix PostDiff job

* Update DynamoView.xaml

* Revert UI Blocking Function calls (#14766)

* [DYN-6354] Fix incorrect confidence score display in ML suggestions (#14829)

* Fix PostDiff job

* Update NodeAutoCompleteSearchViewModel.cs

* Update

* DYN-5745 re enable copy/paste capabilities for library searchBar (#14492)

* feat(library): keydown events binding and copy/paste for clipboard management

* refactor(library): OnPasteFromClipboard function for clipboard management including comments

* DYN-6364 Skip Lucene indexing process in UIless mode (#14523)

* skip Lucene indexing process in UIless mode

* Update comments

---------

Co-authored-by: Ashish Aggarwal <[email protected]>
Co-authored-by: Enzo Batista <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2024
1 parent 671f52a commit a1cb855
Show file tree
Hide file tree
Showing 18 changed files with 197 additions and 86 deletions.
4 changes: 2 additions & 2 deletions src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
// to distinguish one build from another. AssemblyFileVersion is specified
// in AssemblyVersionInfo.cs so that it can be easily incremented by the
// automated build process.
[assembly: AssemblyVersion("2.19.5.7826")]
[assembly: AssemblyVersion("2.19.5.7897")]


// By default, the "Product version" shown in the file properties window is
Expand All @@ -64,4 +64,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("2.19.5.7826")]
[assembly: AssemblyFileVersion("2.19.5.7897")]
4 changes: 2 additions & 2 deletions src/DynamoCore/Models/DynamoModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ internal LuceneSearchUtility LuceneUtility

/// <summary>
/// Flag to indicate that there is no UI on this process, and things
/// like the update manager and the analytics collection should be
/// disabled.
/// like the node index process, update manager and the analytics collection
/// should be disabled.
/// </summary>
public static bool IsHeadless { get; set; }

Expand Down
2 changes: 2 additions & 0 deletions src/DynamoCore/Utilities/LuceneSearchUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ internal LuceneSearchUtility(DynamoModel model)
/// </summary>
internal void InitializeLuceneConfig(string dirName, LuceneStorage storageType = LuceneStorage.FILE_SYSTEM)
{
if (DynamoModel.IsHeadless) return;

addedFields = new List<string>();

DirectoryInfo luceneUserDataFolder;
Expand Down
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.

6 changes: 3 additions & 3 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3342,10 +3342,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 @@ -3329,10 +3329,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
14 changes: 10 additions & 4 deletions src/DynamoCoreWpf/ViewModels/Preview/WatchViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,11 @@ public bool IsCollection
get { return isCollection; }
set
{
isCollection = value;
RaisePropertyChanged("IsCollection");
if (isCollection != value)
{
isCollection = value;
RaisePropertyChanged(nameof(IsCollection));
}
}
}

Expand All @@ -203,8 +206,11 @@ public IEnumerable<int> Levels
get { return levels; }
set
{
levels = value;
RaisePropertyChanged("Levels");
if (levels != value)
{
levels = value;
RaisePropertyChanged(nameof(Levels));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,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 @@ -359,7 +360,7 @@ internal void DisplayMachineLearningResults()

if (viewModelElement != null)
{
viewModelElement.AutoCompletionNodeMachineLearningInfo = new AutoCompletionNodeMachineLearningInfo(true, true, result.Score * 100);
viewModelElement.AutoCompletionNodeMachineLearningInfo = new AutoCompletionNodeMachineLearningInfo(true, true, Math.Round(result.Score * 100));
results.Add(viewModelElement);
}
}
Expand Down Expand Up @@ -392,7 +393,7 @@ internal void DisplayMachineLearningResults()

if (viewModelElement != null)
{
viewModelElement.AutoCompletionNodeMachineLearningInfo = new AutoCompletionNodeMachineLearningInfo(true, true, result.Score * 100);
viewModelElement.AutoCompletionNodeMachineLearningInfo = new AutoCompletionNodeMachineLearningInfo(true, true, Math.Round(result.Score * 100));
results.Add(viewModelElement);
}
}
Expand All @@ -409,10 +410,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 @@ -421,7 +422,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/Core/DynamoView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,11 @@
Tag="NoDownArrow"
IsEnabled="False">
<MenuItem Header="{x:Static p:Resources.DynamoViewFileMenuExportAsImage}"
Command="{Binding ValidateSaveImageResultCommand}"
Command="{Binding ValidateWorkSpaceBeforeToExportAsImageCommand }"
Name="saveImage">
</MenuItem>
<MenuItem Header="{x:Static p:Resources.DynamoViewFileMenuExport3DAsImage}"
Command="{Binding ValidateSaveImageResultCommand}"
Command="{Binding ValidateWorkSpaceBeforeToExportAsImageCommand }"
CommandParameter="{x:Static p:Resources.ScreenShotFrom3DParameter}"
Name="save3DImage">
</MenuItem>
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
2 changes: 0 additions & 2 deletions src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ public PreferencesView(DynamoView dynamoView)
stylesCustomColors = new ObservableCollection<CustomColorItem>();
UpdateZoomScaleValueLabel(LibraryZoomScalingSlider, lblZoomScalingValue);
UpdateZoomScaleValueLabel(PythonZoomScalingSlider, lblPythonScalingValue);
dynamoView.EnableEnvironment(false);
}

/// <summary>
Expand Down Expand Up @@ -170,7 +169,6 @@ private void CloseButton_Click(object sender, RoutedEventArgs e)

dynViewModel.PreferencesViewModel.TrustedPathsViewModel.PropertyChanged -= TrustedPathsViewModel_PropertyChanged;
dynViewModel.CheckCustomGroupStylesChanges(originalCustomGroupStyles);
(this.Owner as DynamoView).EnableEnvironment(true);

Close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public PackageManagerView(DynamoView dynamoView, PackageManagerViewModel package
Dynamo.Logging.Analytics.TrackEvent(
Actions.Open,
Categories.PackageManager);

dynamoView.EnableEnvironment(false);
}

private void OnRequestShowFileDialog(object sender, PackagePathEventArgs e)
Expand Down Expand Up @@ -105,7 +103,6 @@ private void PackageManagerPanel_MouseDown(object sender, MouseButtonEventArgs e
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
Analytics.TrackEvent(Actions.Close, Categories.PackageManager);
(this.Owner as DynamoView).EnableEnvironment(true);

Close();
}
Expand Down
49 changes: 30 additions & 19 deletions src/DynamoCoreWpf/Views/Preview/WatchTree.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -389,24 +389,17 @@
BorderBrush="#D3D3D3"
CornerRadius="0,0,2,2"
BorderThickness="0">

<DockPanel Name="ListLevelsDisplay" Height="27px" Visibility="{Binding IsCollection, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">

<!-- A draggable control to resize the Watch window -->
<Thumb Name="resizeThumb"
DockPanel.Dock="Right"
Margin="1,3,5,3"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Cursor="SizeNWSE"
DragDelta="ThumbResizeThumbOnDragDeltaHandler"
Visibility="Hidden">
<Thumb.Template>
<ControlTemplate>
<Polygon Fill="#AFAFAF" Points="0,8 8,8 8,0" />
</ControlTemplate>
</Thumb.Template>
</Thumb>
<Grid Name="ListLevelsGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<!-- Left Column display List Levels -->
<DockPanel Name="ListLevelsDisplay"
Height="27px"
Grid.Column="0"
Visibility="{Binding IsCollection, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">

<!-- Shows counts of all items in List -->
<TextBlock Name="ListItems"
Expand Down Expand Up @@ -466,7 +459,25 @@
</ListView.ItemTemplate>
</ListView>

</DockPanel>
</DockPanel>

<!-- Left Column display a draggable control to resize the Watch window -->
<Thumb Name="resizeThumb"
Grid.Column="1"
DockPanel.Dock="Right"
Margin="1,3,5,3"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Cursor="SizeNWSE"
DragDelta="ThumbResizeThumbOnDragDeltaHandler"
Visibility="Collapsed">
<Thumb.Template>
<ControlTemplate>
<Polygon Fill="#AFAFAF" Points="0,8 8,8 8,0" />
</ControlTemplate>
</Thumb.Template>
</Thumb>
</Grid>
</Border>
</Grid>
</UserControl>
14 changes: 10 additions & 4 deletions src/DynamoCoreWpf/Views/Preview/WatchTree.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Dynamo.ViewModels;
using System;
using CoreNodeModels;
using System.Linq;

namespace Dynamo.Controls
{
Expand Down Expand Up @@ -68,7 +69,7 @@ private void _vm_PropertyChanged(object sender, System.ComponentModel.PropertyCh

if (e.PropertyName == nameof(WatchViewModel.IsCollection))
{
// // The WatchTree controll will resize only if its role is a WatchNode (starts with an specific height), otherwise it won't resize (Bubble role).
// The WatchTree controll will resize only if its role is a WatchNode (starts with an specific height), otherwise it won't resize (Bubble role).
if (!Double.IsNaN(this.Height))
{
if (_vm.IsCollection)
Expand Down Expand Up @@ -100,10 +101,13 @@ private void _vm_PropertyChanged(object sender, System.ComponentModel.PropertyCh
{
if (!_vm.Children[0].IsCollection)
{
// We will use 7.5 as width factor for each character.
// if multiline string
if (NodeLabel.Contains(Environment.NewLine) || NodeLabel.Contains("\n"))
this.Height = defaultHeightSize;

double requiredWidth = (NodeLabel.Length * widthPerCharacter);
if (requiredWidth > (MaxWidthSize))
// We will use 7.5 as width factor for each character.
double requiredWidth = NodeLabel.Length * widthPerCharacter;
if (requiredWidth > MaxWidthSize)
{
requiredWidth = MaxWidthSize;
}
Expand All @@ -123,6 +127,8 @@ private void _vm_PropertyChanged(object sender, System.ComponentModel.PropertyCh
// Forcing not to display the Levels content when is being used for display info from another node like the Color Range
this.ListLevelsDisplay.Visibility = Visibility.Hidden;
this.ListLevelsDisplay.Height = 0;
// Hide resize grip
resizeThumb.Visibility = Visibility.Collapsed;
}
}
}
Expand Down
Loading

0 comments on commit a1cb855

Please sign in to comment.