Skip to content

fix(web): cumulative calendar totals with unknown days read "At least" - #1060

Merged
badcuban merged 1 commit into
mainfrom
fix/calendar-cumulative-tooltips
Nov 23, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/calendar-cumulative-tooltips

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

In the "Local token activity" calendar's Cumulative mode, a running total read as exact even when days before it are unknown (outside the known range, their files possibly deleted). Weeks after real usage also showed "unavailable" instead of the total so far.

Each day now records whether an unknown day comes at or before it, including usage carried in from before the grid. Such a total shows as a floor:

  • the week tooltip says "At least X tokens through week of …"
  • the number rounds down (formatProviderTokenCount(value, { roundDown: true })), so it never claims more than was counted
  • it keeps showing in every week after the first known usage, and shows as unavailable only while it is still zero

Weekly mode: a week with usage and an unknown day also reads "At least", and a known quiet day in such a week keeps its zero color (#1058 had made it look unknown). Daily mode is unchanged.

Tested with a browser test on a week before the known range but after the first usage ("At least 4k tokens through week of …"), which also checks that no cumulative total reads as exact. It fails on the old code. A unit test covers the round-down. Typecheck, lint and the web unit suite pass. The browser suite passed apart from three timing-sensitive MessagesTimeline.real-list tests, which pass when that file runs alone.

In Cumulative mode a running total read as exact even when days before
it are unknown (outside the known range, their files possibly deleted),
and weeks after real usage showed "unavailable" instead of the total so
far.

Each day now records whether an unknown day comes at or before it,
including usage carried in from before the grid. Such a total shows as a
floor: the tooltip says "At least" and the number rounds down, so it
never claims more than was counted. It keeps showing in every week after
the first known usage, and shows as unavailable only when it is still
zero. A weekly total with an unknown day also reads "At least", and a
known quiet day in such a week keeps its zero color.
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 23, 2026 5:51pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit f18f881 Nov 23, 2026
23 checks passed
@badcuban
badcuban deleted the fix/calendar-cumulative-tooltips branch November 23, 2026 18:04

This branch was previously deployed

1 inactive deployment
Preview — 55df2e79 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant