-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Feature Request
I’d like to propose adding a "Copy to Clipboard" button next to code blocks in the GitHub repository code viewer (e.g., when browsing source files). This would allow users to quickly copy the entire contents of a file or a selected code block with a single click, improving workflow efficiency.
Proposed Solution
Add a small "Copy" button (e.g., a clipboard icon) in the top-right corner of the code viewer UI, similar to how many documentation sites (e.g., Stack Overflow) or note-taking apps (e.g., TriliumNext) implement it.
When clicked, it copies the entire file’s contents to the clipboard.
Bonus: If a user has selected a portion of the code, clicking the button could copy only the selected text instead of the whole file (context-aware copying).
Benefits
Efficiency: Saves time for developers who frequently copy code snippets for testing, documentation, or sharing.
User Experience: Aligns GitHub with modern UX patterns seen in other coding tools.
Accessibility: Reduces reliance on keyboard shortcuts, benefiting users who prefer mouse-based workflows.