feat: add Year in Code annual recap page (#1073)#1086
Conversation
|
@VIDYANKSHINI is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a “Year in Code / Wrapped” experience: a new dashboard promo card navigates to a slide-based recap page backed by a GitHub-powered API, plus an OG image endpoint for sharing.
Changes:
- Added
/wrappedclient page with multi-slide recap UI and sharing CTA. - Added
/api/wrappedroute to aggregate yearly GitHub contribution metrics. - Added
/api/wrapped/ogedge route to generate a shareable OG image and linked entry point from the dashboard.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| src/app/wrapped/page.tsx | New client-side “Wrapped” slide UI that fetches recap data and renders a share CTA. |
| src/app/dashboard/page.tsx | Adds a promotional card linking users to the Wrapped page. |
| src/app/api/wrapped/route.ts | New server route that fetches GitHub contribution stats and returns Wrapped JSON. |
| src/app/api/wrapped/og/route.tsx | New edge OG image generator for sharing Wrapped results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {year} Year in Code | ||
| </h1> | ||
| <p style={{ fontSize: "30px", color: "#a1a1aa", marginTop: "10px" }}> | ||
| @{login}'s DevTrack Recap |
| const year = yearParam ? parseInt(yearParam, 10) : new Date().getFullYear(); | ||
|
|
| import { authOptions } from "@/lib/auth"; | ||
| import { GITHUB_API } from "@/lib/github"; | ||
| import { resolveAppUser } from "@/lib/resolve-user"; | ||
| import { dateDiffDays } from "@/lib/dateUtils"; |
| const date = new Date(item.commit.author.date); | ||
| const hour = date.getHours(); // Local hour of the user based on server processing? | ||
| // Wait, server time is UTC. Let's just use getUTCHours or assume user's timezone if possible. | ||
| // Since it's server side, let's just use getHours() which will be UTC or server local. | ||
| // To be precise we should pass the client timezone, but for simplicity let's use UTC hour and tell user "UTC". | ||
| // Actually, many developers use UTC. Or we can just do getHours(). | ||
| const h = date.getHours(); |
| headers: { Authorization: `Bearer ${token}` }, | ||
| cache: "no-store", | ||
| }), | ||
| fetch(`${GITHUB_API}/search/commits?q=author:${login}+author-date:${year}-01-01..${year}-12-31&per_page=100`, { |
| <div className="absolute inset-y-0 left-0 z-40 w-1/3 cursor-pointer" onClick={handlePrev}></div> | ||
| <div className="absolute inset-y-0 right-0 z-40 w-2/3 cursor-pointer" onClick={handleNext}></div> |
| <a | ||
| href={`https://twitter.com/intent/tweet?text=Check out my ${data.year} Year in Code on DevTrack!&url=https://devtrack.com`} |
750dbf2 to
ebd8cb1
Compare
|
Hi @Priyanshu-byte-coder, @copilot I have fully addressed all the feedback and suggestions provided by the Copilot AI code review for the Wrapped feature. The following fixes have been force-pushed to this PR:
All tests and type-checks are passing locally. This PR is ready for your review! |
|
Hi! The feature looks great! However, the core CI checks (Type check, Build, Playwright) didn't run on this PR — only GitGuardian and auto-labeling triggered. Could you check your fork's Actions settings? We need all CI checks to pass before merging. If you're having trouble, let me know! |
|
Thanks for your patience! I've resolved the issues caused by the recent merge with
All CI checks (Build, Type-check, Lint, and Playwright smoke tests) are now completely green! ✅ Could you please review it now? Let me know if there's anything else you'd like me to change before merging! |
Summary
This PR introduces the "Year in Code" (Wrapped) experience, providing users with a highly engaging and shareable annual recap of their GitHub activity.
Closes #1073
Type of Change
Changes Made
src/app/api/wrapped/route.tsto fetch and aggregate yearly stats (commits, streaks, top month, top repo, top languages) efficiently using the GitHub GraphQL API.src/app/wrapped/page.tsxwith a dynamic, slide-based UI featuring smooth CSS transitions and radial gradient visuals.src/app/api/wrapped/og/route.tsxto generate a dynamic, shareable Open Graph (og:image) summary card usingnext/og(ImageResponse).src/app/dashboard/page.tsxto guide users to their Wrapped experience.How to Test
npm run devlocally./api/wrapped/ogwith test query parameters (e.g.?login=test&year=2026&commits=500).Checklist
npm run lintpasses locallynpm run type-check)