feat(shell): multi-account quick-switch UI (slice 3, PR 3/3)#117
Merged
Conversation
The user-facing payoff for slice 3. The Account section now surfaces the persisted account roster: - Authenticated card gains a "Switch to" list of the OTHER saved accounts (active one stays the hero), each with Switch + Remove. Switch sets the active account and reboots the sidecar into it (same write-then-reboot poll as gh-reuse); a 422 (token no longer valid) is caught pre-reboot and shown inline. Remove forgets maximal's own copy (gh untouched), no reboot. - Unauthenticated screen shows "Switch to a remembered account" when other accounts remain (e.g. after signing out of one) — above the gh-reuse list. - Reuses the .gh-account list rows, status dots, btn--sm, and the ambient busy bar; new CSS is just .account-roster, .gh-account__actions, and a quiet .btn--ghost-destructive (built to .design-context.md via a design-skill spec — list-not-cards, destructive token for Remove, reduced-motion: no new transitions). - api.ts: accounts-list/switch/remove endpoints + AccountsListResponse. LIFECYCLE DECISION (supersedes the earlier "sign-out keeps the copy" rec): Sign out FORGETS the active account's credential (PR1 behaviour, the secure default for a credential store); Switch is the bounce-between-accounts path (no re-auth); Remove is the explicit per-account forget. No backend change. Shell tsc clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PR 3 of 3 — the user-facing finale of slice 3 (multi-account persistence + quick-switch), on top of #115 (store) and #116 (routes). Shell UI for the account roster.
rebootAndAwaitAuthhelper — the write-then-reboot poll loop extracted fromuseGhAccountper/simplify, now shared by gh-reuse and switch). A 422 (token no longer valid for Copilot) is caught before the reboot and shown inline. Remove forgets maximal's own copy (gh untouched), no reboot..gh-accountlist rows, status dots,btn--sm, and the ambient busy bar; new CSS is just.account-roster,.gh-account__actions, and a quiet destructive.btn--ghost-destructive. Built to a design-skill spec against.design-context.md(list-not-cards, destructive token for Remove, reduced-motion = no new transitions).api.ts:accounts-list/switch/removerequest kinds +AccountsListResponse.Lifecycle decision (flag for veto)
Sign out FORGETS the active account's credential (the secure default for a credential store; matches PR 1's backend, no change). Switch is the bounce-between-accounts path (no re-auth); Remove is the explicit per-account forget. This supersedes the earlier "sign-out keeps the copy" design rec — for a credential manager, sign-out not forgetting the token is surprising. Easy to flip if you'd rather keep-on-signout.
Verification (per the goal's UX-inspection directive)
/settings/api/**): DOM logic 7/7 PASS (roster excludes the active account, 2 rows with Switch+Remove, hero correct; unauthenticated remembered-list shows all 3). Vision PASS at both real window widths — 900px (default) and 600px (the window's hardmin_inner_size): no wrap, host on its own line, clean two-button alignment, Remove reads as the quieter destructive action. (An initial 520px "overflow" finding was a false positive — 520px is below the 600px window minimum and unreachable in production; theflex: 1 1 0tweak is kept as a defensive correctness improvement.)maximal authCLI run alongside the sidecar and loses a recoverable account entry, not credentials).bun test850 pass / 0 fail;check:fastclean; shelltscclean.Stacked on #116 (merged); branched from main.