-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat: adding copy button for code snippets #865
feat: adding copy button for code snippets #865
Conversation
nice! |
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.
LGTM
Really great UX improvement 👍
AFAIK it's planned for 1.1 so wondering why we're working on it ? |
I started the code before stevan moved it to 1.1 |
but we should not tackle enhancements as soon as they appear on the backlog, only after they have been reviewed/ordered |
.copyToClipboard(snippet) | ||
.then(() => { | ||
copied = true; | ||
studioClient.telemetryLogUsage('snippet.copy', { language: selectedLanguage, variant: selectedVariant }); |
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.
As there is an event listener on the copy event, I'm wondering if this would lead to a double report on telemetry ?
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.
I think it would better to keep only one indeed
The last commit removes the support of Ctrl+C |
I thought this is what you expected when you mention the duplicates telemetry events ? The last commit does not remove the support of CTRL+C, it removes the telemetry events triggered by this action. But we capture the one from the copy button |
Yes but the request was to capture when snipped was copied into clipboard whatever the original action was |
I can restore the telemetry on the manual ctrl+c if you want and add a differentiator, like 'cpyButton: boolean' |
Signed-off-by: axel7083 <[email protected]>
Signed-off-by: axel7083 <[email protected]>
16bdb0b
to
38f39cf
Compare
Signed-off-by: axel7083 <[email protected]>
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.
LGTM
What does this PR do?
Adding a copy button for the code snippet.
Screenshot / video of UI
copy_button.mp4
What issues does this PR fix or reference?
Fixes #859
How to test this PR?