fix(timeline): track fetch attempts and surface silent polling failures

User reported: spinner spinning + "更新于 X 秒前" continuously growing
without bound while parsing is in progress. The auto-poll loop IS
firing every 2s, but lastFetchedAt only updated on success — so when
the API returns success=false or errors, the caption silently aged
while the visible state suggested live polling.

- Move lastFetchedAt update into the finally block so it tracks
  attempts (success or failure). The caption now bounces back to
  "刚刚 / 1s 前 / 刚刚" every poll cycle, matching the spinner's
  visual cadence.
- Track failedAttempts and lastFetchOk: when the last attempt failed
  the timestamp shows in muted italic; when 2+ consecutive attempts
  fail a small "⚠ 刷新失败" pill appears next to it with a tooltip
  explaining the situation.
- New i18n keys fetchFailed / fetchFailedShort in zh-CN/en-US/ko-KR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
wizardchen
2026-05-27 23:03:59 +08:00
committed by lyingbug
parent c4fba77a96
commit 9333869439
4 changed files with 62 additions and 3 deletions
+2
View File
@@ -403,6 +403,8 @@ export default {
liveTooltip: 'Parsing in progress — auto-refreshes every 2s',
autoRefreshOn: 'Auto-refreshing',
autoRefreshOff: 'Auto-refresh stopped',
fetchFailed: 'Last {n} refreshes failed — data may be stale, click refresh to retry',
fetchFailedShort: 'fetch failed',
viewTrace: 'View trace',
justNow: 'just now',
secondsAgo: '{n}s ago',