Skip to content

feat: add copy path button to diff headers#2403

Open
ipanasenko wants to merge 6 commits into
pingdotgg:mainfrom
ipanasenko:t3code/853b397b
Open

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

Conversation

@ipanasenko
Copy link
Copy Markdown
Contributor

@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 6c6e93f.


Note

Low Risk
Low risk UI change that adds a new copy-to-clipboard affordance and refactors toast helper code, with no auth or data-flow changes.

Overview
Adds a GitHub-style copy button to each diff file header so users can copy the resolved file path from the diff view.

Extracts anchored “copied/failed” toast logic into a shared ui/anchoredCopyToast helper and updates MessageCopyButton to use the new helpers for consistent copy feedback.

Reviewed by Cursor Bugbot for commit 6c6e93f. 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: 035046fc-ef7c-467d-91c6-e398cbefe985

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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