Repository navigation
fix(web): the token calendar never colors or counts a day after today - #1062
Merged
Merged
Conversation
Usage dated after today (from a paired computer whose clock runs ahead) was colored in Daily mode and counted in weekly totals and the color scale. The calendar also fixed its "today" when the page opened, so a page left open overnight could miss the new day. Today is now the later of the browser's UTC day and the day the data was checked, at most a day past the browser's, and it moves on at UTC midnight (useUtcDayStartMs, sharing the timer the sidebar's local-day hook uses). Days after it are blank in every mode and left out of week totals, running totals and the color scale.
|
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.
Usage dated after today (from a paired computer whose clock runs ahead) was colored in the token calendar's Daily mode and counted in weekly totals and the color scale. The calendar also fixed its "today" when the page opened, so a page left open overnight could miss the new day.
tokenUsage.checkedAt), at most a day past the browser's.useUtcDayStartMs, which shares the timer, focus and visibility handling of the sidebar'suseLocalDayStartMs.Tested with a browser test pinned to a Monday. It checks that usage two days ahead isn't shown or counted, and that a page left open until Sunday shows Sunday's usage once new data arrives. It fails on the old code. Typecheck, lint, the web unit suite and the full browser suite pass.