Skip to content

scm: add Collapse All action to the Source Control Graph view#309188

Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/scm-graph-collapse-all
Open

scm: add Collapse All action to the Source Control Graph view#309188
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/scm-graph-collapse-all

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

Users working with repositories that have many expanded commits had no toolbar button to collapse them all. The only known workaround was the undiscoverable Ctrl+Left keyboard shortcut.

Change

Adds a Collapse All action to the SCMHistoryTitle overflow menu (the 9_viewmode group alongside View as List / View as Tree).

  • Uses the standard collapseAll codicon.
  • The action is disabled (precondition) when the history list is empty — consistent with the Go to Current History Item action.
  • Delegates to the tree's built-in collapseAll() method, which recursively collapses all expanded nodes.
  • Users can move the item to the main toolbar via Customize Layout → Source Control Graph if they prefer a dedicated button.

Files changed

File Change
src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.ts Register workbench.scm.action.graph.collapseAll action; add collapseAll() method to SCMHistoryViewPane

Fixes #275608

Users working with repositories that have many expanded commits (e.g.
because workbench.tree.expandMode is singleClick) had no toolbar button
to collapse them all. The only way was the undiscoverable Ctrl+Left
keyboard shortcut.

Add a 'Collapse All' action (using the collapseAll codicon) to the
SCMHistoryTitle menu in the '9_viewmode' group. The action is disabled
when the history list is empty and delegates to the tree's existing
collapseAll() method.

Fixes microsoft#275608
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.ts

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 Graph - Add a Collapse All action

2 participants