Publish with a single account picker across hosts by niik · Pull Request #23024 · desktop/desktop · GitHub
Skip to content

Publish with a single account picker across hosts - #23024

Open
niik wants to merge 12 commits into
niik-repository-accounts-context-submenufrom
niik-publish-account-picker
Open

niik wants to merge 12 commits into
niik-repository-accounts-context-submenufrom
niik-publish-account-picker

Conversation

@niik

@niik niik commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Part of the multi-account stack (#23020 → #23021 → #23022 → #23023 → this). Closes the remaining gaps in #379 "Publish with a selected account".

Description

  • No more host tabs. Publish Repository shows one account picker that lists every signed-in account, grouped by host: GitHub.com first, then each GitHub Enterprise host in alphabetical order.
  • Choosing an account is required when it's ambiguous. For an unassociated repository with several signed-in accounts, the picker starts on "Choose an account…" and Publish stays disabled until the user picks one. When the repository already has a signed-in account assigned, that account is preselected. When only one account is signed in, it's preselected.
  • Organizations follow the account. Changing the account clears the chosen organization, which belongs to the previous account. The org list is fetched again, and late responses for an account that's no longer selected are ignored.
  • Signing in from Publish. With no accounts, the dialog shows the existing GitHub.com sign-in prompt plus a "Sign in to GitHub Enterprise" link. Sign-in goes through a result callback: Publish stays open under the sign-in dialog, then selects the new account. The general repository-association dialog isn't involved. To add more accounts when some are already signed in, users sign in from Settings.
  • Host grouping is shared with Preferences. The picker and the Accounts preferences use the same groupAccountsByHost helper (app/src/lib/group-accounts-by-host.ts), so both order hosts the same way.
  • Shared picker changes. AccountPicker now accepts a null selection, which shows a placeholder, and an opt-in groupByHost. Clone isn't changed here; it can opt in in the next layer.
  • After a successful publish, the repository is still associated with the selected account (existing _publishRepository behaviour). The oauth.md doc is updated to match.

#379 scenario check

Scenario Covered by
Picker, no host tabs publish-repository-test (grouped headers, no .tab-bar)
Preserve existing association multi-account-pickers-test (assigned enterprise account preselected)
Sole account selected publish-repository-test
Require a choice publish-repository-test (placeholder, disabled, submit ignored until chosen)
Refresh owners/organizations publish-repository-test (orgs refetched per account, stale org cleared)
Associate after publish existing _publishRepository stores account.login
No accounts → sign-in prompt publish-repository-test
Resume after contextual sign-in publish-repository-test (callback selects new account)

Screenshots

The screenshots with signed-in accounts were taken before the "Sign in to another account…" link under the picker was removed, so they still show it.

Multiple accounts, unassociated repository: an account choice is required
Publish dialog with "Choose an account…" placeholder and disabled Publish button

Accounts grouped by host
Account picker open with GitHub.com, acme.ghe.com and ghe.example.com sections

After choosing an enterprise account
Publish dialog with @monalisa on ghe.example.com selected and Publish enabled

Only one account signed in
Publish dialog with the only account preselected

No accounts signed in
Publish dialog with GitHub.com sign-in prompt and GitHub Enterprise link

Release notes

Notes: [Improved] Publish Repository lets you pick from all signed-in accounts on GitHub.com and GitHub Enterprise in a single list

Replace the GitHub.com / GitHub Enterprise tabs in Publish Repository with a
single account picker that groups signed-in accounts by host. An
unassociated repository with several signed-in accounts now requires an
explicit choice; the assigned account, or the only account, is still
preselected.

Changing the account clears the chosen organization and ignores
organization responses for a previously selected account. Signing in from
the dialog (or via "Sign in to another account…") selects the new account.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@niik
niik added this pull request to stack #23045 October 19, 2026 10:02
…sh-account-picker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 19, 2026 10:40

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

No blocking issues were identified in the changed code or integration flows; automated tests were not executed.

No open issues 🎉

What changed in this PR

Unifies publishing across GitHub.com and GitHub Enterprise with one account picker, extending the multi-account workflow.

Changes:

  • Groups accounts by host and requires a selection when ambiguous.
  • Refreshes organizations when accounts change and selects newly signed-in accounts.
  • Updates UI tests, styling, and OAuth documentation.
File Description
docs/​technical/​oauth.md Documents publish account selection and association.
app/​test/​unit/​ui/​publish-repository-test.tsx Covers selection, grouping, organizations, and sign-in.
app/​test/​unit/​ui/​multi-account-pickers-test.tsx Updates expectations for the unified picker.
app/​styles/​ui/​dialogs/​_publish-repository.scss Styles sign-in links.
app/​styles/​ui/​_account-picker.scss Styles the selection placeholder.
app/​src/​ui/​publish-repository/​publish.tsx Replaces host tabs with unified selection and contextual sign-in.
app/​src/​ui/​publish-repository/​publish-repository.tsx Integrates the picker and guards organization responses.
app/​src/​ui/​account-picker.tsx Adds nullable selection and optional host grouping.

Review effort: Balanced

niik and others added 3 commits October 19, 2026 16:25
The account picker grouped by friendly hostname with its own ordering while
Accounts preferences grouped by web host. Move the Preferences helper to
app/src/lib/group-accounts-by-host.ts and build the picker's groups from it:
GitHub.com first, then one group per enterprise host in the same order as
Preferences.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Users can sign in to additional accounts from Settings. The no-accounts
sign-in prompt in Publish is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sh-account-picker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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 williammartin October 19, 2026 15:06
niik and others added 7 commits October 20, 2026 12:17
…sh-account-picker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
getHTMLURL now keeps non-default ports, so a server on another port gets
its own group.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sh-account-picker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sh-account-picker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sh-account-picker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sh-account-picker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…sh-account-picker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

2 participants