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

Onboard NuGet to Unified Settings and create General page #6229

Merged
merged 57 commits into from
Jan 23, 2025

Conversation

donnie-msft
Copy link
Contributor

@donnie-msft donnie-msft commented Jan 14, 2025

Bug

Fixes: NuGet/Home#14040

Description

General Options

The General Options are onboarded to the Unified Settings platform (USX) with the following major changes:

  1. Our repo has a new registration.json which declares the property string values and types.

  2. 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.

  3. 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.

image

Settings stored in NuGet.config

The link will open the Configuration Files settings page (which is currently a legacy VS Options dialog).

Details

image

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

image

  • 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).

    • The default button is "No" for "Clear all NuGet resources?".
  • Pressing "Yes" will open a modal dialog showing:

    • A status message
    • An indeterminate progress indicator
    • A close button once the execution completes
  • 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.

image

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:

image

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 to false.

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

Value out of range for "format"
image

  • Correcting the XML and pressing "Retry" or reopening the USX page will resolve the error

Psuedo-localization testing

Tested PLOC at minimum supported resolution of 1366x768 at 100% DPI scaling.

PLOC Screenshots

image
image
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.
image
image
image

Accessibility testing

The Clear Locals modal dialog shows all green in Accessibility Insights.
A LiveTextBlock announces the start and completion of the Clear Local Resources ProgressBar and I validated JAWS and Narrator picked up those text changes.
I will schedule a test pass for this change as well.

Accessibility Screenshots

image

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests - (Also see UI testing sections above). The settings provider just wraps existing NuGet.Configuration types, so relying on that test coverage for most of the NuGet settings logic.
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc. Document the General settings page in Unified Settings Home#14039

@donnie-msft donnie-msft requested a review from a team as a code owner January 14, 2025 17:27
Copy link

microsoft-github-policy-service bot commented Jan 14, 2025

This PR contains changes to XAML files. Verify that you've completed the following tasks:

@donnie-msft donnie-msft changed the title Dev donnie msft unified settings init three Onboard NuGet to Unified Settings and migrate General page Jan 14, 2025
@donnie-msft donnie-msft changed the title Onboard NuGet to Unified Settings and migrate General page Onboard NuGet to Unified Settings and create General page Jan 14, 2025
@jeffkl jeffkl requested review from zivkan and jeffkl January 14, 2025 21:14
Copy link
Contributor

@jeffkl jeffkl left a 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

@donnie-msft donnie-msft force-pushed the dev-donnie-msft-unifiedSettingsInitThree branch 2 times, most recently from f868c9c to 5857149 Compare January 22, 2025 01:31
@donnie-msft donnie-msft requested review from zivkan and jeffkl January 22, 2025 01:31
jeffkl
jeffkl previously approved these changes Jan 22, 2025
jeffkl
jeffkl previously approved these changes Jan 23, 2025
@donnie-msft donnie-msft dismissed stale reviews from zivkan and jeffkl via 50ec6bb January 23, 2025 19:18
@donnie-msft donnie-msft force-pushed the dev-donnie-msft-unifiedSettingsInitThree branch from 1fd1147 to 50ec6bb Compare January 23, 2025 19:18
@donnie-msft donnie-msft requested review from zivkan and jeffkl January 23, 2025 19:19
@donnie-msft donnie-msft enabled auto-merge (squash) January 23, 2025 20:03
@donnie-msft donnie-msft merged commit a4a2e3f into dev Jan 23, 2025
21 checks passed
@donnie-msft donnie-msft deleted the dev-donnie-msft-unifiedSettingsInitThree branch January 23, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NuGet needs to onboard to Unified Settings and create General page
4 participants