Skip to content

feat: add Collapse Other Results context menu action in search view#304994

Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/collapse-other-search-results
Open

feat: add Collapse Other Results context menu action in search view#304994
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/collapse-other-search-results

Conversation

@yogeshwaran-c
Copy link

What kind of change does this PR introduce?

Feature

What is the current behavior?

In the search results view, users can collapse all results or expand recursively, but there is no way to collapse all results except the one they're focused on. Users who want to focus on a specific group of results have to manually collapse each other group.

Closes #163590

What is the new behavior?

Adds a "Collapse Other Results" context menu action that appears when right-clicking a file or folder match in the search results tree. Selecting it collapses all sibling results except the focused one, allowing users to quickly focus on a specific set of results.

Additional context

  • New command ID search.action.collapseOtherResults added to SearchCommandIds
  • Action registered with MenuId.SearchContext for folder and file focus contexts
  • Uses viewer.getNode() to get siblings and collapses all except the focused element

Adds a new context menu action in the search results view that collapses
all sibling results except the focused one. This allows users to focus
on a specific group of results without losing other results.

The action appears in the context menu when right-clicking a file or
folder match in the search results tree.

Closes microsoft#163590
@vs-code-engineering vs-code-engineering bot added this to the 1.114.0 milestone Mar 26, 2026
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.

"Collapse other results" button in search view context menu

2 participants