Skip to content

feat: add repository spotlight widget (pin your best repos) #1362

Open
harshitanagpal05 wants to merge 16 commits into
Priyanshu-byte-coder:mainfrom
harshitanagpal05:feat/repository-spotlight-1077
Open

feat: add repository spotlight widget (pin your best repos) #1362
harshitanagpal05 wants to merge 16 commits into
Priyanshu-byte-coder:mainfrom
harshitanagpal05:feat/repository-spotlight-1077

Conversation

@harshitanagpal05
Copy link
Copy Markdown
Contributor

Summary

Adds a Repository Spotlight Widget that lets users pin up to 3 flagship repositories to showcase on their Dashboard and Public Profile — complete with live GitHub stats and a 30-day commit activity sparkline.

Closes #1077


What's New

🚀 Pinned Repos Widget

  • Premium card layout displaying repo name, description, primary language badge, ⭐ stars, and 🍴 forks
  • Beautiful SVG area sparkline visualizing daily commit activity over the last 30 days
  • Responsive grid (1→2→3 columns) with hover effects and external GitHub links
  • Graceful loading skeletons, error states with retry, and empty-state CTA

⚙️ Settings UI

  • New Repository Spotlight section in Dashboard Settings
  • Search from your active repositories to pin (max 3)
  • Reorder pinned repos with ↑/↓ arrow buttons
  • One-click unpin with instant feedback

🔌 API & Data Layer

  • New GET /api/user/pinned-repos/details endpoint — fetches fresh repo metadata + 30-day commit counts from GitHub API
  • Shared fetchPinnedRepoDetails() library used by both the API route and server-side public profile rendering
  • Updated getUserByUsername to include pinned_repos for public profiles

Files Changed

File Change
src/lib/pinned-repos.ts [NEW] Shared library — PinnedRepoDetails type + GitHub API fetch logic
src/components/PinnedReposWidget.tsx [NEW] Client component with sparkline, loading/error/empty states
src/app/api/user/pinned-repos/details/route.ts [NEW] API endpoint for authenticated pinned repo details
src/lib/supabase.ts Added pinned_repos to getUserByUsername select
src/lib/public-profile-data.ts Exposed pinned_repos in public profile data
src/app/dashboard/page.tsx Integrated widget on Dashboard
src/app/u/[username]/page.tsx Integrated widget on Public Profile (server-side)
src/app/dashboard/settings/page.tsx Added spotlight settings section

Acceptance Criteria

  • Users can pin up to 3 repos in Settings
  • Pinned repos shown on Dashboard and Public Profile
  • Each card shows: name, description, language, stars, forks
  • 30-day commit sparkline rendered as SVG
  • Links to GitHub repo
  • Graceful handling of private/deleted repos

Verification

  • npm run type-check — passed
  • npm run lint — passed
  • npm run test — passed
  • npm run build — passed (616 additions, 0 errors)

…sights to avoid build failures when not installed
…-byte-coder#1077

Allow users to pin up to 3 repositories to showcase on their dashboard and public profile.

- New PinnedReposWidget component with SVG 30-day commit sparkline

- New /api/user/pinned-repos/details endpoint for fresh GitHub stats

- Settings UI to search, pin, reorder, and unpin repositories

- Integrated on both Dashboard and Public Profile pages

- New pinned-repos.ts shared library for fetching repo metadata
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

@harshitanagpal05 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.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:design GSSoC type bonus: UI/design (+10 pts) type:devops GSSoC type bonus: devops (+15 pts) type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts) labels May 28, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Thanks @harshitanagpal05 for the repository spotlight widget! This is ambitious work — the PinnedReposWidget, pinned-repos API, and public profile integration all look solid. However, there are several issues blocking a merge:

Blockers:

  1. pnpm-lock.yaml and pnpm-workspace.yaml — This project uses npm (not pnpm). Please remove these files and revert playwright.config.mjs if those changes are from pnpm setup.
  2. src/app/auth/signin/page.tsx — Modified in this PR AND in another pending PR (fix(auth): resolve GitHub OAuth error=github redirect loop #1299). This will cause conflicts.
  3. src/app/layout.tsx — Also modified by multiple active PRs. Please ensure your branch is up to date.
  4. src/components/landing/LandingPage.tsx — Already changed by Improve landing page readability and responsiveness #1355 (merged). Your changes here will need to be rebased.
  5. supabase/schema.sql or migration — If this adds a database column, it needs to be in a migration file.

What to do:

  • Rebase onto main (resolve conflicts in layout.tsx, LandingPage.tsx, globals.css)
  • Remove pnpm-lock.yaml and pnpm-workspace.yaml
  • Scope the PR to just the pinned repos feature (PinnedReposWidget, API route, public profile integration)

The core feature is valuable — looking forward to the cleaned-up version!

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level:advanced GSSoC: Advanced difficulty (55 pts) labels May 28, 2026
Priyanshu-byte-coder added a commit that referenced this pull request May 28, 2026
Adds PinnedReposWidget, pinned-repos API, settings integration,
and public profile support for showcasing pinned repositories.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:advanced GSSoC: Advanced difficulty (55 pts) type:design GSSoC type bonus: UI/design (+10 pts) type:devops GSSoC type bonus: devops (+15 pts) type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add repository spotlight widget (pin your best repo)

2 participants