Skip to content

feat(app): switch OpenCode accounts from the model picker - #66848

Merged
arvsrn merged 3 commits into
devfrom
account-switcher
Nov 30, 2026
Merged

arvsrn merged 3 commits into
devfrom
account-switcher

Conversation

@arvsrn

@arvsrn arvsrn commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Stacked on #66847.

The picker gets one OpenCode header for the active Console workspace. The header is a menu trigger showing the account and a Go badge.

  • The menu lists the sign-in accounts, with the active one checked, then Add account and Manage accounts. Manage opens the OpenCode accounts list.
  • API-key credentials aren't listed. They stay in Settings → Providers.
  • The workspace's paid models sit under the header, followed by a Go sub-heading, then the workspace's other providers.
  • The header is keyboard-reachable. Escape closes only the menu.

No feature flag: additive UI in the desktop app. English copy only; no existing keys removed.

Known limitations

  • Only "Go" is detectable today, and only for the active workspace. Go Plus, Go Teams and inactive accounts' plans aren't in the data.
  • The phone drawer has no switcher yet.

How did you verify your code works?

bun typecheck and unit tests in packages/app; /review and /rmslop passes; visual check of every state in the desktop app (opencode-drive against a fake Console) compared with the design stories. Picker e2e and the model-picker component tests pass.

Screenshots / recordings

Before/after screenshots against the design (light and dark) to follow in a comment.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Base automatically changed from free-group to dev November 30, 2026 08:51
Aarav Sareen added 2 commits November 30, 2026 14:22
The model picker lists the Console workspace's providers under one OpenCode header: the active account, a Go badge when the workspace has Go models, and, with several accounts, a menu that switches accounts the way Settings does, adds one, or opens OpenCode's accounts. OpenCode's own paid models sit right under the header, then a Go sub-heading and the workspace's other providers; free models stay last. The header's menu is reachable with Tab, as the picker's rows are no longer Tab stops.

No flag.
One OpenCode sign-in account still opens the picker's account menu, to add or manage accounts. The menu lists only sign-in accounts; API keys stay in Settings, and an active key shows no switcher.

No flag.

@opencodejr opencodejr Bot 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.

I found no blocking problems in the code, but I couldn't check it in the UI. The change is desktop/web-app UI only, it can't be driven through the TUI, and no Playwright browsers are available here, so I couldn't run the picker e2e or component tests. The before/after light and dark screenshots you mentioned will cover the visual side.

What I ran: all 346 unit tests in packages/app under src/providers/models, src/providers/connect and src/settings pass, including the new picker-sections.test.ts. tsc -b passes. Reading the code, "Manage accounts" enters the connect dialog's accounts step the same way picking OpenCode from the provider list does, "Add account" goes straight to sign-in, and later selections are unchanged. Free models are still only keyless opencode ones, so local zero-cost providers keep their own sections.

Public API: unchanged. The changes are app UI, a new optional accounts prop on DialogConnectProvider, and new English i18n keys.

No further concerns.

@arvsrn
arvsrn enabled auto-merge (squash) November 30, 2026 08:53
@arvsrn
arvsrn merged commit b17bcee into dev Nov 30, 2026
10 checks passed
@arvsrn
arvsrn deleted the account-switcher branch November 30, 2026 08:58
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.

1 participant