matcha
matcha copied to clipboard
BUG: formatRelativeDate "just now" vs "1 min ago" gap
Describe the bug
The formatRelativeDate function in tui/inbox.go has a logic gap between "just now" and "1 min ago".
If a message is exactly 1 minute old, it might show incorrectly or there might be a jitter in display.
To reproduce
- Receive an email.
- Watch the relative date as it transitions from "just now" to "1 min ago".
Expected behavior
Seamless transition between relative time units.
Additional context
case d < time.Minute:
return "just now"
case d < time.Hour:
mins := int(d.Minutes())
if mins == 1 {
return "1 min ago"
}
If d is exactly time.Minute, it falls into the second case, but int(d.Minutes()) might be 1. It works, but the thresholds could be more precise.
This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.
Closing due to inactivity. Reopen if still relevant.