Skip to content

feat(web): copy the full path from changed-file and folder rows - #12942

Closed
itsjeremyjohnson wants to merge 1 commit into
pingdotgg:mainfrom
itsjeremyjohnson:feat/copy-full-diff-path
Closed

itsjeremyjohnson wants to merge 1 commit into
pingdotgg:mainfrom
itsjeremyjohnson:feat/copy-full-diff-path

Conversation

@itsjeremyjohnson

@itsjeremyjohnson itsjeremyjohnson commented Sep 21, 2026 •

Copy link
Copy Markdown

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.

  • The item appears last, after Open / Reveal / Open with, and is offered even when the environment reports no editors or reveal capability, since it needs nothing from the server.
  • Folder rows in the changed-files tree open the same menu; before, they had no right-click behavior.
  • In a non-worktree thread scoped to a repo subdirectory, the folder row for the workspace root itself now resolves to the workspace root instead of resolving to nothing (resolveDiffPathForWorkspace returns "" for it, where it previously returned null; the one other caller already treated both as "no file").
  • Success shows a "Path copied" toast, failure a "Failed to copy path" toast, matching the other menu-triggered copy actions.

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 with main's versions of the three changed source files checked out.

Before (main) After (this PR)
Folder row (src/) No right-click menu at all
before: folder row has no context menu
Menu opens with Copy full path
after: folder row context menu with Copy full path
File row (astro.config.mjs) Only Open with
before: file row context menu with only Open with
Open with + Copy full path
after: file row context menu with Copy full path

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):

Folder → /home/zeus/Projects/website-build-juststoreit/src File → /home/zeus/Projects/website-build-juststoreit/astro.config.mjs
after: Path copied toast for the src folder after: Path copied toast for astro.config.mjs

Video (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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Verification

  • vp test run --project unit src/fileContextMenu.test.ts src/diffFileActions.test.ts in apps/web: 20 passed. The three menu-item tests and the new workspace-root test fail at 371b52d9 and pass at this head.
  • vp lint on the four changed files: clean.
  • tsc --noEmit for apps/web with a fresh build-info file: clean.
  • Reviewed with the code-review skill (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

    • Added a “Copy full path” option to file and directory context menus when an absolute path is available.
    • Copying a path now provides success or error feedback.
    • Directory entries in the changed-files tree now support the context menu, including directory-specific paths.
  • Bug Fixes

    • Improved path handling for workspace roots and repositories nested within workspaces.

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>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 21, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 97ec3ade-ef34-4c1e-b8dc-7a77b42d3a7f

📥 Commits

Reviewing files that changed from the base of the PR and between 371b52d and c28806e.

📒 Files selected for processing (4)
  • apps/web/src/components/chat/ChangedFilesTree.tsx
  • apps/web/src/diffFileActions.ts
  • apps/web/src/fileContextMenu.test.ts
  • apps/web/src/fileContextMenu.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Context menu path actions

Layer / File(s) Summary
Directory context-menu wiring
apps/web/src/components/chat/ChangedFilesTree.tsx
Directory buttons now prevent the browser menu and pass the directory path and event to the optional context-menu handler.
Workspace path resolution
apps/web/src/diffFileActions.ts, apps/web/src/fileContextMenu.ts, apps/web/src/fileContextMenu.test.ts
Workspace-root resolution now returns an empty relative path. Directory paths resolve to absolute workspace paths. Tests cover nested workspace roots.
Full-path copy action
apps/web/src/fileContextMenu.ts, apps/web/src/fileContextMenu.test.ts
The menu adds copy-full-path when an absolute path exists. Activation copies the path and shows success or error toasts. Tests cover copy-only, reveal-only, and full-capability menus.

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"
Loading

Suggested reviewers: saphid

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding full-path copying for changed-file and folder rows.
Description check ✅ Passed The description is complete and focused. It explains what changed, why it changed, the UI impact, verification steps, screenshots, video, and checklist completion.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member

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.

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants