Skip to content

Add Account submenu and Repository Settings item to the repository context menu - #23023

Merged
niik merged 11 commits into
niik-group-enterprise-accounts-by-hostfrom
niik-repository-accounts-context-submenu
Nov 3, 2026
Merged

niik merged 11 commits into
niik-group-enterprise-accounts-by-hostfrom
niik-repository-accounts-context-submenu

Conversation

@niik

@niik niik commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Part of the multi-account stack (#23020 → #23021 → #23022 → this). Implements the context menu part of acceptance criteria #388 Change a repository's account, and adds a shortcut to Repository Settings.

Description

The repository context menu (repository list and the Current Repository toolbar button) gets two additions.

Account submenu

Reassigns a repository to another signed-in account on its host.

  • Items are checkboxes labelled @login, with the current account checked. There is no "No account" option.
  • If the current account is signed out, it's listed as @login (Signed out), checked and disabled. The signed-in accounts next to it stay selectable.
  • Selecting an account calls dispatcher.updateRepositoryAccount, the same path Repository Settings uses, and errors are posted through postError. There's no confirmation, which matches Settings.
  • The submenu is hidden when there's nothing to choose:
    • non-GitHub repositories
    • an associated repository whose host has ≤1 retained identity (signed-in accounts on the host, plus the assigned login if it's signed out)
    • an unassociated repository with no signed-in account on its host

The label is the singular "Account" because the submenu is a single choice. The acceptance criteria text says "Accounts".

The Repository Settings scenario was already in place before this PR and is covered by repository-settings-account-test.tsx.

Repository Settings… item

"Repository Settings…" (macOS) / "Repository settings…" (Windows) comes right after the Account submenu. It opens Repository Settings for the right-clicked repository, including repositories not on GitHub. It's hidden for cloning and missing repositories.

The selection doesn't change. The dialog reads the repository's remote only when it opens, and that state is only loaded once a repository has been refreshed. So a repository that isn't selected is refreshed first; otherwise its Remote tab would show "Publish" instead of its remote.

Screenshots

None: the native Electron context menu can't be captured by the UI test harness.

Release notes

Notes: no-notes

Lets users reassign a repository to another signed-in account on its
host from the repository list and toolbar context menus. A signed-out
current account is shown checked and disabled. The submenu is hidden
when there's nothing to choose between.

Co-authored-by: Copilot App <[email protected]>
…y-host' into niik-repository-accounts-context-submenu
Copilot AI balanced review requested due to automatic review settings October 19, 2026 10:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Static review found no blocking issues in the focused menu changes and test coverage; tests were not executed.

No open issues 🎉

What changed in this PR

Adds an Account submenu to repository context menus, extending the multi-account workflow beyond Repository Settings.

Changes:

  • Offers eligible accounts and marks retained signed-out assignments.
  • Connects both context-menu entry points to the existing dispatcher, with error reporting.
  • Adds tests for account selection, identity matching, and submenu visibility.
File Description
app/​test/​unit/​ui/​repository-list-item-context-menu-test.ts Tests account choices, selection, and visibility rules.
app/​src/​ui/​repositories-list/​repository-list-item-context-menu.ts Builds the Account submenu.
app/​src/​ui/​repositories-list/​repositories-list.tsx Passes accounts and the selection callback to list menus.
app/​src/​ui/​app.tsx Wires both entry points to account updates and error reporting.

Review effort: Balanced

niik and others added 2 commits October 19, 2026 16:53
Opens Repository Settings for the right-clicked repository without
changing the selection. Unselected repositories are refreshed first so
the dialog shows their remote.

Co-authored-by: Copilot App <[email protected]>
…ory-accounts-context-submenu

Co-authored-by: Copilot App <[email protected]>
@niik niik changed the title Add Account submenu to the repository context menu Add Account submenu and Repository Settings item to the repository context menu Oct 19, 2026
@niik
niik marked this pull request as ready for review October 19, 2026 15:06
@niik
niik requested a review from a team as a code owner October 19, 2026 15:06
@niik
niik requested a review from sergiou87 October 19, 2026 15:06
niik and others added 3 commits October 20, 2026 12:15
…ory-accounts-context-submenu

Co-authored-by: Copilot App <[email protected]>
…ory-accounts-context-submenu

Co-authored-by: Copilot App <[email protected]>
…ory-accounts-context-submenu

Co-authored-by: Copilot App <[email protected]>
sergiou87
sergiou87 previously approved these changes Oct 21, 2026

@sergiou87 sergiou87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected except for a bug reported in #23020 (comment) that is easier to repro here. I assume it will be dealt with either in #23030 or in a new PR, so I'm gonna approve this one.

…ory-accounts-context-submenu

Co-authored-by: Copilot App <[email protected]>
niik and others added 3 commits October 21, 2026 15:06
…ory-accounts-context-submenu

Co-authored-by: Copilot App <[email protected]>
…ory-accounts-context-submenu

Co-authored-by: Copilot App <[email protected]>
…ory-accounts-context-submenu

Co-authored-by: Copilot App <[email protected]>

@sergiou87 sergiou87 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug already fixed in the first PR 🙌 Thank you!!

@niik
niik merged commit 2d36510 into development Nov 3, 2026
9 checks passed
@niik
niik deleted the niik-repository-accounts-context-submenu branch November 3, 2026 09:38
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.

3 participants