Add "Copy file path" to file viewer pane right-click menu#13145
Add "Copy file path" to file viewer pane right-click menu#13145elviskahoro wants to merge 1 commit into
Conversation
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>
|
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 |
|
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 See the contribution guidelines for the full readiness model. Powered by Oz |
There was a problem hiding this comment.
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
|
@bholmesdev I did the CLA check! lmk if this needs feature flag |
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).display_path()string, so it works for both local and remote files.FileNotebookViewsets 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— addedcopy_file_pathstate + setter to the sharedContextMenuState, the new menu item (inserted between the text-action and split-pane sections with correct separator handling), aContextMenuAction::CopyFilePathvariant, and a clipboard-write handler.app/src/notebooks/file/mod.rs— sets the open file'sdisplay_path()on the menu when it's opened.app/src/notebooks/context_menu_tests.rs— addedtest_copy_file_path_actioncovering: 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.