Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,11 @@ public string PythonTemplateFilePath
/// </summary>
public bool EnableNodeAutoComplete { get; set; }

/// <summary>
/// This allows the user to enable or disable the new node auto complete menu.
/// </summary>
public bool EnableNewNodeAutoCompleteUI { get; set; }

/// <summary>
/// PolyCurve normal and direction behavior has been made predictable in Dynamo 3.0 and has therefore changed.
/// This defines whether legacy (pre-3.0) PolyCurve behavior is selected by default.
Expand Down Expand Up @@ -1008,6 +1013,7 @@ public PreferenceSettings()
IsIronPythonDialogDisabled = false;
ShowTabsAndSpacesInScriptEditor = false;
EnableNodeAutoComplete = true;
EnableNewNodeAutoCompleteUI = true;
DefaultEnableLegacyPolyCurveBehavior = true;
HideNodesBelowSpecificConfidenceLevel = false;
MLRecommendationConfidenceLevel = 10;
Expand Down
2 changes: 2 additions & 0 deletions src/DynamoCore/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ Dynamo.Configuration.PreferenceSettings.EnableDynamoPlayerRenamedWatchAsOutput.g
Dynamo.Configuration.PreferenceSettings.EnableDynamoPlayerRenamedWatchAsOutput.set -> void
Dynamo.Configuration.PreferenceSettings.EnableNodeAutoComplete.get -> bool
Dynamo.Configuration.PreferenceSettings.EnableNodeAutoComplete.set -> void
Dynamo.Configuration.PreferenceSettings.EnableNewNodeAutoCompleteUI.get -> bool
Dynamo.Configuration.PreferenceSettings.EnableNewNodeAutoCompleteUI.set -> void
Dynamo.Configuration.PreferenceSettings.EnableNotificationCenter.get -> bool
Dynamo.Configuration.PreferenceSettings.EnableNotificationCenter.set -> void
Dynamo.Configuration.PreferenceSettings.EnablePersistExtensions.get -> bool
Expand Down
3 changes: 1 addition & 2 deletions src/DynamoCoreWpf/Commands/PortCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public DelegateCommand NodeAutoCompleteCommand
get
{
if (autoCompleteCommand == null)
autoCompleteCommand ??= new DelegateCommand(NodeViewModel.WorkspaceViewModel.DynamoViewModel.IsDNAClusterPlacementEnabled ? AutoCompleteCluster : AutoComplete, CanAutoComplete);

autoCompleteCommand ??= new DelegateCommand(AutoComplete, CanAutoComplete);
return autoCompleteCommand;
}
}
Expand Down
18 changes: 18 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

7 changes: 7 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -4155,4 +4155,11 @@ To make this file into a new template, save it to a different folder, then move
<data name="GroupFrozenButtonToolTip" xml:space="preserve">
<value>This group is frozen. Click to unfreeze.</value>
</data>
<data name="PreferencesViewEnableNodeAutoCompleteNewUI" xml:space="preserve">
<value>Enable New UI</value>
<comment>Preferences | Features | Experimental | Enable Node AutoComplete New UI</comment>
</data>
<data name="PreferencesViewEnableNodeAutoCompleteNewUITooltipText" xml:space="preserve">
<value>Enable the new floating menu for node suggestions for a more streamlined workflow. Turn off to return to the traditional pop-up dialog.</value>
</data>
</root>
9 changes: 8 additions & 1 deletion src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2690,6 +2690,10 @@ Uninstall the following packages: {0}?</value>
<value>Enable Node Autocomplete</value>
<comment>Preferences | Features | Experimental | Enable Node Auto Complete</comment>
</data>
<data name="PreferencesViewEnableNodeAutoCompleteNewUI" xml:space="preserve">
<value>Enable New UI</value>
<comment>Preferences | Features | Experimental | Enable Node Auto Complete New UI</comment>
</data>
<data name="ErrorLoadingIcon" xml:space="preserve">
<value>An error occurred when loading the application icon: {0}</value>
<comment>{0} = detailed error message</comment>
Expand Down Expand Up @@ -2863,6 +2867,9 @@ Do you wish to uninstall {1}? Restart {2} to complete the uninstall and try down
<data name="PreferencesViewEnableNodeAutoCompleteTooltipText" xml:space="preserve">
<value>Learn more about Node Autocomplete feature.</value>
</data>
<data name="PreferencesViewEnableNodeAutoCompleteNewUITooltipText" xml:space="preserve">
<value>Enable the new floating menu for node suggestions for a more streamlined workflow. Turn off to return to the traditional pop-up dialog.</value>
</data>
<data name="AddStyleButton" xml:space="preserve">
<value>Add Style</value>
</data>
Expand Down Expand Up @@ -4139,4 +4146,4 @@ To make this file into a new template, save it to a different folder, then move
<data name="GroupFrozenButtonToolTip" xml:space="preserve">
<value>This group is frozen. Click to unfreeze.</value>
</data>
</root>
</root>
4 changes: 4 additions & 0 deletions src/DynamoCoreWpf/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,8 @@ Dynamo.ViewModels.PreferencesViewModel.MLRecommendationNumberOfResults.get -> in
Dynamo.ViewModels.PreferencesViewModel.MLRecommendationNumberOfResults.set -> void
Dynamo.ViewModels.PreferencesViewModel.NodeAutocompleteIsChecked.get -> bool
Dynamo.ViewModels.PreferencesViewModel.NodeAutocompleteIsChecked.set -> void
Dynamo.ViewModels.PreferencesViewModel.NodeAutocompleteNewUIIsChecked.get -> bool
Dynamo.ViewModels.PreferencesViewModel.NodeAutocompleteNewUIIsChecked.set -> void
Dynamo.ViewModels.PreferencesViewModel.NodeAutocompleteMachineLearningIsBeta.get -> bool
Dynamo.ViewModels.PreferencesViewModel.NodeAutocompleteMachineLearningIsChecked.get -> bool
Dynamo.ViewModels.PreferencesViewModel.NodeAutocompleteMachineLearningIsChecked.set -> void
Expand Down Expand Up @@ -5065,6 +5067,8 @@ static Dynamo.Wpf.Properties.Resources.NodeAutocomplete.get -> string
static Dynamo.Wpf.Properties.Resources.NodeAutocompleteDocumentationUriString.get -> string
static Dynamo.Wpf.Properties.Resources.NodeAutoCompleteNotAvailableForCollapsedGroups.get -> string
static Dynamo.Wpf.Properties.Resources.NodeAutoCompleteToolTip.get -> string
static Dynamo.Wpf.Properties.Resources.PreferencesViewEnableNodeAutoCompleteNewUI.get -> string
static Dynamo.Wpf.Properties.Resources.PreferencesViewEnableNodeAutoCompleteNewUITooltipText.get -> string
static Dynamo.Wpf.Properties.Resources.NodeContextMenuEnablePeriodicUpdate.get -> string
static Dynamo.Wpf.Properties.Resources.NodeContextMenuHelp.get -> string
static Dynamo.Wpf.Properties.Resources.NodeContextMenuIsInput.get -> string
Expand Down
11 changes: 11 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@ internal bool IsDNAClusterPlacementEnabled
}
}

/// <summary>
/// Controls if the new DNA Flyout is enabled from preference settings.
/// </summary>
internal bool IsNewDNAUIEnabled
{
get
{
return model.PreferenceSettings.EnableNewNodeAutoCompleteUI;
}
}

/// <summary>
/// Count of unresolved issues on the linter manager.
/// This is used for binding in the NotificationsControl
Expand Down
30 changes: 12 additions & 18 deletions src/DynamoCoreWpf/ViewModels/Core/PortViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,29 +560,23 @@ private void AutoComplete(object parameter)
return;
}

var existingPort = wsViewModel.NodeAutoCompleteSearchViewModel.PortViewModel;
if (existingPort != null)
if (wsViewModel.DynamoViewModel.IsNewDNAUIEnabled)
{
existingPort.Highlight = Visibility.Collapsed;
wsViewModel?.OnRequestNodeAutocompleteBar(this);
}
else
{
var existingPort = wsViewModel.NodeAutoCompleteSearchViewModel.PortViewModel;
if (existingPort != null)
{
existingPort.Highlight = Visibility.Collapsed;
}

wsViewModel.NodeAutoCompleteSearchViewModel.PortViewModel = this;

wsViewModel.OnRequestNodeAutoCompleteSearch();
}
wsViewModel.NodeAutoCompleteSearchViewModel.PortViewModel = this;

// Handler to invoke Node autocomplete cluster
private void AutoCompleteCluster(object parameter)
{
//handle the mouse event to prevent connection from starting
MouseButtonEventArgs evArgs = parameter as MouseButtonEventArgs;
if (evArgs != null)
{
evArgs.Handled = true;
wsViewModel.OnRequestNodeAutoCompleteSearch();
}

var wsViewModel = node.WorkspaceViewModel;
wsViewModel?.OnRequestNodeAutocompleteBar(this);

}

private void NodePortContextMenu(object obj)
Expand Down
16 changes: 16 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,22 @@ public bool NodeAutocompleteIsChecked
}
}

/// <summary>
/// Controls the IsChecked property in the "Node autocomplete new menu" toggle button
/// </summary>
public bool NodeAutocompleteNewUIIsChecked
{
get
{
return preferenceSettings.EnableNewNodeAutoCompleteUI;
}
set
{
preferenceSettings.EnableNewNodeAutoCompleteUI = value;
RaisePropertyChanged(nameof(NodeAutocompleteNewUIIsChecked));
}
}

/// <summary>
/// If MLAutocompleteTOU is approved
/// </summary>
Expand Down
32 changes: 30 additions & 2 deletions src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
Comment thread
johnpierson marked this conversation as resolved.
</Grid.RowDefinitions>

<StackPanel Orientation="Horizontal" Margin="0,12,0,0" Grid.Row="0">
Expand Down Expand Up @@ -941,8 +942,35 @@
</Image>
</Label>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="0,0,0,0" Grid.Row="1"
<StackPanel Orientation="Horizontal" Margin="0,12,0,0" Grid.Row="1">
<ToggleButton Name="NodeAutocompleteNewUIToggle"
Width="{StaticResource ToggleButtonWidth}"
Height="{StaticResource ToggleButtonHeight}"
VerticalAlignment="Center"
IsChecked="{Binding Path=NodeAutocompleteNewUIIsChecked}"
Style="{StaticResource EllipseToggleButton1}"/>
<Label Content="{x:Static p:Resources.PreferencesViewEnableNodeAutoCompleteNewUI}"
FontWeight="Normal"
Margin="10,0,0,0"
VerticalAlignment="Center"
Foreground="{StaticResource PreferencesWindowFontColor}">
</Label>
<Label Name="NodeAutocompleteNewUILabel" MouseLeftButtonDown="OnMoreInfoClicked">
<Image Name="NodeAutocompleteNewUIToolTip"
Margin="5,3,0,0"
Width="14"
Height="14"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource QuestionIconClickable}"
ToolTipService.ShowDuration="30000">
<Image.ToolTip>
<ToolTip Content="{x:Static p:Resources.PreferencesViewEnableNodeAutoCompleteNewUITooltipText}" Style="{StaticResource GenericToolTipLight}"/>
</Image.ToolTip>
</Image>
</Label>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,0" Grid.Row="2"
Visibility="{Binding HideAutocompleteMethodOptions, Converter={StaticResource InverseBoolToVisibilityCollapsedConverter}}">
<!-- This Grid contains controls for selecting the Node autocomplete method -->
<Grid Margin="0,0,0,0">
Expand Down
1 change: 1 addition & 0 deletions test/settings/DynamoSettings-NewSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<IsIronPythonDialogDisabled>true</IsIronPythonDialogDisabled>
<ShowTabsAndSpacesInScriptEditor>true</ShowTabsAndSpacesInScriptEditor>
<EnableNodeAutoComplete>false</EnableNodeAutoComplete>
<EnableNewNodeAutoCompleteUI>false</EnableNewNodeAutoCompleteUI>
<DefaultEnableLegacyPolyCurveBehavior>false</DefaultEnableLegacyPolyCurveBehavior>
<HideNodesBelowSpecificConfidenceLevel>true</HideNodesBelowSpecificConfidenceLevel>
<MLRecommendationConfidenceLevel>99</MLRecommendationConfidenceLevel>
Expand Down
Loading