-
Notifications
You must be signed in to change notification settings - Fork 698
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
Onboard NuGet to Unified Settings and create General page #6229
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR contains changes to XAML files. Verify that you've completed the following tasks:
|
zivkan
reviewed
Jan 15, 2025
src/NuGet.Clients/NuGet.PackageManagement.UI/Xamls/ClearNuGetLocalResourcesWindow.xaml.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/ViewModels/ClearNuGetLocalsViewModel.cs
Outdated
Show resolved
Hide resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Outdated
Show resolved
Hide resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Outdated
Show resolved
Hide resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Outdated
Show resolved
Hide resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Outdated
Show resolved
Hide resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Outdated
Show resolved
Hide resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Outdated
Show resolved
Hide resolved
jeffkl
reviewed
Jan 15, 2025
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.
Looks good overall, thanks for including all of the screenshots. I'll review again after Andy's comments are resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Show resolved
Hide resolved
JoshuaBStevens
approved these changes
Jan 15, 2025
src/NuGet.Clients/NuGet.PackageManagement.UI/ViewModels/ClearNuGetLocalsViewModel.cs
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Xamls/ClearNuGetLocalResourcesWindow.xaml
Outdated
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Xamls/ClearNuGetLocalResourcesWindow.xaml.cs
Outdated
Show resolved
Hide resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Outdated
Show resolved
Hide resolved
...Get.Clients/NuGet.PackageManagement.VisualStudio/Services/ExternalSettingsProviderService.cs
Show resolved
Hide resolved
f868c9c
to
5857149
Compare
jeffkl
previously approved these changes
Jan 22, 2025
JoshuaBStevens
approved these changes
Jan 22, 2025
jeffkl
previously approved these changes
Jan 23, 2025
zivkan
previously approved these changes
Jan 23, 2025
src/NuGet.Clients/NuGet.PackageManagement.UI/Xamls/ClearNuGetLocalResourcesWindow.xaml.cs
Outdated
Show resolved
Hide resolved
1fd1147
to
50ec6bb
Compare
zivkan
approved these changes
Jan 23, 2025
jeffkl
approved these changes
Jan 23, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: NuGet/Home#14040
Description
General Options
The General Options are onboarded to the Unified Settings platform (USX) with the following major changes:
Our repo has a new
registration.json
which declares the property string values and types.Our repo implements the
IExternalSettingsProvider
to react to user input from the Unified Settings general page.The provider wraps our existing NuGet.Configuration types so that the monikers we list in our
registration.json
can be passed to NuGet's IExternalSettingsProvider implementation by USX.A GeneralStub page was added which points to the USX General page when the customer has enabled USX. The reason for this is so that if a customer opens a legacy options NuGet page (eg, Configuration Files), they can still see "General" listed there and be able to open the USX General page directly.
Settings stored in NuGet.config
The link will open the Configuration Files settings page (which is currently a legacy VS Options dialog).
Details
Clear NuGet local resources
Pressing "Clear NuGet Local resources" results in a modal dialog so that customers have an opportunity to cancel the operation, as shown below.
Details
As with legacy VS options, once started, the command cannot be cancelled (though I've proposed an enhancement to this if we see customers are using the feature).
Pressing "Yes" will open a modal dialog showing:
The modal window is a WPF window bound to a ViewModel setup to Execute NuGet's clear all
LocalsCommand
, and indicate state for whether the command is in-progress, and provide a status message upon completion.Once the window loads, it asks the VM to begin executing.
The command logs information to the Output Window in VS.
Once complete, the completion time is shown (legacy settings behavior) along with a completion status message (success or error text).
The close button is enabled.
If any error occurs, the exception will be shown in the dialog. Scrolling is supported for longer messages.
*Note that the aka.ms help URL shown is not directly clickable. This can be enhanced in a future iteration to be pulled out into its own Hyperlink.
Theming works properly in the modal dialog.
General Stub page
When a customer has opted-into Unified Settings then opens the legacy VS options for NuGet (eg, Package Sources), the General page will still appear.
Details
Instead of providing content, the stub page provides a link to directly open the General USX page. Before closing the legacy options dialog, it will prompt to save any pending changes:Error handling
In the current version of the VS SDK, individual errors beside each setting are not supported. I'll be addressing this in a separate effort (NuGet/Home#14062). I'd also like to support more explicit errors, as all of our boolean properties are defaulted to
false
for invalid user-supplied values in the NuGet.Config. This means we can't show what the value was here in USX, because that value is already converted tofalse
.Therefore, only "Default Package Management Format" can be an error in the present state of these settings.
I've introduced the following exceptions as failure
ExternalSettingOperationResults
so that the following are shown:Invalid datatype for "format"
![image](https://private-user-images.githubusercontent.com/49205731/405441049-e6a61bf3-c4e0-40f4-bb77-a10af5e362db.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODQwMjQsIm5iZiI6MTczOTI4MzcyNCwicGF0aCI6Ii80OTIwNTczMS80MDU0NDEwNDktZTZhNjFiZjMtYzRlMC00MGY0LWJiNzctYTEwYWY1ZTM2MmRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE0MjIwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkzMzg5OWVmOTI1YmQ4YzVlOWY4ODg3MGUyZTcxODJiNjdiMmJkMzI1ZGEwY2U1MmE5ZDUwNWEwYWUxZmFhYzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.kAmZ1IZDsIdVEnjxhqIacGpZpfTYFArHDp5qLNLcYjw)
Value out of range for "format"
![image](https://private-user-images.githubusercontent.com/49205731/405441216-a41d8918-c416-4aa5-9d4d-64bbc590bb6d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODQwMjQsIm5iZiI6MTczOTI4MzcyNCwicGF0aCI6Ii80OTIwNTczMS80MDU0NDEyMTYtYTQxZDg5MTgtYzQxNi00YWE1LTlkNGQtNjRiYmM1OTBiYjZkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE0MjIwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFjN2M5M2RjOTYyM2Q0ODI5NTkwZGM3N2NmOGIzNDU5YWNhMGExMjM1Mjg5YjhhODE5NTI0ZjljNTgyNDI5YmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.dQ8F2Qb4sNjrkM5g75emwwls9Qb8UlreuP2GWyU1dV4)
Psuedo-localization testing
Tested PLOC at minimum supported resolution of 1366x768 at 100% DPI scaling.
PLOC Screenshots
Note, I used a WPF runtime tool to add extra text that's shown here so I could be sure that a very long error message will scroll correctly.
Accessibility testing
The Clear Locals modal dialog shows all green in Accessibility Insights.
A
LiveTextBlock
announces the start and completion of the Clear Local ResourcesProgressBar
and I validated JAWS and Narrator picked up those text changes.I will schedule a test pass for this change as well.
Accessibility Screenshots
PR Checklist