Premium Profile Dashboard and Polished Stats.#16
Merged
Conversation
- Implemented the Mastercard as a "Premium Full-Width Dashboard" (820px). - Dashboard features: Hero stats (Commits, Stars, Contributions, PRs, Issues), Performance metrics, Languages grid, Activity list, and Full-width Heatmap. - Fixed text overlap in PR cards with dynamic truncation. - Standardized Issues and PR Summary cards as "Lite Small" (380x120px). - Robust data fetching with `safeFetch` and timeouts to prevent crashes. - Updated documentation and landing page with new dashboard examples. Co-authored-by: Chintanpatel24 <216989679+Chintanpatel24@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the “Master” profile dashboard card to a new full-width (820px) layout, reorganizing the displayed stats/sections and adjusting the backing API to fetch a few metrics more efficiently.
Changes:
- Refreshed the master dashboard SVG layout (header, hero metrics, languages, performance, repo activity/status, heatmap).
- Updated
/api/masterdata aggregation (new cache key version, open PR count via dedicated search call, reduced PRs used for “lines changed”). - Tweaked streak calculation and repo activity derivation for the master dashboard.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/svg-master.js |
Reworked the master dashboard SVG structure, labels, spacing, and which metrics are displayed. |
api/master.js |
Adjusted dashboard data fetching/caching and the computed metrics used by the SVG. |
Comments suppressed due to low confidence (1)
api/master.js:94
repoListis now built from only the first 50 PRs. Given GitHub search results aren’t explicitly sorted by recency, this can make the “Projects Activity” section unstable/inaccurate. If you’re limiting for performance, consider sorting PRs byupdated_at/created_atfirst and then taking the most recent 50, or derive this from aggregated counts (e.g. via the existinggroupPRsByRepo).
const repoMap = {};
(prs || []).slice(0, 50).forEach(pr => {
if (pr.repository_url) {
const name = pr.repository_url.split("/repos/")[1];
repoMap[name] = (repoMap[name] || 0) + 1;
}
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| fetchUserTotalStars, | ||
| fetchRecentPRLinesChanged | ||
| fetchRecentPRLinesChanged, | ||
| fetchOpenPullRequests // Added this |
| for (let i = sortedDays.length - 1; i >= 0; i--) { | ||
| if (sortedDays[i].count > 0) currentStreak++; | ||
| else break; | ||
| else if (i < sortedDays.length - 1) break; |
Comment on lines
99
to
104
| data = { | ||
| username: profile?.login || username, | ||
| totalPRs: prs?.length || 0, | ||
| openPRs: (prs || []).filter(pr => pr.state === "open").length, | ||
| openPRs: openPRCount || 0, | ||
| mergedPRs: mergedPRCount || 0, | ||
| repoCount: profile?.public_repos || 0, |
Comment on lines
+71
to
72
| const linesChanged = await fetchRecentPRLinesChanged(prs, 5); | ||
|
|
Comment on lines
+17
to
+20
| username, totalPRs = 0, openPRs = 0, mergedPRs = 0, repoCount = 0, | ||
| languages = [], contributions = 0, totalCommits = 0, repoList = [], | ||
| contributionDays = [], currentStreak = 0, longestStreak = 0, | ||
| totalIssues = 0, openIssues = 0, closedIssues = 0, totalStars = 0, |
| }); | ||
| sections += `</g></g></g></g>`; | ||
| <g transform="translate(0, 136)"> | ||
| <text x="0" y="0" font-family="-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif" font-size="13" font-weight="600" fill="#${textColor}">Lines Changed <tspan fill="#8b949e" font-weight="400" font-size="11">(recent)</tspan></text> |
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.
safeFetchand timeouts to prevent crashes.