Details Pane in Solution PM UI Project list calculates negative column widths #13939
Labels
Functionality:VisualStudioUI
Package Manager UI et al
Priority:2
Issues for the current backlog.
Product:VS.Client
TechDebt
Technical debt
Type:Bug
The ListView for the projects table in Solution PMUI calculates column widths in order to make adjustments to each column. The ListView_SizeChanged performs several calculations, and this can result in a negative value.
Recently, a regression (#13928) was introduced in this area as Transitive Vulnerabilities were added as a column to this table. When the Details Pane is small, this logic would set a negative width on the column.
To mitigate this, a fix was made (in NuGet/NuGet.Client#6146) to check for and only set a positive value for width.
Example of a negative calculation from the debugger:

This logic seems overly complicated. Ideally:
ListView_SizeChanged
event to minimize the calculations it performs. Perhaps bailing out of the loop as soon as thewidth
variable turns negative would optimize it slightly.> 7
andheader.ActualWidth < 86
to ensure they're still correct and useful.The text was updated successfully, but these errors were encountered: