Show relative time on repository recent-commit stamps #27

Open AtlantisPleb opened this 7h ago

Outcome

Commit timestamps on repository surfaces read like GitHub's: "5 minutes ago"-style relative time for recent commits, not a bare calendar date.

Evidence

On a repository's Code page, the latest-commit line renders 2026-08-22 for a commit pushed minutes ago (code_repo_live.ex, Calendar.strftime(..., \"%Y-%m-%d\")). Every other recency surface in the product — issue rows, the workspace feed — already uses the coarse relative helper IssuePresentation.relative/1 (minutes, then hours, then days), so the forge speaks two time dialects on two adjacent pages.

Work

  • Render recent-commit stamps with the shared relative helper instead of the fixed date: minutes and hours for fresh commits, days beyond that.
  • Keep the absolute date available: put it in the <time> element's datetime attribute (already present) and consider a title tooltip so the exact moment stays one hover away.
  • Apply the same treatment wherever a commit stamp renders as a bare date: the repository Code header, the commit history list, and any other call site found by audit.
  • Reuse or promote the existing relative helper rather than writing a second one; if it moves to a shared UI module, update the issue-row import accordingly.

Acceptance criteria

  • A commit pushed moments ago reads in minutes, not a calendar date.
  • Older commits degrade gracefully through hours to days.
  • The exact timestamp remains machine-readable on every stamp (datetime attribute).
  • One relative-time implementation serves all surfaces.

Verification

Component tests asserting the rendered text for stamps seconds, hours, and days old; an audit grep proving no commit surface still formats %Y-%m-%d for display; mix precommit.

  1. AtlantisPleb opened this issue 7h ago
Sign in with GitHub to comment on this issue.