feat(dashboard): make the Token activity views selectable - #11
Merged
Conversation
Daily, Weekly and Cumulative were three inert spans marked "Prototype — daily view only". They are now real toggle buttons, and each view is drawn with the encoding that suits its question: - Daily keeps the day heatmap, quartile-shaded. - Weekly is one bar per calendar week. The previous grid could only have shaded seven identical squares per week, which both implies a day-of-week axis that no longer applies and crushes 53 magnitudes into 4 bins. - Cumulative is a running-total area chart with a hover guide. On a heatmap a monotonic series always ends dark, so the slope — the only thing a cumulative view is read for — was invisible. All three are laid out on the same 14px-per-week pitch, so the month row underneath labels every view; the legend, caption and tooltips follow the selection, and the choice persists in localStorage. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
SergioChan
approved these changes
Aug 28, 2026
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.
What
On the personal dashboard, Daily / Weekly / Cumulative above the Token activity graph were three inert
<span>s carryingtitle="Prototype — daily view only". Clicking them did nothing. They are now real toggle buttons, and each view is drawn with the encoding that fits the question it answers.Less ▪▪▪▪▪ MorePeak week 56.8M · 13.5M weekly average728.5M total over the last 371 daysWhy not shade the existing grid for all three
That was the first attempt, and it was wrong twice over:
Details
weeks × 14 − 3px wide, so the existing month row underneath labels every view. Verified: hovering the cumulative curve at Mar 07 puts the guide line directly over theMarlabel.91,422,319 tokens by Sat Mar 07 · 13% of the window · +11.6M that week.role="group"witharia-pressed, keyboard-operable, with a focus ring. The selection persists inlocalStorage(wrapped in try/catch for private mode).[hidden]rules are restored by hand for the new chart hosts, following the existing comment at the top of the stylesheet.No new dependencies; everything is vanilla JS and inline SVG, consistent with the rest of the page.
Testing
npm run checkclean,npm test193/193 passing.🤖 Generated with Claude Code