-
Notifications
You must be signed in to change notification settings - Fork 668
Dyn 3541 preferences visual settings #11636
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
Dyn 3541 preferences visual settings #11636
Conversation
I added a new workflow (issue_type_predicte.yaml) that is using the ML.NET model for predicting the issue type (source repo), so If a new issue is created in the Dynamo repo this workflow will run and will predict if is a Wishlist issue or not. If is a Wishlist issue it will be labeled as "Wishlist" and then another workflow will move the issue to the DynamoWishlist repo. If the issue is incomplete or is not valid the label "NotMLEvaluated" will be added to the issue. Also I added two scripts more, one will return the issue body in a json string and the other one will clan the issue body removing sections not used like "Dynamo Version" or "Stack Trace"
When testing the issue predicter workflow the issues labeled as Wishlist were not moved to the DynamoWishlist repo due that the "Move Issue by labels" workflow failed. There was a problem with the PAT used to label the issue, I was using the wrong one (no triggers actions).
I added the UI Controls for the Visual Settings tab. The next functionalities were implemented: - Add new Styles - Remove existing Styles - Validate against existing Styles. - Functionality for expand/collapse WPF Expanders
Moving some steps located in the PreferencesView constructor to a method.
There was an extra color in DynamoModern.xaml that is not used then I remove it.
I added a new Style for the buttons Save and Cancel, since they have a specific Style Also I modified the Style for the Add Style button since it was not following the design in hig autodesk.
Also I added a Style for the color button picker, added one text resource so it can be used in the xaml and finally I indented the xaml code.
I included the Display Settings sections and the two toggle buttons described in the AC Also I did a modification so when the "Add Style" button is pressed the focus goes to the Group Name edit box.
| <Content Include="sharpdx_direct3d11_effects_x86.dll"> | ||
| <CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
| </Content> | ||
| <Resource Include="UI\Images\trash_icon.png" /> |
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.
hmm.. I was surprised that we did not use font awesome for this. Is this icon from UX?
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 I removed the png image from the project and I used the FontAwesome toolit for the trash icon, see the commit: 0fb11cd
| Medium, | ||
| Large, | ||
| ExtraLarge | ||
| } |
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.
Is there a similar enum for the previous UI that we will need to obsolete? Just curious
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 I obsoleted the existing enum located in DynamoCoreWpf\UI\Prompts\ChangeScaleFactorPrompt.xaml.cs file, see commit: 0fb11cd
| foreach (Expander expander in parentGrid.Children) | ||
| { | ||
| if (expander != currentExpander) | ||
| expander.IsExpanded = false; |
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.
Thanks! Although this will be covered in a different task, no harm to include and this is what I imagined how we would implement, thanks!
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.
@Astul-Betizagasti see that I implemented the expanders functionality in case you need to use it in other places.
Thanks
| /// <summary> | ||
| /// This class will contain the Enum value and the corresponding description for each radio button in the Visual Settings -> Geometry Scaling section | ||
| /// </summary> | ||
| public class GeometryScalingOptions |
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.
Would you double check if all the added public classed/properties need to be public or could be internal?
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 I added two classes StyleItem and GeometryScalingOptions, the StyleItem class need to be public since is used in public methods that are called in the code behind (If i change to internal got several errors) also the GeometryScalingOptions need to be public because there is a public property declared (GeometryScalingOptions type) and used as a binding in the PreferencesView.xaml (also is if changed to internal I got several errors).
- Removed the png image and instead use fontawesome - Removed duplicated resources for Show Edges and Isolate Selected Geometry - Obsolete a enum in ChangeScaleFactorPrompt class - Some changes in indentation and creating region for private properties
| /// This method will remove the current Style selected from the Styles list | ||
| /// </summary> | ||
| /// <param name="groupName"></param> | ||
| public void RemoveStyleEntry(string groupName) |
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.
@RobertGlobant20 I guess what I was curious was more for these utility functions, seems they can be internal since only used in DynamoCoreWpf
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 I modified the accesibility level for the next public methods to internal located in the PreferencesViewModel class:
- void RemoveStyleEntry
- bool ValidateExistingStyle
- void ResetAddStyleControl()
- string GetRandomHexStringColor()
Check commit: af9a3ca
Thanks
| /// </summary> | ||
| /// <param name="item1"></param> | ||
| /// <returns></returns> | ||
| public bool ValidateExistingStyle(StyleItem item1) |
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.
Same here and other placed, please go through them and validate. Just trying to avoid exposing public things if we do not have to
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 I modified the accesibility level for the next public methods to internal located in the PreferencesViewModel class:
- void RemoveStyleEntry
- bool ValidateExistingStyle
- void ResetAddStyleControl()
- string GetRandomHexStringColor()
Check commit: af9a3ca
Thanks
QilongTang
left a comment
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.
Once current comments are addressed, LGTM
Based on Aaron's comments I changed the visibility from public to internal in 4 methods located in PreferencesViewModel.
QilongTang
left a comment
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.
Please address the conflicts and check SonarQ check. Then LGTM


Purpose
I added the UI Controls for the Preferences -> Visual Settings tab.
The next functionalities were implemented:
Add new Styles
Remove existing Styles
Validate against existing Styles.
Functionality for expand/collapse WPF Expanders automatically.
I'm not including the Display Settings section since Jingyi asked me not to include it (there was no feedback from users), in case the design is ready I will include it in a different pull request.
The acceptance criteria for this task was updated some days ago so those changes will be addressed in a different pull request.
Declarations
Check these if you believe they are true
*.resxfilesReviewers
@QilongTang
FYIs
@Astul-Betizagasti