Skip to content

Conversation

@opencode-agent
Copy link

Summary

I have successfully implemented support for multiple GitHub accounts in the application. Here's what was added:

Key Changes:

  1. New Type Definitions (types.ts):

    • Added Account interface with id, token, and user fields
  2. Updated State Management (App.tsx):

    • Replaced single token/user state with accounts array and currentAccountId
    • Added helper variables for current account data
    • Modified login flow to add/update accounts instead of replacing
    • Updated logout to handle account-specific removal
  3. Enhanced UI (views/Dashboard.tsx):

    • Added account switcher dropdown in the header
    • Shows current account with avatar and login
    • Lists all accounts with switch option
    • "Add Account" button to authenticate new accounts
    • Click-outside handler for dropdown
  4. Cache Isolation (services/cacheService.ts):

    • Updated all cache keys to include accountId parameter
    • Prevents data mixing between different accounts
  5. Component Updates:

    • Updated Dashboard, RepoDetail, and IssueDetail to accept and use accountId
    • All views now properly isolate data per account

Features:

  • Add Multiple Accounts: Users can authenticate with multiple GitHub accounts
  • Account Switching: Easy switching between accounts via dropdown
  • Data Isolation: Each account's data (repos, issues, cache) is kept separate
  • Seamless UX: Switching accounts navigates back to dashboard for clean state
  • Persistent Storage: Accounts and current selection saved in localStorage

User Flow:

  1. Initial login creates first account
  2. Click account avatar/name → dropdown shows all accounts
  3. Select "Add Account" → goes through OAuth flow for new account
  4. Switch between accounts instantly
  5. Logout removes specific account, switches to another if available

The implementation maintains backward compatibility and ensures data security by isolating cached information per account. All TypeScript checks pass and the build completes successfully.

Closes #13

New%20session%20-%202025-12-23T05%3A16%3A34.691Z
opencode session  |  github run

Co-authored-by: friuns <friuns@users.noreply.github.com>
@github-actions github-actions bot temporarily deployed to commit December 23, 2025 05:19 Inactive
@github-actions
Copy link

🚀 Netlify Deployment

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

Branch: opencode/issue13-20251223051635
Commit: 6b59f41

@friuns2
Copy link

friuns2 commented Dec 23, 2025

/oc when i change account repositories not refreshed, attach screenshot to pull request

@opencode-agent
Copy link
Author

User friuns2 does not have write permissions

github run

@opencode-agent
Copy link
Author

User friuns2 does not have write permissions

github run

@friuns
Copy link
Owner

friuns commented Dec 23, 2025

/oc when i change account repositories not refreshed, attach screenshot to pull request

@friuns
Copy link
Owner

friuns commented Dec 23, 2025

/opencode when i change account repositories not refreshed, attach screenshot to pull request

Co-authored-by: friuns <friuns@users.noreply.github.com>
@opencode-agent
Copy link
Author

Fixed the issue where repositories weren't refreshing when switching accounts by updating the useEffect in views/Dashboard.tsx to depend on accountId. This ensures loadRepos runs whenever the account changes, fetching fresh data for the new account while showing cached data immediately.

The build passes without TypeScript errors. Regarding the screenshot request, I cannot directly attach images to the pull request, but the user can manually add one if needed to demonstrate the fix.

New%20session%20-%202025-12-23T09%3A36%3A49.339Z
opencode session  |  github run

@github-actions github-actions bot temporarily deployed to commit December 23, 2025 09:38 Inactive
@github-actions
Copy link

🚀 Netlify Deployment

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

Branch: opencode/issue13-20251223051635
Commit: 86336cb

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

3 participants