fix(tps-chart): show x-axis time as negative offset from now - #117
Merged
Conversation
Co-authored-by: Vukašin Manojlović <8989109+iamvukasin@users.noreply.github.com>
dak-agent
Bot
requested review from
Camillebzd,
Im-Madhur-Gupta,
iamvukasin,
marcuspang and
mijovic
as code owners
August 20, 2026 10:22
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
marcuspang
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,formatRelativeTimenow prefixes past-time ticks with a minus sign:2:00→-2:001:30→-1:30nowis unchanged (still pinned at the right edge)formatRelativeTimeis 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 viaformatTimeHMS.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
nowat the live edge.minutes:secondslabels with an ASCII minus sign.now.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
nowand absolute tooltip formatting remain unaffected.Important Files Changed
Reviews (1): Last reviewed commit: "fix(tps-chart): show x-axis time as nega..." | Re-trigger Greptile