feat(profile): contributor stats dashboard (#836)#1234
Open
aunysillyme wants to merge 1 commit into
Open
Conversation
Builds the contributor profile stats dashboard requested in SolFoundry#836: - GitHub activity heatmap (last 90 days) sourced from the public GitHub events API, plus a per-type breakdown (commits, PRs, issues, reviews). - Earnings history chart with stacked USDC + FNDRY payouts and a 6mo / 12mo range toggle. - Key stats row: total earned (USDC + FNDRY), bounties completed, current/longest contribution streak, and rolling event count. - New /api/users/me/submissions client with a graceful 404 fallback so the panel renders sensibly until the backend ships that endpoint. Also restores the frontend `lib/utils` + `lib/animations` modules that were referenced across the codebase but never committed (the repo-wide `lib/` ignore was catching `frontend/src/lib`); the ignore is now narrowed to Python venv paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
/claim #836
Summary
Builds the Contributor Profile Stats Dashboard described in #836. The profile page now leads with a stats dashboard — visible before the existing tabbed area — that pulls together GitHub activity, FNDRY/USDC earnings history, and headline contributor metrics.
What landed
GitHubActivityGraph) — last 90 days of public events fromapi.github.com/users/{username}/events/public, rendered as a GitHub-style daily heatmap (SVG, no extra deps) with a per-event-type breakdown (commits, PRs, issues, reviews).EarningsHistoryChart) — stacked monthly bar chart of USDC + FNDRY payouts (recharts), with a 6mo / 12mo range toggle, built from the contributor's approved submissions joined against their bounty rewards.StatsRow) — total earned (USDC + FNDRY), bounties completed, current / longest contribution streak (derived from the GitHub event stream), and rolling event count./api/users/me/submissionsclient +useMySubmissionshook — graceful 404/501 fallback so the panel renders an empty-but-useful state until the backend ships that endpoint.Drive-by fix
The repo-wide
.gitignorehad alib/rule (intended for Python venvs) that was silently catchingfrontend/src/lib/. Thelib/utilsandlib/animationsmodules were referenced across ~20 frontend files but had never been committed —tscandvite buildboth failed onmainbefore this PR. The ignore is narrowed to venv paths and the two missing modules are now tracked.Files
frontend/src/api/github.ts+hooks/useGitHubActivity.ts— GitHub events fetcher with weight-by-commit-count and streak mathfrontend/src/components/profile/{ContributorStatsPanel,GitHubActivityGraph,EarningsHistoryChart,StatsRow}.tsxfrontend/src/api/bounties.ts+hooks/useBounties.ts— newlistMySubmissions/useMySubmissionswith 404 fallbackfrontend/src/components/profile/ProfileDashboard.tsx— wires the new panel into the existing dashboardfrontend/src/lib/{utils,animations}.ts— restored shared helpers (formatCurrency / timeAgo / animation variants)frontend/src/__tests__/{github-activity,utils}.test.ts— 12 new passing unit tests covering event aggregation, streak computation, and number/date formatting.gitignore— narrow the Pythonlib/ignore so it doesn't swallow the frontend lib folderTest plan
npx tsc --noEmit— cleannpx vite build— succeeds (previously failed onmainbecause of the missinglib/modules)npx vitest run src/__tests__/github-activity.test.ts src/__tests__/utils.test.ts— 12/12 passnpx vite) boots and serves the profile page without runtime errorsAcceptance criteria mapping
GitHubActivityGraph+api/github.tsEarningsHistoryChart(stacked USDC + FNDRY)StatsRowNotes for reviewers
/api/users/me/submissionsreturning approved submissions. The frontend handles a missing endpoint gracefully (empty state); the panel will light up automatically once the backend exposes it.🤖 Generated with Claude Code