Repository navigation
Manage repositories for an account - #23223
Conversation
Let users assign tracked repositories on an account's host to that account from a new "Manage repositories" action in Account settings. The dialog also opens automatically after a previously unknown account signs in from Account settings when its host has tracked repositories; credential refreshes of an existing account do not open it. Unassigned repositories and repositories already on the account start selected. Confirming assigns selected repositories, clears the assignment of deselected repositories that were on the account, and leaves every other repository's association unchanged. Assignments are saved in a single transaction and Git remotes are never rewritten. Refs #376 Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Replace the per-account Manage repositories and Sign out buttons with a single overflow button that opens a contextual menu. Co-authored-by: Copilot App <[email protected]>
… menu Replace the grouped GitHub.com/Enterprise sections with a single sorted account list (GitHub.com first, then by host) that shows each account's endpoint, and add a header with an Add account dropdown. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
…ccount Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
- Fix rows inheriting the dialog's list-item margin, which left a large empty band under every row and made the details hug the top. - Lay each row out on a grid: checkbox, name over owner/name, and the current association vertically centered on the right, with a person icon for assigned accounts and emphasis for this account. - Make the whole row toggle its checkbox and add a hover state that keeps secondary text above AA contrast in both themes. - Give the filter the full width with a search icon and a single clear button, and move Select all/none into a list header with a selection count. - Keep the list area a fixed height so filtering and no-matches don't resize the dialog, and move the unselecting caveat below the list. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The dialog makes duplicate local clones indistinguishable and can unintentionally clear account assignments for repositories added while it is open.
2 open issues
What changed in this PR
Adds bulk management of local repository account associations to GitHub Desktop’s Account settings, without changing Git remotes or author details.
Changes:
- Adds a searchable repository-selection dialog with bulk assignment and unassignment.
- Opens the dialog from account actions or after adding a previously unknown account with tracked repositories.
- Redesigns Account settings and adds store, sign-in, and UI regression coverage.
| File | Description |
|---|---|
app/test/unit/ui/preferences-accounts-test.tsx |
Tests account ordering and action menus. |
app/test/unit/ui/manage-account-repositories-test.tsx |
Tests selection, filtering, errors, and empty states. |
app/test/unit/ui/invalidated-token-test.tsx |
Updates recovery coverage for the Add account menu. |
app/test/unit/stores/app-store-accounts-test.ts |
Tests post-sign-in prompts and bulk assignments. |
app/test/unit/repositories-store-test.ts |
Tests bulk persistence and account-scoped metadata. |
app/test/unit/account-repositories-test.ts |
Tests host filtering, selection, and assignment rules. |
app/styles/ui/dialogs/_manage-account-repositories.scss |
Styles the repository-management dialog. |
app/styles/ui/_preferences.scss |
Styles the redesigned account list and actions. |
app/styles/ui/_dialog.scss |
Includes the new dialog styles. |
app/src/ui/repository-account/manage-account-repositories-dialog.tsx |
Implements the searchable bulk-assignment dialog. |
app/src/ui/preferences/preferences.tsx |
Connects Account settings to the new flows. |
app/src/ui/preferences/accounts.tsx |
Adds host-sorted accounts and contextual actions. |
app/src/ui/dispatcher/dispatcher.ts |
Exposes dialog, sign-in, and assignment operations. |
app/src/ui/app.tsx |
Renders the dialog with current local repositories. |
app/src/models/popup.ts |
Defines the new popup type and account payload. |
app/src/lib/stores/repositories-store.ts |
Persists multiple assignments in one transaction. |
app/src/lib/stores/app-store.ts |
Coordinates sign-in prompts and bulk updates. |
app/src/lib/account-repositories.ts |
Defines repository selection and account-change logic. |
Review effort: Balanced
| <span className="account-repository-full-name"> | ||
| {repository.gitHubRepository.fullName} | ||
| </span> |
There was a problem hiding this comment.
We're holding off on showing the full local path until users tell us identical rows are actually a problem. Repository aliases should already let people tell clones apart in most of these cases. The other review comment, about selecting repositories that are added while the dialog is open, is fixed in #23254.
Auto-replied by the GitHub Copilot app
| isSubmitting: false, | ||
| error: null, | ||
| } | ||
| } |
The production compile now peaks just above the 4 GiB V8 heap limit, causing intermittent out-of-memory failures in CI (desktop#23223) and locally (desktop#23217). Co-authored-by: Copilot App <[email protected]> (cherry picked from commit 3d25f25)
The production compile now peaks just above the 4 GiB V8 heap limit, causing intermittent out-of-memory failures in CI (desktop#23223) and locally (desktop#23217). Co-authored-by: Copilot App <[email protected]>
|
Thanks for the review! We're taking the remaining review comments (default-selecting repositories that arrive while the dialog is open, and showing local paths to distinguish duplicate clones) to a follow-up PR. |

Closes #376
Description
With multiple accounts on the same host, there was no way to review or change which local repositories use an account, other than one at a time from Repository settings. This PR adds a Manage repositories dialog that does it for all repositories on the account's host at once.
Dialog (
ManageAccountRepositoriesDialog, logic inapp/src/lib/account-repositories.ts)RepositoriesStore.updateRepositoryAccounts). Git remotes, author name and email are not modified.When it opens
isPreviouslyUnknownAccount).Account settings redesign
@login · host.No metrics are added.
Screenshots
Screenshots use fake accounts and repositories.
Validation
At
23d5e0d85f, these passed:tsc --noEmitaccount-repositories-test.tsui/manage-account-repositories-test.tsxui/preferences-accounts-test.tsxEarlier commits on the branch also passed:
repositories-store-test.tsstores/app-store-accounts-test.tsui/invalidated-token-test.tsxManually checked in a built app with fake accounts, in light and dark themes:
The full unit suite was not run locally; CI covers it.
Team-authored review
Evidence: See the Screenshots and Validation sections above.
Review path:
needs-deep-review.A repository's account association decides which account's credentials Desktop uses for GitHub API requests and HTTPS Git authentication, so this changes a credential trust boundary. Areas for in-depth review:
getAccountRepositoryChanges/getInitialAccountRepositorySelectioninapp/src/lib/account-repositories.ts: confirm that unchecked repositories assigned to other accounts are never reassigned or cleared.isPreviouslyUnknownAccountand the post-sign-in flow inAppStore: confirm that a credential refresh for an existing account never opens the dialog.RepositoriesStore.updateRepositoryAccountsandAppStore._updateAccountRepositories: confirm that only the association is persisted, open repository stores pick it up, and Git remotes are untouched.Release notes
Notes: [Added] Choose which repositories use an account from the Accounts settings - #376