Repository navigation
fix(web): cumulative calendar totals with unknown days read "At least" - #1060
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
formatProviderTokenCount(value, { roundDown: true })), so it never claims more than was countedWeekly 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-listtests, which pass when that file runs alone.