refactor(desktop): use formatCompactRelativeTime in PR comment threads
What & why
PullRequestCommentThread.tsx (PR page) and the diff-pane CommentThread.tsx each had their own copy of the same formatRelative() helper ("5m ago", "3d ago", "2mo ago"):
- The PR-page copy was hardcoded English. It showed "5m ago" in every locale.
- The diff-pane copy was translated by hand, which took 6 catalog entries × 16 locales (306
.polines).
AGENTS.md says relative times use formatRelativeTime/formatCompactRelativeTime and not hand-rolled "3d ago" helpers, because Intl already knows each locale's wording. Both components now call formatCompactRelativeTime through useFormat(), as CloudWorkspacePageCard and AutomationRow already do. The output stays the same compact form ("now", "5m ago", "3d ago").
Net: −375 lines, and the PR page is now localized.
One small behaviour difference: the old helper used floor and the shared one uses round, so a 90-minute-old comment now reads "2h ago" where it read "1h ago". This matches every other relative time in the app.
How I tested it
apps/desktoptypecheck passesbun run check:i18n: the catalogs regenerated (only the 6 removed ids drop out), and every locale shows 0 missingbiome checkis clean on both files
Opened by the daily cleanup automation.
Summary by cubic
Replaces the hand-rolled relative time formatting in PR comment threads with the shared formatCompactRelativeTime helper, removing ~379 lines of duplicated formatting and 6 catalog entries across 16 locales.
- PR page comment timestamps are no longer hardcoded English; both comment threads now localize via
Intl. - Timestamps now round instead of floor, so a 90-minute-old comment reads "2h ago" instead of "1h ago", matching the rest of the app.
Summary by CodeRabbit
- Bug Fixes
- Comment timestamps in pull request and diff threads now use the app’s standard compact relative-time format, making their display consistent across both areas.
- Timestamp formatting is now handled consistently rather than using separate formatting rules in each thread.