Skip to content

feat: add copy path button to diff headers#2403

Open
ipanasenko wants to merge 3 commits intopingdotgg:mainfrom
ipanasenko:t3code/853b397b
Open

feat: add copy path button to diff headers#2403
ipanasenko wants to merge 3 commits intopingdotgg:mainfrom
ipanasenko:t3code/853b397b

Conversation

@ipanasenko
Copy link
Copy Markdown

@ipanasenko ipanasenko commented Apr 29, 2026

Hey guys!

I find myself in a need to copy a file path from diff view quite often. I use it to paste into the chat and ask questions about this specific file. I think it makes it much more obvious for model (and for me) what file we are talking about.

Currently the best workflow in T3 Code I found for copying file path is to manually select file path and do Cmd+C. I think this can be improved by adding a copy button, GitHub-style.

SCR-20260429-mizf-2 image

Summary

  • add a copy-path button to diff file headers using the Diffs renderHeaderMetadata slot

Note

Add copy path button to diff file headers

  • Adds a new DiffFilePathCopyButton component that copies a file path to the clipboard, with a toggling icon and tooltip indicating copy/copied state.
  • Integrates the button into DiffPanel via the renderHeaderMetadata prop on each file diff header.
  • Extracts shared anchored toast helpers (showAnchoredCopySuccessToast, showAnchoredCopyErrorToast) into a new anchoredCopyToast.ts module and updates MessageCopyButton to use them.

Macroscope summarized ff25a41.


Note

Low Risk
UI-only changes that reuse existing clipboard/toast infrastructure; risk is limited to minor regressions in copy/toast behavior and diff header interactions.

Overview
Adds a GitHub-style copy file path control to each diff file header via FileDiff’s renderHeaderMetadata, with tooltip/icon feedback and anchored success/error toasts.

Introduces a shared ui/anchoredCopyToast helper (timeout + success/error toast functions) and refactors MessageCopyButton to use it instead of duplicating toast wiring.

Reviewed by Cursor Bugbot for commit ff25a41. Bugbot is set up for automated code reviews on this repo. Configure here.

@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 Apr 29, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 625ec155-e68b-4147-a480-9c944f47b5ad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ipanasenko ipanasenko changed the title Add copy path button to diff headers feat: add copy path button to diff headers Apr 29, 2026
@ipanasenko ipanasenko marked this pull request as ready for review April 29, 2026 12:03
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 558bb17. Configure here.

Comment thread apps/web/src/components/DiffFilePathCopyButton.tsx Outdated
Comment thread apps/web/src/components/DiffFilePathCopyButton.tsx Outdated
Comment thread apps/web/src/components/DiffFilePathCopyButton.tsx Outdated
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 29, 2026

Approvability

Verdict: Needs human review

An unresolved review comment identifies a potential event propagation bug where clicking the copy button may also trigger the parent's file-open action. This interaction issue should be verified by a human reviewer.

You can customize Macroscope's approvability policy. Learn more.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 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.

1 participant