Skip to content
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

Providing some context to how long ago a version was released #4352

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

robbyrussell
Copy link
Contributor

Proposal: When you're looking at a particular Rubygem (version), it would be nice if we could convey the age of a particular gem version.

Example:

2024011222

2024011219

This change uses time_ago_in_words, and we pass in the authored_at timestamp.

Considerations:

I'm not 100% confident in all the translations. I used Google Translate; it might help to have additional people review it.

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1589cb7) 98.73% compared to head (30c984d) 98.73%.
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4352   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files         336      336           
  Lines        7431     7431           
=======================================
  Hits         7337     7337           
  Misses         94       94           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -15,6 +15,15 @@
<span class="gem__downloads"><%= number_with_delimiter(@latest_version.downloads_count) %></span>
</h2>
</div>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✂️

<h2 class="gem__ruby-version__heading t-list__heading">
<%= t('.gem_version_age') %>:
<span class="gem__rubygem-version-age">
<p><%= time_ago_in_words(@latest_version.authored_at) %> ago</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@segiddins if I understand it well, this is going to break caching, since the page content will change in time even with no resource update. Would it be better to use JS solution like https://momentjs.com/docs/#/displaying/fromnow/?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robbyrussell would you mind to try to use local_time gem? Feel free to ping me if you need help.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry for not considering the caching aspect that is in production.

The install instructions for the current releases of local_time assume you might have importmaps and/or webpacker in place. Are there plans for this project to use either approach going forward? (and past versions on NPM)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robbyrussell there is PR introducing importmaps at #4392. Maybe it is worth to wait for that one to land before tackling this.

@simi
Copy link
Member

simi commented Feb 22, 2024

@robbyrussell import maps has landed already. Are you still interested in finishing this?

@martinemde martinemde self-assigned this May 5, 2024
@martinemde
Copy link
Member

Assigning so I can try to get this into the design refresh that is coming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants