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

improve display of times/durations in copr web #3616

Open
juhp opened this issue Feb 3, 2025 · 2 comments
Open

improve display of times/durations in copr web #3616

juhp opened this issue Feb 3, 2025 · 2 comments
Labels

Comments

@juhp
Copy link

juhp commented Feb 3, 2025

It seems any duration >= 60min and <= 1h59m may be displayed as "an hour" in copr web UI.
Which can be quite misleading/confusing sometimes.

eg One of my builds just went from 50min to 90min, so copr now says it took "an hour".

Another example, a build started just over 2 hours ago was displayed as:

Submitted:
    2025-02-03 09:12 UTC (2 hours ago) 
Started:
    2025-02-03 09:13 UTC (an hour ago) 

which doesn't really make sense.

A simple suggestion would be at least show minutes up to 2 hours, though I would prefer always to see hours and minutes 2h 15m.
Failing that, at the very least there should be rounding to the nearest hour.

@nikromen
Copy link
Member

nikromen commented Feb 3, 2025

this is the intended behaviour of humanize.naturaldelta which we use to display the timestamp delta to users. I personally don't care that much about this one, but I'd like to avoid displaying seconds in the "human" format if delta > 60 so the time ago in the UI is not bloated

we can do something like this instead...

>>> humanize.precisedelta(5000, minimum_unit="minutes", format="%.0f")
'1 hour and 23 minutes'

@praiskup praiskup moved this from Needs triage to Someday in future in CPT Kanban Feb 5, 2025
@praiskup
Copy link
Member

praiskup commented Feb 5, 2025

As discussed on Matrix, PR are very welcome! Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Someday in future
Development

No branches or pull requests

3 participants