Skip to content

Distinguish and sort transitive packages in the Project View#1606

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-transitive-packages-visibility
Open

Distinguish and sort transitive packages in the Project View#1606
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-transitive-packages-visibility

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The Project View rendered direct and transitive packages identically, while the Environment View distinguishes them (icon, label, tooltip) and sorts direct-first. This made the two views inconsistent.

Changes

  • treeViewItems.ts (ProjectPackage) — mirror PackageTreeItem: list-tree icon for transitive (vs package), (transitive) description prefix, and the explanatory dependency tooltip. Package-provided iconPath still takes precedence.
  • projectView.ts — sort packages direct-first using the same comparator as the Environment View before mapping to tree items.
  • Robustness — fall back to '' when both version and description are absent, avoiding a stray undefined in the label; applied to both views.
  • Tests — add a ProjectPackage suite covering direct vs. transitive rendering, icon override, and the empty-description case.
// projectView.ts — direct packages first, then transitive
return packages
    .sort((a, b) => (a.isTransitive === b.isTransitive ? 0 : a.isTransitive ? 1 : -1))
    .map((p) => new ProjectPackage(environmentItem, p, pkgManager));

Note: the description/tooltip/icon logic is intentionally duplicated across ProjectPackage and PackageTreeItem to keep the two views in lockstep; a shared helper is a reasonable follow-up if further divergence is a concern.

Copilot AI changed the title [WIP] Fix transitive packages not showing under project view Show direct/transitive package distinction in Project View Jun 23, 2026
Copilot AI requested a review from edvilme June 23, 2026 23:29
@edvilme edvilme marked this pull request as ready for review June 23, 2026 23:33
Copilot AI changed the title Show direct/transitive package distinction in Project View Distinguish and sort transitive packages in the Project View Jun 23, 2026
@edvilme edvilme added the bug Issue identified by VS Code Team member as probable bug label Jun 23, 2026
@edvilme edvilme linked an issue Jun 23, 2026 that may be closed by this pull request
@edvilme edvilme enabled auto-merge (squash) June 23, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue identified by VS Code Team member as probable bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transitive Packages not showing under Project View

2 participants