Skip to content

fix(tps-chart): show x-axis time as negative offset from now - #117

Merged
iamvukasin merged 1 commit into
mainfrom
fix/tps-chart-negative-time
Aug 20, 2026
Merged

fix(tps-chart): show x-axis time as negative offset from now#117
iamvukasin merged 1 commit into
mainfrom
fix/tps-chart-negative-time

Conversation

@dak-agent

@dak-agent dak-agent Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Motivation

The Transaction volume (TPS) chart's x-axis labels the last 5 minutes as 2:00 · 1:30 · 1:00 · 0:30 · now. The values are elapsed time before now, but they're rendered as unsigned durations, so a reader has to infer the direction. Signing them makes the axis unambiguous: each tick reads as an offset from now (now − X).

Change

In frontend/lib/timestamp.ts, formatRelativeTime now prefixes past-time ticks with a minus sign:

  • 2:00-2:00
  • 1:30-1:30
  • now is unchanged (still pinned at the right edge)

formatRelativeTime is used only by the TPS chart x-axis (components/network-activity-tracker/tps-chart.tsx), so nothing else is affected. The tooltip still shows absolute wall-clock time via formatTimeHMS.

Result

X-axis reads -2:00 · -1:30 · -1:00 · -0:30 · now, so each tick is clearly time-ago from the live edge.

Notes

Used an ASCII hyphen-minus (-) to stay consistent with the rest of the codebase. Happy to switch to a typographic minus (, U+2212) if preferred for the axis.

Greptile Summary

This PR makes the TPS chart’s past x-axis ticks explicit negative offsets while preserving now at the live edge.

  • Prefixes elapsed minutes:seconds labels with an ASCII minus sign.
  • Leaves current and future timestamps formatted as now.
  • Does not affect the chart’s absolute wall-clock tooltip formatting.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The formatter’s only production caller is the TPS chart axis, where the new negative prefix matches the intended offset semantics, while now and absolute tooltip formatting remain unaffected.

Important Files Changed

Filename Overview
frontend/lib/timestamp.ts Updates the TPS chart’s relative-time formatter to render past timestamps as negative offsets; its only caller uses the result directly as an axis label.

Reviews (1): Last reviewed commit: "fix(tps-chart): show x-axis time as nega..." | Re-trigger Greptile

Co-authored-by: Vukašin Manojlović <8989109+iamvukasin@users.noreply.github.com>
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
monode Ready Ready Preview Aug 20, 2026 10:22am

Request Review

@iamvukasin
iamvukasin merged commit 97d3f57 into main Aug 20, 2026
12 checks passed
@iamvukasin
iamvukasin deleted the fix/tps-chart-negative-time branch August 20, 2026 11:34
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.

2 participants