Skip to content

Introduce 'Fix with GitHub Copilot' vulnerabilities InfoBar to PM UI with reusable InfoBar service - #7640

Merged
donnie-msft merged 1 commit into
devfrom
dev-donnie-msft-fixVulnerableInfoBarPMUI
Aug 25, 2026
Merged

donnie-msft merged 1 commit into
devfrom
dev-donnie-msft-fixVulnerableInfoBarPMUI

Conversation

@donnie-msft

@donnie-msft donnie-msft commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#15080
Fixes: https://github.com/NuGet/Client.Engineering/issues/3798

Description

Adds a Fluent VS InfoBar to the Package Manager UI that warns when the current
project/solution has installed vulnerable package versions, with a
"Fix with GitHub Copilot" action.

image
  • Created a reusable InfoBar service that utilizes VS InfoBar UI without new UI code. This sets us up to replace our custom XAML with the standard VS INfoBars in other areas of PM UI.
    • Keyed InfoBar host (ShowInfoBar / UpdateInfoBar / HideInfoBar with per-key
      action/close callbacks). The vulnerabilities bar is the first consumer; the
      service is designed to also back the LoadingStatus, PackageRestore, and
      RestartRequest bars in future work.
  • Vulnerabilities InfoBar: PackageManagerVulnerabilitiesInfoBar shows when
    the installed vulnerable-package count is > 0, updates the count live, hides at
    0, and stays dismissed for the session if the user closes it.
    • Reuses the Installed-tab tooltip verbiage: the InfoBar message is built
      from the same text as the Installed-tab warning tooltip via the shared
      UIUtility.GetInstalledVulnerablePackagesWarningText(count) helper, so both
      stay consistent.

    • The telemetry event reuses existing patterns, with FixVulnerabilitiesSource.PackageManagerInfoBar /
      NavigationOrigin.PMUI_FixVulnerabilitiesWithCopilot.

image
  • Pluralization fix ("1 versions" → "1 version"):
    • This corrects the pre-existing tooltip bug and applies everywhere the text is shown (project
      and solution Installed-tab tooltips + the InfoBar).
image

Validation

  • Installed a vulnerable package version, confirmed the InfoBar appears in both
    Solution and Project PM UI.
  • Edited Directory.Packages.props to a non-vulnerable version externally; after
    the PM UI refresh, the InfoBar auto-closes (count recomputes to 0 →
    HideInfoBar), matching the Installed-tab warning icon clearing.
  • Verified via debugger that the close happens through the normal refresh path
    with no exceptions thrown.
  • Confirmed the singular/plural text renders correctly for counts of 1 vs. many.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@donnie-msft
donnie-msft requested a review from a team as a code owner August 19, 2026 22:39
@dotnet-policy-service

dotnet-policy-service Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

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

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.

Bring "Fix with Copilot" for vulnerable packages into PM UI

3 participants