Skip to content

feat(scm): 'Open File' in graph opens current file, add 'Open File at Commit'#307882

Open
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/scm-graph-open-current-file-250938
Open

feat(scm): 'Open File' in graph opens current file, add 'Open File at Commit'#307882
yogeshwaran-c wants to merge 1 commit intomicrosoft:mainfrom
yogeshwaran-c:feat/scm-graph-open-current-file-250938

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

@yogeshwaran-c yogeshwaran-c commented Apr 5, 2026

Summary

Fixes #250938.

Previously the Open File toolbar button in the SCM Graph history item change context opened the historical (read-only) version of the file at that commit. When a user wanted to edit or view the current working-tree version of that file, they had to use Go to File and type the file name manually — a slow, all-manual routine.

This PR:

  • Changes the existing Open File action to open the current (working tree) version of the file, matching what users expect from a button labeled "Open File"
  • Adds a new Open File at Commit action (context menu only) to retain access to the historical read-only snapshot view

The historical diff view for a file is still shown when the user clicks the row in the graph, so the two entry points remain:

  • Click row → read-only diff vs parent commit (existing behavior)
  • Open File toolbar button → current working-tree file (new behavior)
  • Open File at Commit context menu → historical snapshot (previous toolbar behavior)

Changes

  • src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.ts — updated the workbench.scm.action.graph.openFile action and added a new workbench.scm.action.graph.openFileAtCommit action

Test plan

  • Open SCM Graph view, select a commit
  • Click Open File toolbar button on a file — verify it opens the current working-tree version
  • Right-click the file → Open File at Commit — verify it opens the historical snapshot with (commit-id) label

@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering bot commented Apr 5, 2026

📬 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

Previously the "Open File" toolbar button in the SCM Graph history
item change context opened the historical (read-only) version of the
file at that commit. The user has no action to switch to the current
working tree version without manually finding the file.

This changes the "Open File" action to open the current (working tree)
version of the file, matching what users expect from a button labeled
"Open File". A new "Open File at Commit" action is added to the
context menu to retain access to the historical snapshot view.

Fixes microsoft#250938
@yogeshwaran-c yogeshwaran-c force-pushed the feat/scm-graph-open-current-file-250938 branch from 1c43c40 to 4275d36 Compare April 6, 2026 16:22
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 Open File action

2 participants