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
@@ -409,6 +409,8 @@ export default {
liveTooltip: "파싱 진행 중 — 2초마다 자동 새로고침",
autoRefreshOn: "자동 새로고침 중",
autoRefreshOff: "자동 새로고침 중지됨",
fetchFailed: "최근 {n}회 새로고침 실패 — 데이터가 오래되었을 수 있습니다, 새로고침 버튼을 눌러 재시도하세요",
fetchFailedShort: "새로고침 실패",
viewTrace: "Trace 보기",
justNow: "방금",
secondsAgo: "{n}초 전",