rubygems.org icon indicating copy to clipboard operation
rubygems.org copied to clipboard

Providing users with a copy-to-clipboard feature for the checksum

Open robbyrussell opened this issue 1 year ago • 5 comments

When viewing an individual Rubygem version, let's make it simple for users to copy/paste the SHA 256 Checksum quickly. This change uses the existing copy/clipboard functionality.

Currently, it looks like this:

image

Proposed change:

image

2024011226

Thanks for your consideration!

robbyrussell avatar Jan 13 '24 01:01 robbyrussell

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (866208a) 96.98% compared to head (3e7bbef) 96.98%. Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4353   +/-   ##
=======================================
  Coverage   96.98%   96.98%           
=======================================
  Files         336      336           
  Lines        7487     7487           
=======================================
  Hits         7261     7261           
  Misses        226      226           

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

codecov[bot] avatar Jan 13 '24 02:01 codecov[bot]

Hello @robbyrussell, it seems those I18n keys are not present in the given scope. Instead of another copy, I did small refactoring at https://github.com/rubygems/rubygems.org/pull/4354 which makes them reusable. Once merged, you can change it to t("copied") or similar to fix failing tests in here.

simi avatar Jan 15 '24 02:01 simi

@robbyrussell https://github.com/rubygems/rubygems.org/pull/4354 got merged, can you update templates?

simi avatar Jan 15 '24 05:01 simi

@simi sure thing, done!

robbyrussell avatar Jan 19 '24 19:01 robbyrussell

@robbyrussell would you mind to fix the failing spec? https://github.com/rubygems/rubygems.org/blob/8c47cf5f7d29768d0da03210a0ed122e1e01ceab/test/functional/versions_controller_test.rb#L139 It expects sha to be printed in the page content, but since it is now part of input, it fails the test. Feel free to ping me if you need help, I can try to tackle this on my own.

simi avatar Jan 25 '24 06:01 simi

I have fixed the test, merging. Thanks for the contribution @robbyrussell.

simi avatar Jun 14 '24 00:06 simi