Skip to content

[FEATURE]: Add "copy file path" action to diff review and file viewer #34823

Description

@agustinzamar

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

Add an action to copy the file name, path, or relative path directly from the git diff review and file viewer panels of the new UI.

Motivation

Right now, when reviewing a diff or browsing a file, there's no quick way to grab the file's path. Users have to manually locate the file in a file explorer or reconstruct the path by hand, which slows down workflows like:

  • Referencing a file in a commit message, PR description, or Slack/chat message.
  • Pasting a path into a terminal command (cat, code, git blame, etc.).
  • Sharing a file location with a teammate or an AI assistant.

Proposed behavior

Add a copy action in both:

  1. Diff review view: right-click context menu on the file name
  2. File viewer: right-click context menu on the file tab.

The action should offer at least one of the following formats:

  • File name only — e.g. Component.tsx
  • Relative path — e.g. src/components/Component.tsx
  • Full/absolute path — e.g. /home/user/project/src/components/Component.tsx

Nice to have

  • Keyboard shortcut to copy the relative path of the currently focused file.
  • Visual confirmation (toast/tooltip) when the path is copied, e.g. "Copied to clipboard".

Willingness to contribute

Happy to submit a PR for this if there's consensus on the approach / a maintainer gives the go-ahead on the general direction.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions