From f1703d62ac4dc2e480c322521619a8afa503fef3 Mon Sep 17 00:00:00 2001 From: Zaiba Machhaliya Date: Sat, 15 Aug 2026 18:33:59 +0530 Subject: [PATCH 1/2] fix: display contributor avatar on profile page using existing model data --- src/pages/ContributorProfilePage.jsx | 38 ++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/pages/ContributorProfilePage.jsx b/src/pages/ContributorProfilePage.jsx index 3cafec8..56f79aa 100644 --- a/src/pages/ContributorProfilePage.jsx +++ b/src/pages/ContributorProfilePage.jsx @@ -102,7 +102,7 @@ const getFullRepoFromUrl = (url) => { export default function ContributorProfilePage() { const { username } = useParams() const navigate = useNavigate() - const { orgs, pat, pullsData } = useApp() + const { orgs, pat, pullsData, model } = useApp() const [loading, setLoading] = useState(true) const [error, setError] = useState('') @@ -110,6 +110,12 @@ export default function ContributorProfilePage() { const [mergedPRKeys, setMergedPRKeys] = useState(new Set()) const [tab, setTab] = useState('prs') + + const contributor = useMemo( + () => model?.contributors?.find(c => c.login === username), + [model, username] + ) + // Date Range Filters (Defaults to Last 1 Year) const [startDate, setStartDate] = useState(() => { const d = new Date() @@ -305,18 +311,18 @@ export default function ContributorProfilePage() { // Time-series charting data (Chronological sorting by YYYY-MM) const chartData = useMemo(() => { const monthlyBuckets = {} - + filteredContribs.forEach(item => { const date = new Date(item.created_at) const year = date.getFullYear() const month = String(date.getMonth() + 1).padStart(2, '0') const yyyymm = `${year}-${month}` const displayName = date.toLocaleString('default', { month: 'short', year: '2-digit' }) // e.g. "May 26" - + if (!monthlyBuckets[yyyymm]) { monthlyBuckets[yyyymm] = { yyyymm, name: displayName, PRs: 0, Issues: 0 } } - + if (item.pull_request) { monthlyBuckets[yyyymm].PRs++ } else { @@ -419,7 +425,23 @@ export default function ContributorProfilePage() { + {contributor?.avatar_url && ( + {username} + )} + @{username} + + } subtitle={`Analyzing contributions across ${searchOrgs.join(', ')}`} right={