feat(web): copy the full path from changed-file and folder rows - #12942
itsjeremyjohnson wants to merge 1 commit into
Conversation
Right-clicking a file in the changed-files tree, diff panel, or file browser offered only open/reveal actions, and folder rows had no menu at all. Add a "Copy full path" item that copies the absolute path on the thread's host and works without any editor or reveal capability, and open the same menu on folder rows. The workspace-root folder of a repo-relative diff tree now resolves to the workspace root instead of resolving to nothing. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a new “Copy full path” interaction across shared production file menus and enables context menus for changed-folder rows. The implementation is contained and tested, but the new user-facing behavior and cross-surface runtime impact warrant human review. You can add or adjust custom eligibility rules. Learn more. |
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change adds directory context-menu support, defines workspace-root path resolution, and adds a full-path copy action with clipboard feedback. Tests cover nested workspace paths and menu combinations. ChangesContext menu path actions
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant ChangedFilesTree
participant fileContextMenu
participant writeTextToClipboard
participant Toast
ChangedFilesTree->>fileContextMenu: Pass directory path and event
fileContextMenu->>writeTextToClipboard: Copy resolved absolute path
writeTextToClipboard-->>fileContextMenu: Success or failure
fileContextMenu->>Toast: Show "Path copied" or "Failed to copy path"
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Note This comment is posted by Julius' dot Closing under prior approval: this adds full-path copying across menus and new folder-row actions without an approved scope. #3522 has no maintainer response; the feedback in #11859 concerns its existing Open menu. Obtain approval for these copy and folder actions in an Ideas discussion, link it here, and request reconsideration. |
What Changed
Right-clicking a file or folder in a turn's Changed files tree (and the diff panel and file browser, which share the menu) now offers Copy full path. It copies the absolute path on the thread's host machine, so it is the path you can paste into a terminal or another agent on that environment, including when the environment is remote.
resolveDiffPathForWorkspacereturns""for it, where it previously returnednull; the one other caller already treated both as "no file").Web and desktop are covered by the shared menu. Mobile's file-chip menu already has "Copy full path"; its changed-files rows are unchanged here.
Why
When reviewing what a turn touched I often want the exact path for a shell, a grep, or a follow-up prompt. The tree shows only the compacted name, and hovering does not give an absolute path. Adding it to the existing shared menu keeps one context menu for files across surfaces rather than a new one.
Related to #3522 (requested copy actions on changed files) and #11859 (touches the same menu for chat file chips; independent change).
UI Changes
Captured on this head with headless Chromium against the web dev server (
vp run dev), dark theme, 1280×800 @2x. Baseline captures were taken from the same server withmain's versions of the three changed source files checked out.main)src/)astro.config.mjs)After choosing Copy full path, the "Path copied" toast shows the absolute path that landed on the clipboard (verified via
navigator.clipboard.readText()in the same session):/home/zeus/Projects/website-build-juststoreit/src/home/zeus/Projects/website-build-juststoreit/astro.config.mjsVideo (22s, both flows end to end: right-click → Copy full path → toast): copy-full-path.mp4
Assets live on an orphan branch of my fork (
itsjeremyjohnson/t3code@pr-assets/copy-full-diff-path) so nothing lands in this repo.Checklist
Verification
vp test run --project unit src/fileContextMenu.test.ts src/diffFileActions.test.tsinapps/web: 20 passed. The three menu-item tests and the new workspace-root test fail at371b52d9and pass at this head.vp linton the four changed files: clean.tsc --noEmitforapps/webwith a fresh build-info file: clean.code-reviewskill (Owl/Hound/Proof/Standards/Pruner + bite test); the workspace-root fix, header comment, label casing, and test swap came out of that pass.🤖 Authored by Claude Fable 5.1 for Jeremy (T3 Code, Cursor harness)
Summary by CodeRabbit
New Features
Bug Fixes