diff --git a/src/pages/ContributorProfilePage.jsx b/src/pages/ContributorProfilePage.jsx index 3cafec8..87fd664 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} + + } subtitle={`Analyzing contributions across ${searchOrgs.join(', ')}`} right={