-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Add copy button to highlighted code lines #12983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 6.25kB (0.03%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
Files in
view changes for bundle: sentry-docs-server-cjsAssets Changed:
Files in
App Routes Affected:
|
a2feb68
to
6be34f4
Compare
651b843
to
f61a772
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah so, this was somewhat on purpose but I forgot to mention it: I added a bit of vertical padding because single-line highlights seemed too narrow, especially with the new button. If you're fine with it, I'll keep the padding but ensure that the red marker scales to the entire highlight block. Once that's done, I'll merge it but we can revisit the styling in a new PR. I got some feedback that we should change the color of the red marker anyway, so we could then tackle it in the same PR :) |
7ae03b3
to
ce4afb4
Compare
This PR adds a copy to clipboard button for highlighted line groups within a code block.
Why? In larger code examples, I find the main copy to clipboard button impractical because it copies a lot of code that's already there. So most of the time, it's unusable for me, making me have to highlight and select the appropriate code parts anyway. Since we can highlight the important code parts, this has already gotten much easier. But I think we can go a step further and offer the same, nice copy UX, just on a finer granularity.
Anyone have ideas how to test this best? Happy to learn!
Demo:
Screen.Recording.2025-03-12.at.15.43.44.mov
Update: new copy feedback:
Screen.Recording.2025-03-28.at.12.14.43.mov