Skip to content

Ultimate Full-Width Profile Dashboard (830px).#18

Merged
Chintanpatel24 merged 1 commit into
mainfrom
feat-and-fix-cards-9021963555964763502
May 16, 2026
Merged

Ultimate Full-Width Profile Dashboard (830px).#18
Chintanpatel24 merged 1 commit into
mainfrom
feat-and-fix-cards-9021963555964763502

Conversation

@Chintanpatel24
Copy link
Copy Markdown
Owner

  • Implemented a massive 830px wide Mastercard that covers the entire README.
  • Dashboard includes: Header, Primary Stats Row, Language Usage Mastery, Weekly Activity Chart, Top Repositories, Performance Streaks, and 12-month Heatmap.
  • Restored critical helper functions in src/github.js to fix regressions in standalone cards.
  • Enhanced robustness with parallel fetching, individual error handling, and robust timeouts.
  • Polished visuals with premium SVG styling and high-contrast accents.
  • Updated documentation and landing page with the new dashboard examples.

- Implemented a massive 830px wide Mastercard that covers the entire README.
- Dashboard includes: Header, Primary Stats Row, Language Usage Mastery, Weekly Activity Chart, Top Repositories, Performance Streaks, and 12-month Heatmap.
- Restored critical helper functions in `src/github.js` to fix regressions in standalone cards.
- Enhanced robustness with parallel fetching, individual error handling, and robust timeouts.
- Polished visuals with premium SVG styling and high-contrast accents.
- Updated documentation and landing page with the new dashboard examples.

Co-authored-by: Chintanpatel24 <216989679+Chintanpatel24@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 16, 2026 06:52
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gitlyy Ready Ready Preview, Comment May 16, 2026 6:52am

@Chintanpatel24 Chintanpatel24 merged commit b045ae1 into main May 16, 2026
7 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the “master” (830px) full-width dashboard card by redesigning the SVG layout/styling and adjusting the data-fetching helpers and API endpoint to support the new dashboard content and improved resiliency.

Changes:

  • Revamps src/svg-master.js to a new 830px “full dashboard” layout (header, 5-stat row, language usage, weekly activity, repos, streaks, 12-month heatmap).
  • Refactors api/master.js to fetch dashboard inputs in parallel with per-call fallbacks and a new cache key version.
  • Updates src/github.js helper behavior (safeFetch timeout param, simplified PR/stars/languages/contribution parsing, compatibility exports).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
src/svg-master.js Updates the master dashboard SVG layout, metrics displayed, and styling for the 830px card.
src/github.js Adjusts GitHub data fetch helpers (timeouts, paging strategy, contribution parsing) used by dashboard APIs.
api/master.js Updates the master dashboard endpoint to use parallel fetching with fallbacks and new cached payload fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/github.js
Comment on lines 42 to 47
async function fetchUserPullRequests(username) {
const perPage = 100;
let page = 1;
let allPRs = [];
try {
while (page <= 2) { // Limited to 2 pages to save rate limit
const url = `${GITHUB_API}/search/issues?q=author:${encodeURIComponent(username)}+type:pr&per_page=${perPage}&page=${page}`;
const data = await safeFetch(url);
if (!data || !data.items || data.items.length === 0) break;
allPRs = allPRs.concat(data.items);
if (allPRs.length >= data.total_count || data.items.length < perPage) break;
page++;
}
} catch (e) {}
return allPRs; // Returns empty array if fails
const encUser = encodeURIComponent(username);
const url = `${GITHUB_API}/search/issues?q=author:${encUser}+type:pr&per_page=100&page=1`;
const data = await safeFetch(url);
return data?.items || [];
}
Comment thread src/github.js
Comment on lines +168 to +171
const url = `${GITHUB_API}/users/${encUser}/repos?type=owner&per_page=100`;
const data = await safeFetch(url);
if (!Array.isArray(data)) return 0;
return data.reduce((sum, repo) => sum + (repo.stargazers_count || 0), 0);
Comment thread src/github.js
Comment on lines 135 to +149
const entryRegex = /<(?:td|rect)\b[^>]*\bdata-date="(\d{4}-\d{2}-\d{2})"[^>]*data-level="(\d+)"[^>]*>/g;
const dates = [];
let match;
while ((match = entryRegex.exec(html)) !== null) {
const date = match[1];
const level = parseInt(match[2], 10);
const tag = match[0];
const idMatch = tag.match(/\bid="([^"]+)"/);

dates.push({
id: idMatch ? idMatch[1] : `day-${dates.length}`,
date,
level,
date: match[1],
level: parseInt(match[2], 10),
count: 0
});
}

const tipRegex = /<tool-tip[^>]*for="([^"]+)"[^>]*>([\s\S]*?)<\/tool-tip>/g;
const countById = new Map();
while ((match = tipRegex.exec(html)) !== null) {
const targetId = match[1];
const tipText = match[2].replace(/\s+/g, " ").trim();
const countMatch = tipText.match(/(\d+)\s+contribution/i);
const count = countMatch ? parseInt(countMatch[1], 10) : 0;
countById.set(targetId, count);
}

const days = [];
for (let i = 0; i < dates.length; i++) {
const count = countById.has(dates[i].id) ? countById.get(dates[i].id) : (dates[i].level * 2);
days.push({
date: dates[i].date,
count: count,
level: dates[i].level,
});
}
const days = dates.map(d => ({
...d,
count: d.level * 2 // Fallback
}));
Comment thread src/github.js
const encUser = encodeURIComponent(username);
const url = `${GITHUB_API}/search/commits?q=author:${encUser}&per_page=100&sort=author-date`;
const data = await safeFetch(url, { headers: { Accept: "application/vnd.github.cloak-preview" } });
const allCommits = (data?.items || []).map(c => ({ timestamp: new Date(c.commit?.author?.date).getTime() }));
Comment thread api/master.js
Comment on lines +58 to +80
// Parallel fetch with individual error handling to prevent total failure
const [
prs, profile, contributionData, langData,
totalCommits, totalIssues, openIssues, closedIssues,
mergedPRCount, totalStars, openPRCount
] = await Promise.all([
safe(fetchUserPullRequests(username), []),
safe(fetchUserProfile(username), { login: username, public_repos: 0 }),
safe(fetchContributionData(username), { totalContributions: 0, days: [] }),
safe(fetchUserLanguages(username), { languages: [], totalRepos: 0 }),
safe(fetchTotalCommitCount(username), 0),
safe(fetchUserIssues(username), 0),
safe(fetchOpenIssues(username), 0),
safe(fetchClosedIssues(username), 0),
safe(fetchMergedPullRequests(username), 0),
safe(fetchUserTotalStars(username), 0),
safe(fetchOpenPullRequests(username), 0)
]);

const linesChanged = await safe(fetchRecentPRLinesChanged(prs, 3), 0);

const days = contributionData?.days || [];
const sortedDays = [...days].sort((a, b) => a.date.localeCompare(b.date));
Comment thread api/master.js
Comment on lines +111 to +118
data = {
username: profile.login || username,
name: profile.name || profile.login || username,
totalPRs: prs.length || 0,
openPRs: openPRCount || 0,
mergedPRs: mergedPRCount || 0,
repoCount: profile.public_repos || 0,
languages: langData.languages || [],
Comment thread src/svg-master.js
Comment on lines +44 to 52
// --- MAIN STATS ROW ---
const statW = Math.floor(innerW / 5);
const heroStats = [
{ label: "Commits", value: totalCommits.toLocaleString(), color: accentColor },
{ label: "Stars", value: totalStars.toLocaleString(), color: "eab308" },
{ label: "PRs", value: totalPRs, color: "8b5cf6" },
{ label: "Issues", value: totalIssues, color: "f85149" },
{ label: "Contribs", value: contributions.toLocaleString(), color: "39d353" },
{ label: "Lines +/-", value: linesChanged.toLocaleString(), color: "fb923c" },
{ label: "Contributions", value: contributions.toLocaleString(), color: "39d353" },
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants