ac4af582301a4e8a29245dbba767eba31334ddf9
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a7b47d57ec |
accounts: removing the account Claude Code is signed in to switches it to another first (#4532)
StringKe (#4532): removing the signed-in Claude account was refused with SignedInError, while Codex's switched away first. ForgetLogin now does the same for Claude Code: nextOnForget picks another account (on first, then one whose sign-in holds), SwitchLogin signs Claude Code in to it, and only then is this one forgotten. If that switch fails, nothing is removed and the error says why. nextOnForget leaves out accounts Claude Code or Codex can't be signed in to (switchable: not a setup-token account, not a Codex account held in another folder). Claude Code is never signed out: when the account is the only one it can be signed in to, it is kept, with SignedInError{Only} (GUI code signed_in_only), which says to add another account first or sign out in Claude Code. The GUI gives the signed-in Claude row a Remove when another account it can use exists, and no Remove or Sign out otherwise. Claude Code's own credential is never deleted; forgetClaudeDir removes only the forgotten account's own folder and its folder's Keychain item, and claudeHolders' check of other records holding the same token is unchanged. Tests: TestForgetLiveClaudeSwitchesFirst, TestForgetOnlyClaudeIsKept (replacing TestClaudeInUseStillRefused, which held the old refusal); codex-signout.test.cjs gets three Claude cases (Remove with another; only + setup-token: no Remove, reason in zh/zh-TW/ja/de; the signed_in_only refusal in en/zh). Run (mote, sandbox HOME through the test helpers): - go test ./internal/provider ./internal/cli, vet and gofmt at the stack head: in the next commit's body (one tree, same run). - Broken by hand, each red: Claude not switched first (TestForgetLiveClaudeSwitchesFirst), Only left false, a setup-token account counted as another, nextOnForget unfiltered (TestForgetOnlyClaudeIsKept). - GUI on Linux (WSL magpie-desktop), Chromium and WebKit: codex-signout, own-signin-remove, saved-signedout-remove, login-import, claude-signin, account-alias and i18n-keys all pass but i18n-keys' "a plugin's words are its own", red on main (#4524). On mote, codex-signout passed in Chromium; its WebKit launches were killed with mote at load ~25 under other sessions' suites (#4125), so WebKit's record is Linux's. CLI in a sandbox HOME (WSL, file credentials): forget of the signed-in account by its name switched Claude Code to the other (.claude.json then says max@x.com); forget of the only one was refused with the message above and left it signed in. Not tried: a real Claude Code switch on removal with real accounts, or in the CLI against a live ~/.claude (sandbox only). |
||
|
|
ce8b67de37 |
gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called page.goto with no timeout of its own, so Playwright held the first load of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a busy box (a whole-suite run at load 130-160) that load took longer and goto timed out. The same pattern is in 988 GUI test files (1174 pages): every one of them now also sets setDefaultNavigationTimeout(60000) on the same page, right after its default, so goto, reload and waitForURL wait on the load itself with room, while clicks and waits keep their short bar. group-from-model-add's own 20s navigation bar is raised to the same minute. claude-switch-only also gives its first provider row (drawn from the page's first reads) a minute before clicking it. nav-timeout.test.cjs (no browser) reads every GUI test file and names each page given a default under a minute without a navigation timeout of at least a minute, so a new file can't bring the pattern back. What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from other sessions): - node --check on every file in internal/gui/tests: all parse. - nav-timeout.test.cjs against origin/main's test files: red (names the 1174 pages); against this tree: its only reds were my own probe copies of the old files, since removed. - By hand: claude-switch-only with app.js served 7s late (a busy box's first load), --test-name-pattern "1100 en": origin/main's file 4 of 4 red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green. - claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420: 32 of 32. group-from-model-add, usage-access-key-card and i18n-keys: green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red on a 5s waitForFunction at line 115 (a wait after load, not the navigation), at load ~230. Not tried: the whole GUI suite (about 1000 files; the change is one mechanical line per page), Windows or mote (mote's browsers, #4125). |
||
|
|
18005c8039 |
gui: a provider editor's account rows end at one edge, their settings under ⋯
The owner, 10-29, on Claude Code's editor sheet: its left and right edges
weren't the same, Make first sat alone on a line under the name, and a
band of hover pills took room it didn't show.
Each account row is now a line (dot, name, plan, what is set, then the
status and First or Make first at the right end) and the quota under it.
The settings that aren't set (models, usage cap, requests at once) and
Remove or Sign out wait under ⋯ on a line of their own, which ⋯ opens and
closes. The editor remembers that per row across redraws. A set pill stays
on the line, and a lane pill moves between them as its account starts or
stops running, but not while its menu or box is open. A signed-out
account keeps Sign in again and Remove on its line, wrapping under the
name where they don't fit. The editor's label column fits its labels,
a list's label stands on its first row, every row of the accounts box is
ruled off from the one above, and in the web layout ⋯ is always shown. New
string "Settings for {user}" is in all five languages.
core_budget_test: app.js stays in its budget (1,311,731, comments cut
down). The core's scripts go to 1,532,459. Main had 233 bytes of room
there, so the budget is raised to the exact size with no room added,
as the 10-28/29 editor entries did.
Run (on mote, at this tree, rebased on
|
||
|
|
2cc663d0a2 |
gui: protect unsaved edits and confirm destructive actions (#820)
* gui: edited forms ask before they are discarded, removals ask before they take effect, and the header keeps its first layout — Cancel, Escape, the backdrop and a page change could throw away a provider's draft, and several account, key, plugin and library removals took effect at once. Modified provider, settings, library and routing forms now ask before discarding; unmodified forms still close without asking, and refresh or closing the browser tab uses its leave confirmation. Removal and discard confirmations are in-app dialogs over the intact editor, centered, with Cancel focused first, Tab kept inside, Escape canceling and focus returned afterwards; destructive buttons have readable foregrounds in light and dark themes. Text and connection settings have Save/Cancel rather than saving on blur; simple switches still save at once. Editors associate labels and help with fields, make the background inert while open and keep focus through redraws; navigation keeps browser back/forward history and its current-page state, errors remain until dismissed or replaced, and focus and validation can scroll into view. Mobile settings tabs have larger targets, fields use 16px text and page zoom stays available. layout.js applies mode and platform before the header paints, theme.js applies the saved text size before styles, and mode-specific window controls stay hidden while app.js downloads. zh/ja/de strings added. routing-shape's global .rt-day selector selected the hidden By session button on WebKit; its history click now stays in .rt-days. ux-safety covers unchanged and modified closes, canceled and confirmed removals, Escape, backdrop, modal focus, light/dark centering and button contrast, explicit saves, browser history and sync-form discard. Rebased onto upstream/main |
||
|
|
4c35c1b8e6 |
provider, gui: removing the Codex account in use signs Codex in to another of its accounts first, rather than leaving it signed out (vincentzhang1_55530 on Discord)
Removing a Team account beside a Plus one left Codex at its sign-in screen. ForgetLogin now switches Codex to the next saved account (nextOnForget: the first on, else one whose sign-in still holds, else any other) as Use would, then forgets the removed one; only the last account is still signed out as codex logout does. The accounts list gives the account in use a Remove when there are others. TestCodexSignOutLastAccount and TestCodexLogins fail without the change (SignedInError); codex-signout.test.cjs covers the new Remove in English and Chinese. |
||
|
|
43a6595035 |
provider, gui: Codex's only account can be signed out from its row, as codex logout does, and removing the account Codex is on while another is saved says what to do, in the reader's language (mamba on Discord) — removing Codex's only account failed with "codex is signed in to <user> now; switch to another account first", with no other account to switch to, and Providers › Codex › Sign out hit the same error, as it forgets the account in use last. ForgetLogin on the account Codex is signed in to, with no other Codex account saved, now signs Codex out as codex logout does: ~/.codex/auth.json is deleted, magpie forgets the account and drops what it served (magpie only knows file-stored Codex sign-ins, liveLogin reads auth.json, and the keychain is never touched); one signed in but not saved yet is signed out the same way. With another saved it is still refused, now as a SignedInError ("Codex is signed in to <user> now: sign it in to another of its accounts first (Use on that account), then remove this one"), which /api answers with code signed_in, the agent and the user, and app.js says in en/zh/ja/de. The only Codex account's row in its editor has Sign out (退出登录), asked in the app's own dialog, whose Cancel, Escape and backdrop go back to the editor and send nothing (closeConfirmAsk follows a dialog's back), then posts login/forget; the removed-provider Sign out dialog for Codex says Codex itself is signed out too. Claude Code keeps the refusal: its sign-in may be in the keychain, which magpie never touches, and magpie serves its saved accounts while it is signed out (claudeStandIn) and treats its /logout apart (claudeLoggedOut). TestCodexSignOutLastAccount (refused with another saved, auth.json kept; signed out when the last; an unsaved sign-in signed out; an unknown account still an error), TestForgetAccountSignsCodexOut (fails without the change with mamba's error) and TestClaudeInUseStillRefused are new; codex-signout.test.cjs (WebKit, en and zh: the button and its title, the dialog, Cancel and Escape post nothing and go back to the editor, the post and its status, no Sign out with two accounts, the translated refusal, no select, no left border, no scroll) fails without the change. The account-*, own-signin-remove, saved-signedout-remove, reset-reminder and click-scroll tests pass in WebKit; Chromium wouldn't launch on this machine. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
|