nuclear icon indicating copy to clipboard operation
nuclear copied to clipboard

FEAT: Add "copy to clipboard" feature

Open shantanu-wdev opened this issue 2 years ago • 3 comments

In this pull request, users can now able to copy the song title to the clipboard by simply clicking on its name.

Fixes #1516

Demonstration Video https://github.com/nukeop/nuclear/assets/75296055/87a86b75-63bc-47b8-90b4-9343f09a010a

shantanu-wdev avatar Nov 01 '23 08:11 shantanu-wdev

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (e728fde) 71.42% compared to head (b9bfe14) 71.37%.

:exclamation: Current head b9bfe14 differs from pull request most recent head ba64070. Consider uploading reports for the commit ba64070 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1521      +/-   ##
==========================================
- Coverage   71.42%   71.37%   -0.05%     
==========================================
  Files         364      364              
  Lines        6708     6714       +6     
  Branches      474      474              
==========================================
+ Hits         4791     4792       +1     
- Misses       1527     1532       +5     
  Partials      390      390              
Files Coverage Δ
packages/ui/lib/components/TrackInfo/index.tsx 61.53% <16.66%> (-38.47%) :arrow_down:

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 01 '23 12:11 codecov[bot]

Hi, thanks for the pull request. Please check the contribution guidelines: https://nukeop.gitbook.io/nuclear/contributing/contribution-guidelines

There are a few things missing but I'm sure if we iterate on it we can get it into a good shape.

  • Please add a test for the feature. You can see examples in the app package. Let me know if you have trouble testing the clipboard contents.
  • Instead of changing the color to green with CSS, it should be possible to know what's going to happen if you click the title. So a good idea would be to add a tooltip that says something like "click to copy". You can search for the word "tooltip" to see examples.
  • The CSS on the title should also change the cursor to pointer when you hover over it, to let the user know this element is clickable. It might also be a good idea to add a button with an icon next to the title, so you can tell there's something interactive there at a glance.

nukeop avatar Nov 01 '23 19:11 nukeop

Logs:

  1. Green color removed.
  2. Add a pointer when hovering over the name.
  3. Add the "Click to copy" tooltip.
  4. Removed getElementById line.

https://github.com/nukeop/nuclear/assets/75296055/bed28318-36a3-41da-bf00-9b808166d806

It would be cool to add a notification toast.

shantanu-wdev avatar Nov 03 '23 06:11 shantanu-wdev