Skip to content

Refresh daily usage charts and keep unpriced token days visible - #1062

Merged
Finesssee merged 1 commit into
mainfrom
reauthor/1039-daily-chart-refresh
Nov 2, 2026
Merged

Finesssee merged 1 commit into
mainfrom
reauthor/1039-daily-chart-refresh

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

Re-authored from #1039 by @ZGHJP (credited with Co-authored-by). Supersedes #1039.

Summary

  • The provider card re-reads its daily chart data when the published usage values change or the local day rolls over.
  • The refresh key is a usage revision (used percent of the primary, secondary and tertiary windows plus cost.used) instead of updatedAt. A refresh that only moves updatedAt no longer starts another transcript scan. This addresses the CodeRabbit finding on Keep daily usage charts current and retain unpriced token days #1039.
  • Days with tokens but no known price draw a dashed bar labelled Unpriced instead of an empty bar.
  • Fixes a type error in the new test fixture (estimateNote: "" instead of null).

Commands run (Windows host, apps/desktop-tauri)

  • pnpm exec vitest run --maxWorkers=4 src/components/MenuCard.chartRefresh.test.tsx src/components/card/InlineDashboard.test.tsx src/lib: passed
  • pnpm exec tsc --noEmit -p .: passed
  • oxlint: 0 errors

Not run locally: the full Vitest suite; CircleCI runs it. CUA proof not captured for the dashed Unpriced bar.

Re-authored from #1039. The card re-reads chart data when the published usage values change or the local day rolls over. A refresh that only moves updatedAt no longer starts another transcript scan. Days with tokens but no known price draw a dashed bar labelled Unpriced instead of an empty one.

Co-authored-by: ZGHJP <43691496+ZGHJP@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 1d3c130 and a06873d.

Files selected for processing: 5
  • apps/desktop-tauri/src/components/MenuCard.chartRefresh.test.tsx
  • apps/desktop-tauri/src/components/MenuCard.tsx
  • apps/desktop-tauri/src/components/card/InlineDashboard.test.tsx
  • apps/desktop-tauri/src/components/card/InlineDashboard.tsx
  • apps/desktop-tauri/src/lib/inlineDashboard.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Local CI for head a06873d794e0d565840623b89b2275b2af6e035c: scripts/local-check.ps1 -Slice ci passed on Windows (exit 0, 9 min). The hosted pr-check failure stopped partway through, as on several other PRs in this batch that change unrelated files. Some of those passed on CircleCI, so the failure looks like a flaky runner, not this change.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Self-review for head a06873d79, because CodeRabbit was rate-limited. The diff is #1039's change applied to current main, plus the fix for CodeRabbit's finding on #1039: the chart refresh is keyed on a usage revision (primary, secondary and tertiary used percent plus cost.used) instead of updatedAt, so an updatedAt-only refresh no longer rescans transcripts. It also fixes the type error in the new test fixture. I read the full diff and found no other issues. Local CI passed on this head (see above).

@Finesssee
Finesssee merged commit 6facf19 into main Nov 2, 2026
2 of 4 checks passed
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