NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

The “top-level packages” node doesn’t show when searching an installed top-level package in the “Installed” tab #12591

Open v-luzh opened 1 year ago

v-luzh commented 1 year ago

NuGet Product Used

Visual Studio Package Management UI

Product Version

Dev\6.7.0.42

Worked before?

No response

Impact

It bothers me. A fix would be nice

Repro Steps & Context

Repro Steps:

  1. Set the “NUGET_TRANSITIVE_DEPENDENCIES_IN_PMUI” environment variable to “1”.
  2. Create an F# Console App (.NET Framework 4.8.1) project in VS.
  3. Right-Click the project in the Solution Explorer window and select ‘Manage NuGet Packages…’.
  4. Click “Browse” tab and select the “nuget.org” from Package source drop-down list.
  5. Search “FSharp.Net.Http” package in the filter of “Browse” tab, select version “1.0.0” in the “Version” drop-down box and click the “Install” button on the right panel.
  6. Click OK button in the “Preview Changes” dialog and click the “Installed” tab.

Expected:

The package “FSharp.Net.Http” shows under the “top-level packages” node in the “Installed” tab. The “transitive packages” node shows correctly when searching for an installed transitive package as below. image

Actual:

The “top-level packages” node doesn’t show as below screenshot. image

Note:

It reproes on D17.5\33530.505.

Verbose Logs

No response

jebriede commented 1 year ago

In the first scenario, it's expected that "Top-level packages" would not appear since the search criteria doesn't match any top-level packages: image

In the second scenario, where our search criteria matches only a top-level package, the "Top-level packages" group does not appear. This isn't a regression and is how the feature was designed. Whenever the packages list does not contain any transitive packages, the group headers don't appear. We make the decision to show the group headers only if the packages list contains transitive packages. Otherwise, we don't show the group headers. The same is true when we search for packages -- the package list is the search results, so if doesn't contain any transitive packages, we don't show group headers. This decision was made for two reasons:

  1. If there are no transitive packages in the list or no transitive packages that meet the search criteria, there seems to be no reason to differentiate between top-level and transitive packages.
  2. We key off of the packages list to determine if we should be showing the group headers. If there are transitive packages in the list, we show group headers. Otherwise, we do not. That way, we don't have packages in the Installed Tab showing "Top-level packages" group header when there are only top-level packages and no transitive packages. This also ensures other tabs that don't have transitive packages don't show the group headers since they don't have transitive packages.

We can consider changing the design -- we could make it so it always shows group headers on the Installed tab (when the feature is on) and prevent showing group headers if the tab is anything but Installed. Since this is working as intended, I wouldn't consider this a bug, but we can consider a DCR if we want to change the design.

jebriede commented 1 year ago

If you search for "http" in the scenario described in the repro, it will match both a top-level and transitive package and the group headers will appear since the packages list will contain one or more transitive packages: image

v-luzh commented 1 year ago

Hi @jebriede, thanks very much for your detailed instructions. We got that's by-design for now. But we think it is better to show the nodes (no matter if it is top-level or transitve) when searching in "Installed" tab, since that would be more intuitionistic for user to know if the searched package is top-level or not. And that would be more consistent with the scenario you mentioned in your last screenshot.

The above suggestion is just our opinions from test team. Please have a discussion about it. All the design will up to your decisions. Thanks again.

CiciLi1 commented 2 months ago

It still reproes on VS Main\35222.175 + NuGet Client Dev\6.12.0.82.