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

Advanced installer rework #790

Merged
merged 357 commits into from
Nov 30, 2023
Merged

Advanced installer rework #790

merged 357 commits into from
Nov 30, 2023

Conversation

Al12rs
Copy link
Contributor

@Al12rs Al12rs commented Nov 27, 2023

Closes #750 .
This PR completely reworks the Advanced Manual installer code to follow the UI Coding Guidelines, as well as solving a number of other issues:

Addressed problems:

  • Move the AdvancedInstaller.cs file to the main AdvancedInstaller project instead of in the AdvancedInstaller UI project.
  • Installer breaks in CLI settings. Add implementation of the installer that is CLI compatible (return nothing -> fail). Use DI to get the UI version in UI setting.
  • Remove the use of generics in AdvancedInstaller.cs, either use DI instead or just remove the need from the testing side.
  • Use a Window instead of an Overlay. This is to allow moving and resizing the window, which was problematic on size constrained displays.
  • Adopt the new UI Coding Guidelines.
  • Restructure the code to be centralized in the main BodyVM, all other VMs should simple data containers with as little logic.
  • Solve problem of not being able to access required data or objects from the scattered code.
  • Reduce the number of Views and VMs by compacting them.
  • Remove the code that populates Suggested Locations from the FileSystem. Instead populate using LocationIds.
  • Use Dynamic Data flat trees for all the used ViewModel tree structures.
  • Rename the three ITreeEntryVM to differentiate them.
  • Use Optional values instead of Nullable.
  • Cleanup namespaces and reorganize the code files.
  • Rework the Tests for the new code.
  • Properly comment the code.

Added features missing in previous version:

  • Duplicated folder Pill.
  • Folder merged Pill.
  • Make Suggested Locations clearer.
  • Show nested LocationIds in the Suggested section (e.g. Data for bethesda games)
  • Auto focus on the the editing box after pressing Create Folder Button.
  • Auto expand newly created folders.
  • Save created folder on pressing ENTER.
    Scroll down to the created folder entry. (SKIPPED)
  • Auto Expand new entries in Preview view (matching ModContent expanded state).
  • Show trees selected item for keyboard navigation.
  • Change color of expander chevron during hover, to give visual feedback of interaction area.
  • Increase hitbox for expander interaction.
  • Expand ModContent folders on pressing the Install button to select them for mapping.

Additional Changes:

  • Fixed some Button Text alignment and cutoff.
  • Don't show failed mod mod install entry in Loadout in case of user cancelling installation.
  • Fix Create Folder button allowing the creation of duplicated folder names.
  • Remove Window TitleBar while keeping window move functionality (needs testing on non Windows os).
  • Use a single tree with multiple roots instead of multiple trees with a single root.
  • Fixed Suggested Locations subtitle being wrong.
  • Add Optional.ValueOr(Value) extension method, to avoid valueSelector action overhead.
  • Comments and cleanup
  • Review/Fix Tests.

TODO:

  • Update tests after Paths library changes are merged in to test case changes
Sewer56 and others added 30 commits October 11, 2023 03:10
Copy link
Member

@erri120 erri120 left a comment

Choose a reason for hiding this comment

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

We should do a squash merge.

@codecov-commenter
Copy link

Codecov Report

Merging #790 (772518e) into main (0af4b76) will decrease coverage by 1.12%.
Report is 32 commits behind head on main.
The diff coverage is 60.28%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #790      +/-   ##
==========================================
- Coverage   63.38%   62.26%   -1.12%     
==========================================
  Files         585      594       +9     
  Lines       17869    18580     +711     
  Branches     1254     1324      +70     
==========================================
+ Hits        11326    11569     +243     
- Misses       6203     6658     +455     
- Partials      340      353      +13     
Flag Coverage Δ
Linux 61.67% <60.28%> (-1.06%) ⬇️
Windows 61.49% <60.28%> (-1.11%) ⬇️
clean_environment_tests 62.25% <60.28%> (-1.12%) ⬇️
network_tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...Content/TreeEntry/IModContentTreeEntryViewModel.cs 100.00% <100.00%> (ø)
...ht/Preview/TreeEntry/IPreviewTreeEntryViewModel.cs 100.00% <100.00%> (ø)
...ocation/TreeEntry/ISelectableTreeEntryViewModel.cs 100.00% <100.00%> (ø)
...dvancedInstaller.UI/Resources/Language.Designer.cs 6.94% <100.00%> (-2.28%) ⬇️
...s/NexusMods.Games.AdvancedInstaller.UI/Services.cs 100.00% <100.00%> (ø)
...exusMods.Games.AdvancedInstaller/DeploymentData.cs 97.43% <100.00%> (ø)
...ames/NexusMods.Games.AdvancedInstaller/Services.cs 100.00% <100.00%> (ø)
...xusMods.Games.BethesdaGameStudios/ABethesdaGame.cs 100.00% <ø> (ø)
...aGameStudios/Exceptions/MissingMastersException.cs 0.00% <ø> (ø)
.../NexusMods.App.UI/Theme/ButtonStyles/Standard.xaml 97.43% <100.00%> (-0.24%) ⬇️
... and 28 more

... and 10 files with indirect coverage changes

@erri120 erri120 merged commit 52678ee into main Nov 30, 2023
5 checks passed
@erri120 erri120 deleted the advanced-installer-rework branch November 30, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants