fix(desktop): refresh TimeAgo label periodically #1296
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 219 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.323
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1296"
general
weight: 0.35
nicotsx
Fixes #1289
Problem
The desktop tray shows
Last: 5 seconds agolong after the backup finished. In the report, an hourly 15:00 run still showed that text at 15:33.TimeAgouseduseTimeFormat().formatTimeAgo, and that function depends oncurrentNow.currentNowchanges only when the root loader'snowchanges, which happens on navigation or revalidation. The tray stays mounted and never navigates. Once the last schedule refetch has rendered, nothing renders the label again, so the relative time stays frozen.Fix
TimeAgonow keeps its own clock. It starts from the loader'snow, so hydration still matches. After mount it switches toDate.now()and refreshes every 30 seconds withsetInterval, which is cleared on unmount. It then rendersrawFormatters.formatTimeAgo(date, now). This also fixes the otherTimeAgousers (schedule summary, backup card).useTimeFormatand the shared formatter are unchanged.Test
Adds
app/client/components/__test__/time-ago.test.tsx. It rendersTimeAgounder fake timers for a date 5s in the past and expectsjust now. Then it advances the timers by 30 minutes and expects30 minutes ago. The test fails onmainand passes with this change. The existing datetime tests still pass.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Relative-time labels now update automatically every 30 seconds while displayed, keeping elapsed-time descriptions current.
* Time-ago formatting uses a consistent reference time, including during initial page rendering, helping avoid inconsistent labels.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->