Skip to content

feat: multi-account GitHub linking — link work/personal accounts & view combined stats (#2498)#2499

Open
IshitaSingh0822 wants to merge 11 commits into
Umbrella-io:mainfrom
IshitaSingh0822:feat/multi-account-github-linking
Open

feat: multi-account GitHub linking — link work/personal accounts & view combined stats (#2498)#2499
IshitaSingh0822 wants to merge 11 commits into
Umbrella-io:mainfrom
IshitaSingh0822:feat/multi-account-github-linking

Conversation

@IshitaSingh0822

Copy link
Copy Markdown
Contributor

Summary

Implements multi-account GitHub linking so developers can connect separate personal and work GitHub identities to a single DevTrack session, view combined contribution stats, and switch between accounts via the dashboard header switcher.

Closes #2498


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • src/app/api/accounts/route.ts — GET endpoint to list all linked GitHub accounts
  • src/app/api/accounts/link/route.ts — POST endpoint to initiate GitHub OAuth flow for a second account
  • src/app/api/accounts/[githubLogin]/route.ts — DELETE endpoint to unlink an account by GitHub login
  • src/app/settings/page.tsx — new /settings page with linked accounts management UI (add/remove, avatar display)
  • src/components/AccountToggle.tsx — updated switcher with GitHub avatars, Combined view, and WCAG 2.1 AA keyboard accessibility
  • supabase/migrations/20260617000000_add_linked_accounts_view.sql — linked_accounts view + RLS select/delete policies

How to Test

  1. Sign in to DevTrack with your primary GitHub account
  2. Go to /settings and click "Link another GitHub account"
  3. Complete the GitHub OAuth flow with a second account
  4. Return to /settings — linked account appears with avatar and added date
  5. Go to /dashboard — account switcher appears at the bottom of the header
  6. Click the second account — all metric widgets re-fetch for that account
  7. Click "Combined" — stats aggregate across both accounts
  8. Click Remove on /settings — account disappears immediately
  9. Tab through the switcher buttons and press Enter/Space to verify keyboard nav

Expected result: accounts link/unlink correctly, switcher updates all dashboard widgets, tokens never appear in plaintext in session or DB


Checklist

  • Linked the related issue above
  • Self-reviewed my own diff
  • No unnecessary console.log, debug code, or commented-out blocks
  • npm run lint passes locally
  • No TypeScript errors (npm run type-check)
  • Added or updated tests where applicable
  • Updated documentation / comments if behavior changed

Accessibility (UI changes only)

  • Keyboard navigation works correctly
  • Color contrast meets WCAG AA standard
  • ARIA labels / roles added where needed
  • Tested on mobile / responsive layout

Additional Context

Access tokens are stored AES-256-GCM encrypted using the existing encryptToken/decryptToken from src/lib/crypto.ts — same pattern as the existing user_github_accounts table. No breaking changes to existing single-account behaviour; fully additive.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels Jun 16, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — 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

@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:performance GSSoC type bonus: performance (+15 pts) labels Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Multi-account GitHub linking — link work/personal accounts & view combined stats

1 participant