Skip to content

feat: display human-friendly timestamps in locks and jobs tables #5542

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

iehrenwald
Copy link

what

It is often times easier on the brain for human-facing parts of tooling to have relative timestamps such as "just now", or "4 days, 9 hours ago" rather than a YYYY-MM-DD HH:MM:SS timestamp. It allows for a more intuitive understanding of when something happened. This PR replaces 'Date/Time' columns in the Locks and Jobs tables with 'Lock Age' and 'Job Age' columns, which display relative times but still can show the precise timestamp in a tooltip when the mouse pointer is hovered.

why

I was tired of doing math to calculate how long a lock has been held in a workspace or project, or how long ago a certain action such as a plan or apply happened. Then factor local/UTC conversions into it, and I asked myself "why can't it tell me like a person would?".

tests

I added a fake value in JobIDInfo to account for JobAge, just following the pattern I see, but I'm open to suggestions. I'm not a software engineer and I don't pretend to be one. I just scratch itches.

references

None

Other

I'm not sure what the implications are when changing text like this. The first thing that comes to mind is that it would break someone's screen scraping or automated parsing? Would this pass a sniff test if it was enabled/disabled via server-side config?

iehrenwa added 4 commits April 16, 2025 23:24
Signed-off-by: Ian Ehrenwald <[email protected]>
Signed-off-by: Ian Ehrenwald <[email protected]>
Signed-off-by: Ian Ehrenwald <[email protected]>
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.

1 participant