feat(usage-analytics): add profile hero with stats and token heat map#4009
Open
IamCoder18 wants to merge 1 commit into
Open
feat(usage-analytics): add profile hero with stats and token heat map#4009IamCoder18 wants to merge 1 commit into
IamCoder18 wants to merge 1 commit into
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryAll five previously reported issues are resolved in the latest commit: the Previously Reported Issues — All Resolved ✓
Files Reviewed (5 files)
Reviewed by claude-4.6-sonnet-20260217 · 721,665 tokens Review guidance: REVIEW.md from base branch |
3f1a578 to
aaf2b06
Compare
aaf2b06 to
7355f35
Compare
7355f35 to
15c7f25
Compare
Add UsageProfileHero component above existing Usage page contents for personal context only. Includes: - ProfileHeader: centered circular avatar with initials, display name, and "Personal usage" handle - UsageProfileStats: 4-KPI grid showing lifetime tokens, peak tokens, current streak, and longest streak - TokenActivityHeatmap: GitHub-style daily grid with 30d/90d/1y range toggle, intensity-based tile coloring, and tooltips on all days Adds getProfile tRPC procedure querying MICRODOLLAR_USAGE_DAILY for lifetime totals (SUM/MAX) and last 365 days of daily activity. Streaks are computed client-side from daily activity with GitHub-style semantics (current streak = consecutive active days ending today).
15c7f25 to
c429337
Compare
Contributor
Author
This is ready to review with "No Issues Found" by the review bot |
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.
Summary
This PR adds a visually polished, profile-led usage hero component at the top of the personal Usage analytics page to drive user shareability and marketing value. The existing detailed analytics dashboard remains unchanged below it.
Closes #4010
Frontend Additions:
"Personal usage"handle.tabular-nums.Architectural / Backend Changes:
usageAnalytics.getProfiletRPC procedure reading directly from the SnowflakeMICRODOLLAR_USAGE_DAILYtable.organization_id = '') to calculate lifetimeSUM(total_tokens)andMAX(total_tokens).Reference (from X)
Verification
Verified
/usageVisual Changes
Reviewer Notes
apps/web/DESIGN.md. Uses core semantic tokens (background,card,border,muted) and shadcn primitives (Card,Tooltip,Tabs). Yellow-green usage has been kept minimal and restricted to minor accents per design skill constraints.