-
Notifications
You must be signed in to change notification settings - Fork 635
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
Conversation
/// <summary> | ||
/// If true, autocomplete method options are hidden from UI | ||
/// </summary> | ||
public bool HideAutocompleteMethodOptions { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinzart @mjkkirschner Is this allowed to add new params in this class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://learn.microsoft.com/en-us/dotnet/core/compatibility/library-change-rules
looks at DISALLOWED: Adding an instance field to a struct that has no nonpublic fields
If a struct has only public fields or has no fields at all...
Adding any new fields - public or nonpublic - to such a struct is a source breaking change for these callers, as the compiler will now require the additional fields to be initialized.
But doesn’t a bool have a default value ?On Mar 17, 2023, at 3:08 PM, pinzart90 ***@***.***> wrote:
@pinzart90 commented on this pull request.
In src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs:
@@ -655,6 +655,11 @@ public struct StartConfiguration
/// If true, Analytics and Usage options are hidden from UI
/// </summary>
public bool HideReportOptions { get; set; }
+
+ /// <summary>
+ /// If true, autocomplete method options are hidden from UI
+ /// </summary>
+ public bool HideAutocompleteMethodOptions { get; set; }
https://learn.microsoft.com/en-us/dotnet/core/compatibility/library-change-rules
looks at DISALLOWED: Adding an instance field to a struct that has no nonpublic fields
Adding any new fields - public or nonpublic - to such a struct is a source breaking change for these callers, as the compiler will now require the additional fields to be initialized.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
It does, but that is not the issue. Try this code in c#:
If you remove the breaking change, you will see that the code compiles |
@pinzart90 Got it, sorry, in C++ it would fail only if you use initializer list... |
I don't know strict we've been in the past about this case. I think we've done this before without knowing it is a breaking change. |
This needs to avoid breaking compatibility
/// Temporary interface to avoid breaking changes. | ||
/// TODO: Merge with StartupConfiguration for 3.0 (DYN-1699) | ||
/// </summary> | ||
internal interface IHideAutocompleteMethodOptions |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@mjkkirschner any other ideas besides yet another interface ? |
no better ideas, except perhaps just modifying the concrete type. |
@spodo99 there is a test failure: Dynamo.Tests.Configuration.PreferenceSettingsTests.TestImportCopySettings |
@pinzart @mjkkirschner I think startup params should also work for them right? See https://github.com/DynamoDS/Dynamo/blob/master/src/DynamoSandbox/DynamoCoreSetup.cs#L40, I guess when Alias launching DynamoSandbox, they can pass in param to modify certain feature sets. Essentially, this might just be similar to the existing approach anyway |
I think that like Tibi said, it's an API break, but it's unclear to me who would be affected. IMO The new preference is safer, the startup config option seems more idiomatic in our repo at the cost of integrators potentially having runtime or compile time failures. (unlikely I guess). Perhaps we should add a constructor for these structs - @pinzart90 would that avoid this issue in the future? |
@mjkkirschner Added missing option to the new setting file |
Hi @spodo99 it looks good to me. I guess ideally it would be good to add a test that asserts the UI is actually hidden or that the preferences file actually modifies the view model ? I know UI tests are sometimes painful to write in wpf. Perhaps because of the time constraints here you could merge this and send a followup for a UI test if it's straightforward enough to write - maybe something like this test: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test failure is a flaky ui test.
As communicated internally, we will make a 2.17.2 release for this, so this needs to be cherry-picked to https://github.com/DynamoDS/Dynamo/tree/RC2.17.2_master |
@mjkkirschner , @avidit found that I missed several option controls in the Preferences menu. I created a PR #13859 fixing this. I control visibility of the entire StackPanel containing all ML controls now. Could you please merge it with 2.17.2 as well, if it's ok? |
…moDS#13834) * ALSO-5603 Add parameter hiding autocomplete options from the UI * ALSO-5603 Use IPreferences for hide autocomplete option This needs to avoid breaking compatibility * ALSO-5603 Add hide autocomplete option to the settings * ALSO-5603 Fix unit test
* ALSO-5603 Add parameter hiding autocomplete options from the UI (#13834) * ALSO-5603 Add parameter hiding autocomplete options from the UI * ALSO-5603 Use IPreferences for hide autocomplete option This needs to avoid breaking compatibility * ALSO-5603 Add hide autocomplete option to the settings * ALSO-5603 Fix unit test * ALSO-5603 Hide missing ML complete controls if hiding option is set (#13859) --------- Co-authored-by: spodo99 <[email protected]>
* ALSO-5603 Add parameter hiding autocomplete options from the UI * ALSO-5603 Use IPreferences for hide autocomplete option This needs to avoid breaking compatibility * ALSO-5603 Add hide autocomplete option to the settings * ALSO-5603 Fix unit test
Please Note:
DynamoRevit
repo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after aLGTM
label is added to the PR.Purpose
The new flag is added to the setting to hide new autocomplete method options, if it will be requested by the users. Per conversation at https://autodesk.slack.com/archives/C1866AFQB/p1679067914031959
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Mandatory section
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of