Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Branch folder nodes (e.g., copilot/, benibenj/) in the SCM Repositories View had no context menu, preventing bulk operations on branches sharing a prefix.

Changes

SCM Workbench (src/vs/workbench/contrib/scm/)

  • Extended onTreeContextMenu handler to support IResourceNode (folder nodes)
  • Added collectChildArtifacts() to recursively collect leaf branch artifacts (childrenCount === 0)
  • Added getArtifactFolderMenu() method to ISCMRepositoryMenus interface and implementation

Git Extension (extensions/git/)

  • Added git.repositories.deleteBranches command with type-guarded array validation
  • Sequential deletion with per-branch error logging
  • Menu contribution to scm/artifact/context when scmArtifactGroupId == branches

Example

Right-clicking the copilot folder node now shows:

├── Checkout
├── Merge
├── Rebase
├── Create from...
├── Delete           ← existing (single branch)
├── Delete Branches  ← new (all child branches)
└── Compare with...

Selecting "Delete Branches" prompts: "Delete 5 branches?" and removes all branches under copilot/ prefix.

Fixes #<issue_number>

Original prompt

This section details on the original issue you should resolve

<issue_title>SCM Repositories View: Support context menu actions on branch collections</issue_title>
<issue_description>I would like to be able to delete all branches with a specific prefix (for example copilot/) by using the context menu in the repositories view

Image</issue_description>

<agent_instructions>Add a context menu for branch nodes which have children. For example we render a node for benibenj when there is a branch called benibenj/testBranch. I want that benibenj node to have a context menu with the action delete. That action will delete all it's child branches. Related to the commandgit.repositories.deleteBranch which is handled in the artifactDeleteBranch method in extensions\git\src\commands.ts and is registered in the package.json of the git extension. Also related to onTreeContextMenu in src\vs\workbench\contrib\scm\browser\scmRepositoriesViewPane.ts</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add context menu actions for branch collections Add context menu support for branch collection nodes in SCM Repositories View Nov 6, 2025
Copilot AI requested a review from benibenj November 6, 2025 11:54
Copilot finished work on behalf of benibenj November 6, 2025 11:54
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.

SCM Repositories View: Support context menu actions on branch collections

2 participants