Skip to content

feat: sync request evidence refresh - #76

Merged
evenluo merged 1 commit into
mainfrom
agent/sync-request-evidence-refresh
Jul 14, 2026
Merged

feat: sync request evidence refresh#76
evenluo merged 1 commit into
mainfrom
agent/sync-request-evidence-refresh

Conversation

@evenluo

@evenluo evenluo commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • refresh Trend Workbench and Request Evidence from one shared 60-second dashboard cycle
  • replace the visible Latest request label with an accessible animated sync signal
  • preserve Request Evidence's fixed 24-hour scope and add component plus responsive coverage

Why

Trend Workbench and Request Evidence previously used separate query timers. They happened to share a 60-second interval, but there was no single refresh trigger or visible evidence refresh state.

Impact

Frontend-only and compatible. API contracts, backend behavior, navigation, and the Request Evidence 24-hour window are unchanged.

Verification

  • make lint-frontend test-frontend build-frontend
  • 61 Vitest tests passed
  • npm run test:e2e:mobile
  • 12 Playwright tests passed across mobile, tablet, and desktop
  • git diff --check

@evenluo
evenluo marked this pull request as ready for review July 14, 2026 13:45
@evenluo
evenluo merged commit 1d0b780 into main Jul 14, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e3b5dcdd3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

range={fixedWindow.requestEvidence.range}
data={requestEvidenceData}
isLoading={isRequestEvidenceLoading}
isRefreshing={isRequestEvidenceFetching && Boolean(requestEvidenceData)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep sync signal active until trend refresh settles

这里的同步状态只看 Request Evidence 查询。共享 interval 同时触发 refetchCoreAnalytics()refetchRequestEvidence(),但 React Query 会在每个请求各自完成时更新;当 /usage/events 先返回而 /analytics/core 仍在飞行时,卡片会立刻显示 “Synced with trend” 并可能展示新请求,而 Trend Workbench 仍是旧数据。请把 core analytics 的 fetching 状态也纳入,或等两者都 settle 后再标记为 synced。

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant