Skip to content

Conversation

charliepark
Copy link
Contributor

Fixes #641

This PR pulls the formatted "X {seconds|minutes|hours|days|etc.} ago" relative time into a new component that also wraps it in a tooltip that renders the absolute value of that timestamp.

For example:
Screenshot 2024-01-11 at 12 05 57 PM

The description is optional; a relative time without that label still renders the absolute time appropriately:
Screenshot 2024-01-11 at 12 06 44 PM

Copy link

vercel bot commented Jan 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Jan 11, 2024 11:07pm

@david-crespo
Copy link
Collaborator

david-crespo commented Jan 11, 2024

"Run state updated" is a helpful label for the timestamp, and matches what it's called in the API. It makes me wonder if there's a way we could be clearer about it in the table. You can reasonably guess that the time given is the amount of time the thing has been in the current state, but it's not ideal to have to hover over it to be sure.

image

What if we add "for" before the time ago, so it's like RUNNING for 8d? @benjaminleonard?

image

Out of scope for this PR: this also makes me wonder if we should change Status as the column header. I assume we went with that because Run State is kind of a weird name.

Another thing I noticed is that the tooltip appears to be centered over the div rather than the text itself:

image image

@david-crespo
Copy link
Collaborator

If FAILED for 8d sounds silly, you could imagine something like FAILED since 8d ago. But I think FAILED for 8d is tolerable.

@charliepark
Copy link
Contributor Author

Fixed the tooltip centering issue:
Screenshot 2024-01-11 at 3 02 57 PM

[failed] for 8d sounds okay to me, and will hopefully not be a common state for people. [starting] for 2s sounds a bit weird to me, but I don't have strong feelings on it. Happy to handle any updates in this PR once Ben shares his thoughts.

@benjaminleonard
Copy link
Contributor

The [State] for 9s feels uncomfortable to me in a different way. Perhaps because it places extra emphasis on the duration of the state when really the user is most interested in the state itself, or that it's written as a sentence in a way that the other columns are not.

I'd like to investigate some other options, and look into how this is handled on other platforms. But this doesn't need to be a blocker on this PR.

Copy link
Collaborator

@david-crespo david-crespo left a comment

Choose a reason for hiding this comment

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

love it

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.

Human-formatted "ago" dates should have full timestamp in tooltip
3 participants