Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALSO-5603 Add parameter hiding autocomplete options from the UI #13834

Merged
merged 5 commits into from
Mar 29, 2023
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
12 changes: 12 additions & 0 deletions src/DynamoCore/Configuration/IPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@ internal interface IDisablePackageLoadingPreferences
bool DisableCustomPackageLocations { get; set; }
}

/// <summary>
/// Temporary interface to avoid breaking changes.
/// TODO: Merge with StartupConfiguration for 3.0 (DYN-1699)
/// </summary>
internal interface IHideAutocompleteMethodOptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QilongTang if there are plans to introduce new options like this one, maybe we can put it in the same place before the next release.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pinzart90 I don't think we do currently, we intend to use Launchdarkly to control beta features and UI aspects in general.

{
/// <summary>
/// If true, autocomplete method options are hidden from UI
/// </summary>
bool HideAutocompleteMethodOptions { get; set; }
}

/// <summary>
/// Represents data about active state of preview background
/// </summary>
Expand Down
8 changes: 7 additions & 1 deletion src/DynamoCore/Configuration/PreferenceSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ internal static void CopyProperties(this PreferenceSettings source, PreferenceSe
/// from a XML file from DYNAMO_SETTINGS_FILE.
/// When GUI is closed, the settings are saved back into the XML file.
/// </summary>
public class PreferenceSettings : NotificationObject, IPreferences, IRenderPrecisionPreference, IDisablePackageLoadingPreferences, ILogSource
public class PreferenceSettings : NotificationObject, IPreferences, IRenderPrecisionPreference, IDisablePackageLoadingPreferences, ILogSource, IHideAutocompleteMethodOptions
{
private string numberFormat;
private string lastUpdateDownloadPath;
Expand Down Expand Up @@ -552,6 +552,11 @@ public string PythonTemplateFilePath
/// </summary>
public int MLRecommendationNumberOfResults { get; set; }

/// <summary>
/// If true, autocomplete method options are hidden from UI
/// </summary>
public bool HideAutocompleteMethodOptions { get; set; }

/// <summary>
/// This defines if user wants to see the enabled Dynamo Notification Center.
/// </summary>
Expand Down Expand Up @@ -814,6 +819,7 @@ public PreferenceSettings()
HideNodesBelowSpecificConfidenceLevel = false;
MLRecommendationConfidenceLevel = 10;
MLRecommendationNumberOfResults = 10;
HideAutocompleteMethodOptions = false;
EnableNotificationCenter = true;
isStaticSplashScreenEnabled = true;
DefaultPythonEngine = string.Empty;
Expand Down
3 changes: 1 addition & 2 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,7 @@ protected DynamoViewModel(StartConfiguration startConfiguration)
model.ComputeModelDeserialized += model_ComputeModelDeserialized;
model.RequestNotification += model_RequestNotification;

preferencesViewModel = new PreferencesViewModel(this);

preferencesViewModel = new PreferencesViewModel(this);

if (!DynamoModel.IsTestMode && !DynamoModel.IsHeadless)
{
Expand Down
11 changes: 11 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,17 @@ public bool PersistExtensionsIsChecked

#region [ Node Autocomplete ]

/// <summary>
/// If true, autocomplete method options are hidden from UI
/// </summary>
public bool HideAutocompleteMethodOptions
{
get
{
return preferenceSettings.HideAutocompleteMethodOptions;
}
}

/// <summary>
/// Controls the IsChecked property in the "Node autocomplete" toogle button
/// </summary>
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 @@ -745,11 +745,11 @@
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0"
<Label Grid.Row="0" Visibility="{Binding HideAutocompleteMethodOptions, Converter={StaticResource InverseBoolToVisibilityCollapsedConverter}}"
Margin="-8,15,10,3"
Content="{x:Static p:Resources.PreferencesNodeAutocompleteMethod}"
Foreground="{StaticResource PreferencesWindowFontColor}"/>
<Grid Grid.Row="1">
<Grid Grid.Row="1" Visibility="{Binding HideAutocompleteMethodOptions, Converter={StaticResource InverseBoolToVisibilityCollapsedConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="colObjectType" Width="Auto"/>
<ColumnDefinition x:Name="colMachineLearning" Width="Auto"/>
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 @@ -69,6 +69,7 @@
<HideNodesBelowSpecificConfidenceLevel>true</HideNodesBelowSpecificConfidenceLevel>
<MLRecommendationConfidenceLevel>99</MLRecommendationConfidenceLevel>
<MLRecommendationNumberOfResults>5</MLRecommendationNumberOfResults>
<HideAutocompleteMethodOptions>true</HideAutocompleteMethodOptions>
<EnableNotificationCenter>false</EnableNotificationCenter>
<EnableStaticSplashScreen>false</EnableStaticSplashScreen>
<EnablePersistExtensions>true</EnablePersistExtensions>
Expand Down