Skip to content

Conversation

Copy link

Copilot AI commented Dec 23, 2025

Implements multiple account management, allowing users to sign in with multiple GitHub accounts and switch between them without logging out.

Changes

Account Management Service

  • services/accountService.ts: Centralized account operations (add, remove, switch, get active)
  • Storage structure: { accounts: Account[], activeAccountId: string } in localStorage
  • Auto-migrates legacy single-account data (gh_token, gh_user) on first load
  • Per-account cache isolation with accountId-prefixed keys

UI Components

  • components/AccountSwitcher.tsx: Dropdown in header showing all accounts
    • Switch accounts on click
    • Add new accounts via "+ Add Account"
    • Remove accounts (hover → X button, protected when single account)
    • Full keyboard navigation with focus:opacity-100

Cache Scoping

  • services/cacheService.ts: Added optional accountId parameter to getCached/setCache
  • Cache keys: vibe_github_cache_{accountId}_{resource} prevents data leakage between accounts
  • All views updated to pass accountId for cache operations

Application Flow

  • App.tsx: Account state management replaces direct localStorage access
  • views/TokenGate.tsx: "Add Account" mode with cancel flow
  • views/Dashboard.tsx: Renders AccountSwitcher, reloads data on account change
  • views/RepoDetail.tsx, views/IssueDetail.tsx: Account-scoped caching

Example

// Add account after GitHub OAuth
const account = addAccount(token, user);

// Switch active account
setActiveAccount('username');

// Cache scoped per account
setCache(CacheKeys.repos(), data, accountId);

Screenshot

Login page with account infrastructure

Account switcher appears in header once logged in, displaying avatar/username with dropdown for account operations.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for multiple accounts </issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 23, 2025
Copilot AI and others added 5 commits December 23, 2025 05:24
Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
…nsistency

Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
Co-authored-by: friuns <7095563+friuns@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for multiple accounts Add support for multiple GitHub accounts Dec 23, 2025
Copilot AI requested a review from friuns December 23, 2025 05:36
@github-actions github-actions bot temporarily deployed to commit December 23, 2025 07:46 Inactive
@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694a48d39cd2d1b2b243fe48--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts
Commit: bd51529

@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694a607a37cac130d5849ce9--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts
Commit: ac696b5

@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694a6082b304bb17e1ec2c1b--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts
Commit: cc803f9

@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694a6084bb74ee3333919118--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts
Commit: b346683

@github-actions
Copy link

🚀 Netlify Deployment

Deploy URL: https://694a6086648826350a20ad77--my-test-site3.netlify.app

Branch: copilot/add-support-for-multiple-accounts
Commit: da951ec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for multiple accounts

2 participants