Skip to content

feat(desktop): sign in to GitHub and manage model accounts in Connections - #4313

Merged
LHagfoss merged 2 commits into
mainfrom
feat/desktop-connections-accounts
Nov 24, 2026
Merged

LHagfoss merged 2 commits into
mainfrom
feat/desktop-connections-accounts

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

Settings › Connections could only show sign-in state and told you to run gh auth login yourself. The engine already had the whole flow (_rustcode/connections/github/{login,wait,cancel,logout} and account/{logout,refresh}), left over from the SwiftUI app; nothing called it.

  • GitHub: Sign in with GitHub (or Add account once one exists) starts gh auth login --web. The page shows the one-time code large, with Copy code and open GitHub, Cancel, and a waiting spinner; when GitHub approves, the list updates and a toast names the account. A token that went invalid offers Sign in again. Each account has a sign-out button behind a confirm.
  • No GitHub CLI: the install command with a copy button, and a link to cli.github.com.
  • Model accounts: provider mark, name, provider and sign-in method in words ("OpenAI · ChatGPT sign-in" instead of openai · chat_gpt), with refresh-models and sign-out actions. Adding one stays /login in a thread.
  • Moved the page out of Settings.tsx into ui/SettingsConnections.tsx, with parsing and labels in state/connections.ts. The mock's connections answers moved to acp/mockConnections.ts (acp/mock.ts was 3 lines under its size cap) and now play out a device-code sign-in.
  • A row is keyed by its state, so a row whose badge changes remounts. In Chromium, a row that changed in place inside the @container row stayed at 0 px height until the page was reopened.

Changelog

Settings › Connections: sign in to GitHub and sign accounts out without a terminal; model accounts can refresh their models.

Testing

  • bun run check in apps/desktop; check-comments.py, check-rust-size.py.
  • Mock window: opened Connections, pressed Add account, saw the code panel, and after the mock approved, octocat turned "Usable" and hubot "Signed in", with the toast. Measured both rows at 81 px after the update.
  • Not tried against a real gh (that would sign the user's real GitHub CLI in and out).

@github-actions github-actions Bot added the feature New feature or request label Nov 24, 2026
@LHagfoss
LHagfoss merged commit 3716723 into main Nov 24, 2026
9 checks passed
@LHagfoss
LHagfoss deleted the feat/desktop-connections-accounts branch November 24, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants