Skip to content

Add “Copy All Relative File Paths to Clipboard” to commit and file context menus#920

Open
TERAKITERAKICHI wants to merge 1 commit intomhutchie:developfrom
TERAKITERAKICHI:feature/copy-all-relative-file-paths
Open

Add “Copy All Relative File Paths to Clipboard” to commit and file context menus#920
TERAKITERAKICHI wants to merge 1 commit intomhutchie:developfrom
TERAKITERAKICHI:feature/copy-all-relative-file-paths

Conversation

@TERAKITERAKICHI
Copy link
Copy Markdown

Summary

This PR adds a new context menu action to copy all changed file paths (relative paths) in one step.

Added

  • Copy All Relative File Paths to Clipboard in the Commit Details file list context menu.
  • Copy All Relative File Paths to Clipboard in the commit row context menu.

Behavior

  • Collects all newFilePath values from the selected commit’s file changes.
  • Joins them with newline separators.
  • Uses the existing copyToClipboard message flow to write to clipboard.

Implementation Notes

  • Front-end only change in main.ts.
  • Reused existing clipboard command (copyToClipboard) and avoided backend changes.
  • Introduced shared helper methods for:
    • collecting/copying all relative paths
    • deciding menu visibility for commit-row context menu

Validation

  • Built successfully with:
    • npm run compile-web
  • Manually verified:
    • menu item appears in Commit Details file context menu
    • menu item appears in commit row context menu
    • clipboard contains newline-separated relative file paths as expected

Notes

  • The copied paths are relative paths (newFilePath), including renamed files as their new path.
  • Deleted files are included if present in the commit file changes.

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.

1 participant