Skip to content

Add "Copy file path" to file viewer pane right-click menu#13145

Open
elviskahoro wants to merge 1 commit into
warpdotdev:masterfrom
elviskahoro:conductor/copy-file-path-context-menu
Open

Add "Copy file path" to file viewer pane right-click menu#13145
elviskahoro wants to merge 1 commit into
warpdotdev:masterfrom
elviskahoro:conductor/copy-file-path-context-menu

Conversation

@elviskahoro

@elviskahoro elviskahoro commented Jun 28, 2026

Copy link
Copy Markdown

Closes #8974

What

Right-clicking inside a file opened in Warp's rendered file viewer (FileNotebookView, e.g. a markdown file) previously only offered the four split-pane options. This PR adds a "Copy file path" entry to that right-click context menu — the right-click portion requested in #8974 (the overflow-menu "Copy file path" already exists).

  • Matches the wording already used in the pane's header overflow menu and copies the same display_path() string, so it works for both local and remote files.
  • Scoped to file-backed panes: FileNotebookView sets the current file's path when the menu opens; regular notebooks never set it, so the item stays hidden there.

How

  • app/src/notebooks/context_menu.rs — added copy_file_path state + setter to the shared ContextMenuState, the new menu item (inserted between the text-action and split-pane sections with correct separator handling), a ContextMenuAction::CopyFilePath variant, and a clipboard-write handler.
  • app/src/notebooks/file/mod.rs — sets the open file's display_path() on the menu when it's opened.
  • app/src/notebooks/context_menu_tests.rs — added test_copy_file_path_action covering: item present + separated when a text section exists, item leading the menu when the text section is empty, and item absent when no path is set.

Testing

  • cargo check -p warp --lib → passes, no errors.
  • cargo test -p warp --lib test_copy_file_path_action → passes.

Right-clicking inside a file opened in Warp's rendered file viewer
(FileNotebookView) previously only offered the split-pane options. This
adds a "Copy file path" entry there, matching the wording already used in
the pane's header overflow menu and copying the same display_path()
string (works for local and remote files).

The item is wired through the shared notebook ContextMenuState and is
scoped to file-backed panes: FileNotebookView sets the current file's
path when the menu opens, while regular notebooks never set it, so the
item stays hidden there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cla-bot

cla-bot Bot commented Jun 28, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @elviskahoro on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Jun 28, 2026
@oz-for-oss

oz-for-oss Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

@elviskahoro

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elviskahoro

Every PR must be linked to a same-repo issue before Oz can review it.

Next step: open or find a same-repo issue describing this change, then link it to this PR by adding Closes #123 to the PR description (or using the "Development" sidebar on GitHub). A maintainer will mark the issue ready-to-implement when it is ready. Once it is marked, comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@elviskahoro

Copy link
Copy Markdown
Author

@oz-agent This PR closes #8974

@elviskahoro

Copy link
Copy Markdown
Author

@bholmesdev I did the CLA check! lmk if this needs feature flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add "Copy file path" option to built-in file viewer

1 participant