Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
gui: a provider editor's account rows end at one edge, their settings under ⋯
yetone18005c803973
diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.cssindex 0288006cc..464f52750 100644--- a/internal/gui/assets/app.css+++ b/internal/gui/assets/app.css@@ -2561,6 +2561,9 @@ body.window .ag-sk-icon { width: 22px; height: 22px; border-radius: 6px; }.accts { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }.acc { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 5px 8px 5px 11px; font-size: 12.5px; text-align: left; }.acc + .acc, .accts .signing { border-top: 1px solid var(--line-2); }+/* every row of the box ruled off from the one above it, a setting's too+ (the owner, 10-29: Add another sat unruled under Only switch) */+.accts > :is(.keep-login, .switch-only, .pool-ends) + .acc { border-top: 1px solid var(--line-2); }.editor .accts .keep-login, .editor .accts .switch-only, .editor .accts .pool-ends { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 34px; padding: 6px 11px; font-size: 12px; border-top: 1px solid var(--line-2); }.editor .accts .keep-login .keep-as { max-width: 240px; }.editor .accts .pool-ends .note { flex-basis: 100%; color: var(--fg-2); }@@ -2681,6 +2684,39 @@ body.window .ag-sk-icon { width: 22px; height: 22px; border-radius: 6px; }.acc .acct-user, .acc .acct-seat { color: var(--muted); font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.acc .acct-who .n { flex: 0 1 auto; }.acc .plan { flex: none; }+/* an account's first line (the owner, 10-29): its name gives way, never+ its place on the right, so First and Make first end every row at the+ same edge. What is set shows on it; the rest waits under ⋯ on a line+ of its own, so nothing on it takes room it doesn't show */+.acc-line { flex: 1 0 100%; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 22px; }+.acc-line > .plan { flex: 0 3 auto; min-width: 3em; overflow: hidden; text-overflow: ellipsis; }+.acc-line > :not(.acct-who, .n, .plan, .grow, .amodels, .acap, .alane, .text, .using) { flex-shrink: 0; }+.acc-line > .using, .acc-line > .text { white-space: nowrap; }+/* and only where even that is too narrow (a long German Make first beside+ a 240px row) the button's own words end in an ellipsis, last of all */+.acc-line > :is(.using, .text:not(.quiet)) { flex-shrink: .001; min-width: 0; overflow: hidden; text-overflow: ellipsis; }+.acc-line > .acct-who, .acc-line > .n { min-width: 4.5em; }+/* a signed-out account keeps both ways out on its line: where they don't+ fit beside the name they wrap under it, Remove still at the right end */+.acc.signed-out .acc-line { flex-wrap: wrap; row-gap: 4px; }+.acc.signed-out .acc-line > .text.quiet:last-child { margin-left: auto; }+.acc-line > :is(.amodels, .acap, .alane) { flex-shrink: .01; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+/* the pills sit closer to one another than to the name */+.acc-line > :is(.amodels, .acap, .alane) + :is(.amodels, .acap, .alane) { margin-left: -4px; }+/* a pill set when the row was drawn that is no longer (requests running+ that ended) takes no room till the row is drawn again */+.acc-line > :is(.amodels:not(.set), .acap:not(.set), .alane:not(.set)):not(.open):not(:focus-visible) { max-width: 0; padding-left: 0; padding-right: 0; margin-left: -9px; box-shadow: none; opacity: 0; }+/* ⋯: a hover brings it out, beside what ends the row */+.acc .acc-more { flex: none; display: inline-grid; place-items: center; width: 22px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: default; opacity: 0; transition: opacity .15s, background .12s, color .12s; }+.acc:hover .acc-more, .acc .acc-more:focus-visible, .acc.tools-open .acc-more { opacity: 1; }+.acc .acc-more:hover { color: var(--fg); background: var(--pill-hover); }+.acc.tools-open .acc-more { color: var(--fg); background: var(--pill); }+/* and its line, under the quota, lined up with it */+.acc .acc-tools { flex-basis: 100%; display: none; align-items: center; flex-wrap: wrap; gap: 6px; padding-left: 25px; min-width: 0; }+.acc.tools-open .acc-tools { display: flex; }+.acc .acc-tools > :is(.amodels, .acap, .alane, .text.quiet) { opacity: 1; }+/* Remove ends the line, and where the line wraps it ends the next */+.acc .acc-tools > .text.quiet { margin-left: auto; }/* a key's row (#841): what shows only on hover takes no room till then,so a key's weight never squeezes its name away; the room it takes onhover is the row's free room, else the masked key's, and the models@@ -2971,7 +3007,10 @@ body.window .ag-sk-icon { width: 22px; height: 22px; border-radius: 6px; }.sheet .custom-foot .custom:hover, .sheet .custom-foot .custom.on { background: var(--accent-soft); }.sheet .custom-foot .hint { font-size: 12px; color: var(--muted); }/* the provider editor, in a dialog */-.editor { padding: 16px 18px 14px; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px 14px; align-items: start; }+/* the label column is as wide as its longest label, so that label starts+ at the padding and the fields end the same way on the right (the+ owner, 10-29: a 72px column left the left edge twice the right) */+.editor { padding: 16px 18px 14px; display: grid; grid-template-columns: fit-content(132px) minmax(0, 1fr); gap: 10px 14px; align-items: start; }.editor .ehead { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 2px; border-bottom: 1px solid var(--line-2); }.editor .ehead .ic { width: 20px; height: 20px; }.editor .icon-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }@@ -2986,6 +3025,7 @@ body.window .ag-sk-icon { width: 22px; height: 22px; border-radius: 6px; }.editor .ehead b { font-weight: 600; }.editor .ehead .note { font-size: 12px; color: var(--muted); }.editor label { font-size: 12px; color: var(--fg-2); text-align: right; padding-top: 5px; }+.editor label.by-list { padding-top: 11px; }.editor .hint { font-size: 11px; color: var(--fg-2); margin-top: 4px; }/* a provider's own proxy (#237): the address beside the options, its roomkept while it is hidden so a pick never changes the dialog's height */@@ -3068,6 +3108,9 @@ body.window .ag-sk-icon { width: 22px; height: 22px; border-radius: 6px; }.editor .extra-body .why { font-size: 12px; line-height: 1.45; color: var(--red); overflow-wrap: anywhere; }.editor .extra-body .why:empty { display: none; }.segs { position: relative; display: inline-flex; padding: 2px; border-radius: 7px; background: var(--pill); align-self: flex-start; }+/* an editor's choices wrap where its sheet is narrow, never pushing the+ sheet into a sideways scroll (German Routing at the 560px window) */+.editor .segs { max-width: 100%; flex-wrap: wrap; }.opt { position: relative; z-index: 1; white-space: nowrap; height: 22px; padding: 0 10px; border-radius: 5px; font-size: 12px; color: var(--muted); transition: color .18s var(--ease), transform .14s var(--ease); }.opt.on { color: var(--fg); }/* how often magpie checks for updates, while it doesn't by itself */@@ -3875,6 +3918,7 @@ body.panel .modal { padding: 16px 12px; }/* nothing hovers on a phone: what a row shows on hover is shown, and akey's row gives it back the room it folds away till a hover (#841) */body.web .acc :is(.text.quiet, .proto, .amodels, .alane) { opacity: 1; }+ body.web .acc .acc-more { opacity: 1; }body.web .accts.keys .acc > :is(.amodels, .proto, .alane, .text.quiet) { max-width: none !important; padding: 0 7px !important; flex-shrink: 0 !important; }body.web .accts.keys .acc > .alane:not(.set) { margin-left: 0 !important; }body.web #gatewayKeys .acc > .key-quotas { max-width: none !important; padding: 0 7px !important; margin-left: 0 !important; flex-shrink: 0; }diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.jsindex bfb8426b6..c6579daff 100644--- a/internal/gui/assets/app.js+++ b/internal/gui/assets/app.js@@ -7540,7 +7540,7 @@ function partnerTile(pr) {let fieldIDs = 0;function field(label, control, hint) {- const l = el("label", "", label);+ const l = el("label", control.classList?.contains("accts") ? "by-list" : "", label); // on a list's first rowconst wrap = el("div");wrap.append(control);const inputSelector = "input, select, textarea";@@ -12266,6 +12266,7 @@ let signing = null; // the sign-in under way: { id, agent, url, state, installinconst stopSignIn = () => { if (signing?.id) api("signin/" + signing.id + "/cancel", {}).catch(() => {}); };const signingOpen = () => signing?.state === "waiting" || signing?.state === "installing";let justAdded = ""; // the account that just came in, to greet it+const accountToolsOpen = new Set(); // rows whose ⋯ is open// o: { user } signing that account in again, { proxy } the one picked to// sign in through (#1663): none picked, the one the account's requests go@@ -13179,10 +13180,16 @@ function renderAccounts(a, p) {dot.title = on ? t("Stop using this account") : t("Use this account too");dot.onclick = () => accountAction("login/" + (on ? "off" : "on"), { agent: a.agent, user: l.user });}- row.append(dot, accountNameButton(p, l.user), el("span", "plan", accountPlan({ agent: a.agent, builtin: a.builtin, plan: l.plan })));+ // one line, First or Make first at its right end (the owner, 10-29)+ const line = el("div", "acc-line");+ row.append(line);+ line.append(dot, accountNameButton(p, l.user), el("span", "plan", accountPlan({ agent: a.agent, builtin: a.builtin, plan: l.plan })));// its own models (#474), when there is another account to send the rest toconst [amPill, amBox] = ls.length > 1 || accountModelsOf(p, l.user).length ? accountModels(p, l.user, false, l.user) : [];- if (amPill) row.append(amPill);+ // what is set shows on it; the rest waits under ⋯ on a line below+ const tools = el("div", "acc-tools");+ const pill = (x) => (x.classList.contains("set") ? line : tools).append(x);+ if (amPill) pill(amPill);// its usage cap: the share of each window it is used to at mostconst cap = accountCapOf(p, l.user);// Claude Code or Codex signed in to it asks its vendor itself, not@@ -13190,76 +13197,90 @@ function renderAccounts(a, p) {// holds back only what goes through magpie (𝕏 on Discord: a 90% cap// and the five hours run to 100%)const direct = l.active && !several && (a.agent === "claude" || a.agent === "codex") ? a.agentName : "";- if (p) row.append(accountCapPill(p, l.user, cap, direct));+ if (p) pill(accountCapPill(p, l.user, cap, direct));// and each window's own, set on its meter (willz on Discord)const capFor = (w) => windowCapOf(p, l.user, w);// how many requests it has out at once, and waiting (#892)- if (p) row.append(laneLimitPill(p, l.user, p.id + "@" + String(l.user).toLowerCase(), l.user));+ if (p) pill(laneLimitPill(p, l.user, p.id + "@" + String(l.user).toLowerCase(), l.user));const held = capHeldOf(quota?.[l.user], capFor);- if (held) row.append(capHeldNote(held, held.cap, several, direct));- row.append(el("span", "grow"));+ if (held) line.append(capHeldNote(held, held.cap, several, direct));+ line.append(el("span", "grow"));if (unusable(l)) {row.classList.add("signed-out");- row.append(el("span", "using", t("Sign-in required")));+ line.append(el("span", "using", t("Sign-in required")));const again = el("button", "text", t("Sign in again"));again.onclick = () => startSignIn(a.agent, false, undefined, { user: l.user });- row.append(again);+ line.append(again);// the one Claude Code is signed in to can't be forgotten (ForgetLogin)if (!l.active) {- row.append(forgetOf());+ line.append(forgetOf());}} else if (signedOut(l)) {row.classList.add("signed-out");- row.append(el("span", "using", t("Sign-in required")));+ line.append(el("span", "using", t("Sign-in required")));const again = el("button", "text", t("Sign in again"));again.onclick = () => startSignIn(a.agent, false, againSite(l), { user: l.user });- row.append(again, forgetOf(true));+ line.append(again, forgetOf(true));} else if (l.active && kept && l.user !== firstUser) {// signed in to, kept so, and tried at its place in the orderconst signed = el("span", "using", l.paused ? t("Paused") : t("Signed in"));signed.title = t("{agent} is kept signed in to this account; requests through magpie go to the accounts in their order", { agent: a.agentName });- row.append(signed);- if (on) row.append(makeFirst(l));+ line.append(signed);+ if (on) line.append(makeFirst(l));} else if (l.active) {const using = el("span", "using", l.paused ? t("Paused") : back ? t("First for now") : several ? t("First") : t("In use"));if (back && !l.paused) using.title = t("{user} was nearly used up, so magpie signed {agent} in to this one; it goes back to {user} once that has room again", { user: back.user, agent: a.agentName });- row.append(using);+ line.append(using);if (a.agent === "qoder" || a.agent === "qoder-cn" || l.own) {- row.append(forgetOf(l.own));+ line.append(forgetOf(l.own));} else if (a.agent === "codex" && ls.length === 1) {// Codex's only account: no other to sign it in to first, so it is// signed out, as codex logout does (ForgetLogin)const out = el("button", "text quiet", t("Sign out"));out.title = t("Signs Codex out of this account, as codex logout does");out.onclick = () => askSignOutLogin(a, l);- row.append(out);+ line.append(out);} else if (a.agent === "codex") {// Codex is signed in to another of its accounts first, then this// one goes (ForgetLogin), rather than Codex signed out- row.append(forgetOf(t("Codex is signed in to another of its accounts, and magpie forgets this one; the account itself is untouched")));+ line.append(forgetOf(t("Codex is signed in to another of its accounts, and magpie forgets this one; the account itself is untouched")));}} else {const forget = forgetOf(true);if (l === back) {const again = el("span", "using", t("First again once it has room"));again.title = t("magpie signs {agent} back in to this account once it has room again", { agent: a.agentName });- row.append(again);+ line.append(again);}if (kept) {// the sign-in stays where it is kept: Make first is the order's,// and an account not in use is ticked on by its dot- row.append(forget);- if (l.user === firstUser) row.append(el("span", "using", t("First")));- else if (on) row.append(makeFirst(l));+ line.append(forget);+ if (l.user === firstUser) line.append(el("span", "using", t("First")));+ else if (on) line.append(makeFirst(l));} else {const use = el("button", "text", on ? t("Make first") : t("Use"));use.title = sub?.own ? t("The gateway uses this account first") : t("Sign {agent} in to this account", { agent: a.agentName });use.onclick = () => { use.classList.add("busy"); accountAction("login/switch", { agent: a.agent, user: l.user }, sub?.own ? t("The gateway now uses {user} first", { user: l.user }) : t("{agent} is now signed in as {user}", { agent: a.agentName, user: l.user })); };- row.append(forget, use);+ line.append(forget, use);}}row.append(accountQuota(l.lapsed ? { [l.user]: { error: t(l.lapsed) } } : quota, l.user, capFor, p ? (m, w) => windowCapMeter(m, p, l.user, w) : null));row.classList.add("with-aq"); // not :has(.aq), which Safari 15.0 lacks (#220)+ // Remove goes under ⋯ too, but beside Sign in again while signed out+ if (!row.classList.contains("signed-out")) tools.append(...line.querySelectorAll(":scope > .text.quiet"));+ if (tools.childElementCount) {+ const key = (p?.id || a.agent) + "@" + String(l.user).toLowerCase(), more = el("button", "acc-more");+ more.type = "button";+ more.append(svg(DOTS, 14, 2.4));+ more.title = t("Settings for {user}", { user: l.user });+ more.setAttribute("aria-label", more.title);+ const shown = (v) => { row.classList.toggle("tools-open", v); more.setAttribute("aria-expanded", v); v ? accountToolsOpen.add(key) : accountToolsOpen.delete(key); };+ shown(accountToolsOpen.has(key) || !!amBox);+ more.onclick = () => shown(!row.classList.contains("tools-open"));+ line.querySelector(".grow").after(more);+ row.append(tools);+ }if (amBox) row.append(amBox);list.append(row);}@@ -14056,6 +14077,9 @@ function laneText(pill) {if (pill.textContent !== text) pill.textContent = text;lanesTick ||= setInterval(refreshLanes, 2e3);pill.classList.toggle("set", own != null || limit + busy > 0);+ // set or running on its account's line, else under ⋯, not while open+ const row = pill.closest(".acc"), tools = row?.querySelector(".acc-tools"), line = row?.querySelector(".acc-line"), on = pill.classList.contains("set");+ if (tools && line && !pill.classList.contains("open") && pill !== document.activeElement && pill.parentElement === (on ? tools : line)) on ? line.querySelector(".grow").before(pill) : tools.insertBefore(pill, tools.querySelector(".text.quiet"));pill.classList.toggle("busy-lane", !!(limit && busy >= limit));pill.classList.toggle("queued", !!waiting);const whose = own != null ? t("its own") : t("the provider's");diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.jsindex a4c91ba9f..a0eb4cc74 100644--- a/internal/gui/assets/i18n.js+++ b/internal/gui/assets/i18n.js@@ -2239,6 +2239,7 @@ const I18N = {"Edit as JSON": "以 JSON 编辑","Collapse to one line": "折叠为单行","Remove": "移除",+ "Settings for {user}": "{user} 的设置","Web pages": "网页","Web page origin": "网页来源","Web pages that may call magpie": "允许调用 magpie 的网页",@@ -6343,6 +6344,7 @@ const I18N = {"Edit as JSON": "以 JSON 編輯","Collapse to one line": "摺疊為單行","Remove": "移除",+ "Settings for {user}": "{user} 的設定","Web pages": "網頁","Web page origin": "網頁來源","Web pages that may call magpie": "允許呼叫 magpie 的網頁",@@ -10426,6 +10428,7 @@ const I18N = {"Edit as JSON": "JSON で編集","Collapse to one line": "1行に折りたたむ","Remove": "削除",+ "Settings for {user}": "{user} の設定","Web pages": "Web ページ","Web page origin": "Web ページのオリジン","Web pages that may call magpie": "magpie を呼び出せる Web ページ",@@ -14539,6 +14542,7 @@ const I18N = {"Edit as JSON": "Als JSON bearbeiten","Collapse to one line": "Auf eine Zeile reduzieren","Remove": "Entfernen",+ "Settings for {user}": "Einstellungen für {user}","Web pages": "Webseiten","Web page origin": "Herkunft der Webseite","Web pages that may call magpie": "Webseiten, die magpie aufrufen dürfen",diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.goindex 523a78183..8a24bd0f4 100644--- a/internal/gui/core_budget_test.go+++ b/internal/gui/core_budget_test.go@@ -16,7 +16,7 @@ import (// raises them and says why in its commit.const (appScriptBudget = 1_311_735 // app.js: 1,198,239 after Usage left (P2); 1,218,098 with the 10-15 fixes to pages still in the core; 1,232,466 with the provider editor's Advanced fold and every dialog holding its place, the core's own (10-16); 1,250,533 with the quota refresh kept through redraws, the core's own since the tray panel draws it too, plus 1.5% (#2397); 1,269,083 with Free first's option in the provider editor's ROUTINGS, which the Routing page reads too, plus 1.5%; 1,272,726 with the Providers page drawing its last list at once (#1519), the core's page, and the Routing trace's account names read without Object.entries (#1481), plus 1.5%; a dialog growing out of the row that opened it and folding back into it, the core's own since every page's dialogs open through it (10-20); Codex's and Claude Code's own settings moved from Settings into the agent's row on the Agents page, the core's own since the tray panel and the window both draw them (10-20); 1,314,432 with Settings › Privacy's record of what was masked (its summary, the records view and the local model's controls), which belongs to Settings, the core's own, plus 1.5%; 1,336,481 with a provider's Names & levels saying Provider in model names is Settings' and opening it there (joe), and Settings' Image recognition saying where a custom provider's model is marked (nexnull), both in the core's own pages, with no room added (10-23); 1,337,633 with Settings › Models › Replies' Intent classifier timeout (#2934, reyoung), Settings' own row, drawn by waitRow, which the Image generation timeout's row now shares, with no room added; 1,337,735 with the provider editor's link naming a partner's page by its own host (siteHost) instead of usemagpie.ai's /go link, the core's own editor, with no room added (10-23); 1,338,084 with Check in now saying what the press came to (claimed +credits, already today, not available yet) where it said "refreshed" (#3326), the check-in row the tray panel draws too, the core's own, with no room added (10-23); 1,338,929 with a new partner's tile keeping a small dot until it is opened, in the add sheet, the core's own, with no room added (10-23); 1,343,324 with the sidebar's open-page row marked by one shape that moves on a spring (navTopGo), the window's own shell, which every page sits beside, with no room added (10-23); 1,343,465 with a dialog kept centred while its content comes in, until it is pressed (holdModal, every page's dialogs), the core's own, with no room added (10-24); 1,317,486 with what masking did moved out to Insights › Masking (plugins/redact), the budget lowered to it (10-24); 1,321,336 with Codex's one subagent model, its card's square saying plainly what each choice does and a row with a name in its sheet, where two squares read alike (the owner), the Agents page's, which the tray panel draws too, the core's own, with no room added (10-24); 1,321,424 with Settings › Models' Image generation MCP server row beside Image recognition's (JonahFu on X), the two drawn by one helper (mcpRow), Settings' own, with no room added (10-25); 1,321,994 with a provider of the user's set never to rest for a limit (zoecats), the provider editor's Advanced row, the core's own editor, with no room added (10-25); 1,322,289 with Settings › Privacy's Keep a key's form under Mask secrets (Charles Cao on X), Settings' own row, with no room added (10-25); 1,322,537 with no Codex squares beside its named settings rows (the owner), with no room added (10-25); 1,323,401 with the tray panel drawing its last allowances at once and asking for them beside the state (#3160, #3134), the tray panel's, the core's own, and the 4 bytes 84c50f032 added, with no room added (10-25); 1,326,105 with many releases' notes merged into one list by kind, each line with its version (the owner), in the update sheet and What's new, with no room added (10-25); 1,321,319 with Settings › Observability moved out to its plugin (plugins/otel/page.js) and its Langfuse setup there (an X user), the budget lowered to it (10-26); a quota card whose window is used but names no reset no longer saying "Not used yet" (windy on Discord) raised it to 1,321,347, and back to 1,321,319 with Settings' model pickers sharing one row helper (modelOpt) where six kept their own copy, no raise (10-26); 1,325,845 with every slow page's skeletons getting magpie's bird hopping bar to bar (skelBird, the owner after the Plugins page's README), one bird for the window over whatever page or dialog is loading, the core's own, with no room added (10-26); 1,310,129 with Settings › Network and sharing's gateway rows (its port, bare ids, local network, allowed addresses, web pages) moved out to the gateway plugin (plugins/gateway/settings.js), the budget lowered to it (10-27); 1,310,269 with Test models naming the first model that failed and its error in the status line, where it said only how many (ysm119 on Discord), the provider editor's, the core's own, with no room added (10-27); 1,310,460 with Settings › About's Website row linking usemagpie.ai (the owner), Settings' own row, with no room added (10-27); 1,309,669 with a pool's Stop at the caps and Check usage near a cap ticks under a provider's accounts (plugins#349), the core's own editor, its account rows' Remove and add rows each drawn by one helper (forgetOf, addRow), with no room added (10-28); 1,311,681 with Install another agent on the Agents page naming the agents Plugins has (More in Plugins) and opening Plugins at its Agents (the owner), the Agents page's, the core's own, with no room added (10-28); 1,311,735 with More in Plugins in sight while Install another agent is folded (the owner), with no room added (10-29); 1,313,704 with a window whose WebKit scrolls under wheels it never tells of (macOS 13) remembered once seen, a scroll at rest then waiting 120ms for a second the same way within 80ms before it is put back, kept for a late wheel to give back (waitsBack), and a load landing under the wheel keeping the reader's way (backAfterLoad, issennknight), the window's own scroll guard, with no room added (10-29); back to 1,311,735 with Settings › Models › Web search's rows (renderSearch, renderSearcher, the search APIs' keys) moved out to the search plugin (plugins/search/settings.js), app.js 1,292,527 after it, not lowered further since what is left plus 1.5% is over it (#4133, 10-29)- coreScriptBudget = 1_530_861 // every core script: 1,358,034 after Usage left; 1,380,003 with them; 1,405,937 with the fold; 1,426,102 with 10-16's core work (the GitHub list loading, the move to plugins, Settings › Long conversations), plus 1.5% (#2612); 1,447,368 with loadBack, the window's one state read per return, which every page needs and so is the core's own (1,446,845 before it, 155 bytes under), plus 1.5%; OpenCode Zen's card saying OpenCode tells no key its balance adds ~390 bytes inside it; 1,472,589 with the dialog that grows out of its row and the agents' own settings in their rows, on main's 10-20 core work (the Providers page's last list, the Routing trace's names), plus 1.5% (10-20); 1,506,192 with Settings › Privacy's record of what was masked, plus 1.5%; 1,529,393 with the Intent classifier timeout row (#2934), with no room added; 1,529,495 with the editor's partner link host, with no room added; 1,529,844 with Check in now's press summary (#3326), with no room added; 1,530,689 with the new partner tile's dot, with no room added; 1,535,084 with the sidebar's spring, with no room added; 1,549,478 with the context window card's map (tiles by tokens, the default look, the block grid a switch away) and its text view showing an inline image, in context.js, which the Routing page draws as well as Usage, so the core's own, with no room added (10-24); 1,550,768 with a usage card's refresh opening after its text (#840's card, which the tray panel draws too), the Add key spinner, and a dialog kept centred while its content comes in, with no room added (10-24); 1,524,789 with what masking did moved out to Insights › Masking, lowered to it; 1,528,525 with Codex's one subagent model, with no room added (10-24); 1,528,972 with the Image generation MCP server row (JonahFu on X), with no room added (10-25); 1,529,542 with the limit-rest row (zoecats), with no room added (10-25); 1,529,837 with Keep a key's form (Charles Cao on X), with no room added (10-25); 1,530,050 with no Codex squares beside its named settings rows (the owner), with no room added (10-25); 1,530,631 with a plugin's page growing to its README on the dialog's spring instead of in one jump (the owner), the Plugins page's, in plugins.js, with no room added (10-25); 1,533,445 with the context map counting its tokens on as a live request grows, a tile pointed at keeping its tip, a tool's gathered results saying how many and the small files their folder (the owner, after flohoeller's map on X), in context.js, which the Routing page draws as well as Usage, and the 4 bytes 84c50f032 added to app.js (Settings' Version row) without a raise, with no room added (10-25); 1,534,312 with the tray panel's last allowances drawn at once (#3160, #3134), with no room added (10-25); 1,537,016 with many releases' notes merged into one list by kind (the owner), in app.js, with no room added (10-25); 1,542,244 with a plugin's README loading under magpie's bird bouncing down its lines instead of pulsing bars (the owner), the Plugins page's, in plugins.js, with no room added (10-26); 1,542,418 with a page plugin's sidebar tab coming and going as it is installed, switched on or off, or removed, instead of on the Plugins page's next load (the owner), in plugins.js, with no room added (10-26); 1,537,645 with Settings › Observability moved out to plugins/otel, lowered to it (10-26); 1,537,673 with a used window with no reset not "Not used yet" (windy on Discord), and back to 1,537,645 with Settings' model pickers sharing modelOpt (10-26); 1,541,967 with every slow page's skeletons getting magpie's bird (skelBird, the owner), in app.js, the README's bird sharing its drawing and styles, with no room added (10-26); 1,526,251 with Settings' gateway rows moved out to plugins/gateway/settings.js, lowered to it (10-27); 1,526,391 with Test models naming the first failed model and its error (ysm119 on Discord), in app.js, with no room added (10-27); 1,526,556 with About's Website row (the owner), in app.js, with no room added (10-27); 1,526,500 with a pool's cap ticks (plugins#349), in app.js, with no room added (10-28); 1,527,245 with About's Open-source licenses row and dialog (the owner), in app.js, with no room added (10-28); 1,528,076 with the Partners heading's light (the owner), in app.js, with no room added (10-28); 1,530,449 with Install another agent's More in Plugins row (the owner), in app.js, and Plugins opening at its Agents, in plugins.js, with no room added (10-28); 1,530,807 with layout.js measuring the scrollbar into --bar, which every page's right padding takes off so its sides match (the owner), the window's own shell, with no room added (10-28); 1,530,861 with More in Plugins in sight while Install another agent is folded (the owner), in app.js, with no room added (10-29); 1,532,830 with waitsBack and backAfterLoad (issennknight, macOS 13), the window's own scroll guard, in app.js, with no room added (10-29); the context map's tile wording (a4e929212) and Cindy's Add magpie (628ac36fc) had taken the core over it, and Web search's rows moved out to plugins/search/settings.js brought it back to 1,530,861 (#4133, 10-29)+ coreScriptBudget = 1_532_459 // every core script: 1,358,034 after Usage left; 1,380,003 with them; 1,405,937 with the fold; 1,426,102 with 10-16's core work (the GitHub list loading, the move to plugins, Settings › Long conversations), plus 1.5% (#2612); 1,447,368 with loadBack, the window's one state read per return, which every page needs and so is the core's own (1,446,845 before it, 155 bytes under), plus 1.5%; OpenCode Zen's card saying OpenCode tells no key its balance adds ~390 bytes inside it; 1,472,589 with the dialog that grows out of its row and the agents' own settings in their rows, on main's 10-20 core work (the Providers page's last list, the Routing trace's names), plus 1.5% (10-20); 1,506,192 with Settings › Privacy's record of what was masked, plus 1.5%; 1,529,393 with the Intent classifier timeout row (#2934), with no room added; 1,529,495 with the editor's partner link host, with no room added; 1,529,844 with Check in now's press summary (#3326), with no room added; 1,530,689 with the new partner tile's dot, with no room added; 1,535,084 with the sidebar's spring, with no room added; 1,549,478 with the context window card's map (tiles by tokens, the default look, the block grid a switch away) and its text view showing an inline image, in context.js, which the Routing page draws as well as Usage, so the core's own, with no room added (10-24); 1,550,768 with a usage card's refresh opening after its text (#840's card, which the tray panel draws too), the Add key spinner, and a dialog kept centred while its content comes in, with no room added (10-24); 1,524,789 with what masking did moved out to Insights › Masking, lowered to it; 1,528,525 with Codex's one subagent model, with no room added (10-24); 1,528,972 with the Image generation MCP server row (JonahFu on X), with no room added (10-25); 1,529,542 with the limit-rest row (zoecats), with no room added (10-25); 1,529,837 with Keep a key's form (Charles Cao on X), with no room added (10-25); 1,530,050 with no Codex squares beside its named settings rows (the owner), with no room added (10-25); 1,530,631 with a plugin's page growing to its README on the dialog's spring instead of in one jump (the owner), the Plugins page's, in plugins.js, with no room added (10-25); 1,533,445 with the context map counting its tokens on as a live request grows, a tile pointed at keeping its tip, a tool's gathered results saying how many and the small files their folder (the owner, after flohoeller's map on X), in context.js, which the Routing page draws as well as Usage, and the 4 bytes 84c50f032 added to app.js (Settings' Version row) without a raise, with no room added (10-25); 1,534,312 with the tray panel's last allowances drawn at once (#3160, #3134), with no room added (10-25); 1,537,016 with many releases' notes merged into one list by kind (the owner), in app.js, with no room added (10-25); 1,542,244 with a plugin's README loading under magpie's bird bouncing down its lines instead of pulsing bars (the owner), the Plugins page's, in plugins.js, with no room added (10-26); 1,542,418 with a page plugin's sidebar tab coming and going as it is installed, switched on or off, or removed, instead of on the Plugins page's next load (the owner), in plugins.js, with no room added (10-26); 1,537,645 with Settings › Observability moved out to plugins/otel, lowered to it (10-26); 1,537,673 with a used window with no reset not "Not used yet" (windy on Discord), and back to 1,537,645 with Settings' model pickers sharing modelOpt (10-26); 1,541,967 with every slow page's skeletons getting magpie's bird (skelBird, the owner), in app.js, the README's bird sharing its drawing and styles, with no room added (10-26); 1,526,251 with Settings' gateway rows moved out to plugins/gateway/settings.js, lowered to it (10-27); 1,526,391 with Test models naming the first failed model and its error (ysm119 on Discord), in app.js, with no room added (10-27); 1,526,556 with About's Website row (the owner), in app.js, with no room added (10-27); 1,526,500 with a pool's cap ticks (plugins#349), in app.js, with no room added (10-28); 1,527,245 with About's Open-source licenses row and dialog (the owner), in app.js, with no room added (10-28); 1,528,076 with the Partners heading's light (the owner), in app.js, with no room added (10-28); 1,530,449 with Install another agent's More in Plugins row (the owner), in app.js, and Plugins opening at its Agents, in plugins.js, with no room added (10-28); 1,530,807 with layout.js measuring the scrollbar into --bar, which every page's right padding takes off so its sides match (the owner), the window's own shell, with no room added (10-28); 1,530,861 with More in Plugins in sight while Install another agent is folded (the owner), in app.js, with no room added (10-29); 1,532,830 with waitsBack and backAfterLoad (issennknight, macOS 13), the window's own scroll guard, in app.js, with no room added (10-29); the context map's tile wording (a4e929212) and Cindy's Add magpie (628ac36fc) had taken the core over it, and Web search's rows moved out to plugins/search/settings.js brought it back to 1,530,861 (#4133, 10-29); 1,532,459 with a provider editor's account rows on one line each, First or Make first at its right end and the settings that aren't set under ⋯ (the owner), the core's own editor, in app.js, which stays in its budget with its comments cut down, with no room added (10-29))func TestCoreScriptBudget(t *testing.T) {diff --git a/internal/gui/tests/account-cap.test.cjs b/internal/gui/tests/account-cap.test.cjsindex bd4d74609..af89423af 100644--- a/internal/gui/tests/account-cap.test.cjs+++ b/internal/gui/tests/account-cap.test.cjs@@ -2,7 +2,7 @@// A subscription account can be used up to a share of each usage window// only — a new Claude account kept to 70% of its five hours and its week,// asked on Discord to lower the risk of a ban. Its row has a pill: a capped-// one says its cap, always shown; one without says No cap, on hover. A+// one says its cap, always shown; one without says No cap, under its ⋯. A// click opens the app's own menu of shares (no native select): a share, No// cap, or Other… for one typed in place, each posted to provider/accountcap// with the account and the cap (0: none). Each meter the cap counts has a@@ -143,15 +143,17 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.equal(await pill(page, "[email protected]").evaluate((e) => getComputedStyle(e).opacity), "1");assert.equal(await row(page, "[email protected]").locator(".acap-held").textContent(), w.held);assert.deepEqual(await row(page, "[email protected]").locator(".aq-cap").evaluateAll((ms) => ms.map((m) => m.style.left)), ["70%", "70%"]);- // the spare has none: No cap on hover only, no note, no mark+ // the spare has none: No cap under its ⋯ only, no note, no markassert.equal(await pill(page, "[email protected]").textContent(), w.none);await page.mouse.move(0, 0);await page.waitForTimeout(250);- assert.equal(await pill(page, "[email protected]").evaluate((e) => getComputedStyle(e).opacity), "0");+ assert.equal(await pill(page, "[email protected]").isVisible(), false);assert.equal(await row(page, "[email protected]").locator(".acap-held, .aq-cap").count(), 0);// the spare's pill opens the app's menu; 80% is postedawait row(page, "[email protected]").hover();+ await still(page, "[email protected]", row(page, "[email protected]").locator(".acc-more"));+ assert.equal(await pill(page, "[email protected]").isVisible(), true);await still(page, "[email protected]", pill(page, "[email protected]"));await menu(page).waitFor();assert.equal(await menu(page).locator(".pm-head").textContent(), w.menu);diff --git a/internal/gui/tests/account-models.test.cjs b/internal/gui/tests/account-models.test.cjsindex 3847a5ac2..683ab067f 100644--- a/internal/gui/tests/account-models.test.cjs+++ b/internal/gui/tests/account-models.test.cjs@@ -2,7 +2,7 @@// Each account of a subscription, and each key, can be kept for some of the// provider's models only (#474: 增加账号级别的模型选项). Its row has a badge:// one kept for some says how many, always shown; one serving every model-// says All models, on hover. A click opens the provider's models under the+// says All models, under its ⋯. A click opens the provider's models under the// row as chips; Save posts provider/accountmodels with the account (or the// key's id) and the models picked, All models posts none. A click moves// nothing and the page stays where it is. A subscription with one account@@ -123,23 +123,30 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.equal(await row(page, id).evaluate((e) => Math.round(e.getBoundingClientRect().top)), before, `${id}'s row moved`);assert.equal(await scrolled(page), sc, "a click scrolled");};+ // an unset badge waits under its row's ⋯+ const reveal = async (page, id) => {+ if (await pill(page, id).isVisible()) return;+ await row(page, id).hover();+ await row(page, id).locator(".acc-more").click();+ };const posted = async (posts, n) => {for (let i = 0; i < 60 && posts.length === n; i++) await new Promise((r) => setTimeout(r, 50));return posts.at(-1);};test(`${engine} ${lang}: a Codex account is kept for some models, and given all again`, async (t) => {- const { page, errors, posts } = await open(t, "Codex", ".editor .accts .acc .amodels");- // the one kept for gpt-6-mini says so, always; the other says All models on hover only+ const { page, errors, posts } = await open(t, "Codex", ".editor .accts .acc .amodels.set");+ // the one kept for gpt-6-mini says so, always; the other says All models under ⋯ onlyassert.equal(await pill(page, "[email protected]").textContent(), w.one);assert.equal(await pill(page, "[email protected]").getAttribute("title"), w.only);assert.equal(await pill(page, "[email protected]").evaluate((e) => getComputedStyle(e).opacity), "1");assert.equal(await pill(page, "[email protected]").textContent(), w.all);await page.mouse.move(0, 0);await page.waitForTimeout(250);- assert.equal(await pill(page, "[email protected]").evaluate((e) => getComputedStyle(e).opacity), "0");+ assert.equal(await pill(page, "[email protected]").isVisible(), false);// me: the provider's models it serves agents, none picked; Save waits for one+ await reveal(page, "[email protected]");await still(page, "[email protected]", pill(page, "[email protected]"));assert.deepEqual(await chips(page, "[email protected]"), ["gpt-6", "gpt-6-mini"]);const save = panel(page, "[email protected]").getByRole("button", { name: w.save, exact: true });@@ -208,7 +215,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",};test(`${engine} ${lang}: the editor's Save saves an account's unsaved picks first`, async (t) => {- const { page, errors, posts } = await open(t, "Codex", ".editor .accts .acc .amodels");+ const { page, errors, posts } = await open(t, "Codex", ".editor .accts .acc .amodels.set");await pill(page, "[email protected]").click();await panel(page, "[email protected]").locator(".mchip", { hasText: /^gpt-6$/ }).click();assert.deepEqual(await chips(page, "[email protected]"), ["gpt-6*", "gpt-6-mini*"]);@@ -225,6 +232,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",test(`${engine} ${lang}: the editor's Save saves a key's unsaved picks first`, async (t) => {const { page, errors, posts } = await open(t, "Relay", ".editor .accts .acc");await row(page, "bbbbbbbbbb").hover();+ await reveal(page, "bbbbbbbbbb");await pill(page, "bbbbbbbbbb").click();await panel(page, "bbbbbbbbbb").locator(".mchip", { hasText: "Cheap one" }).click();const n = posts.length;@@ -235,7 +243,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",});test(`${engine} ${lang}: a picker with every model unpicked holds the editor's Save`, async (t) => {- const { page, errors, posts } = await open(t, "Codex", ".editor .accts .acc .amodels");+ const { page, errors, posts } = await open(t, "Codex", ".editor .accts .acc .amodels.set");await pill(page, "[email protected]").click();await panel(page, "[email protected]").locator(".mchip", { hasText: "gpt-6-mini" }).click();const n = posts.length;diff --git a/internal/gui/tests/account-row-line.test.cjs b/internal/gui/tests/account-row-line.test.cjsnew file mode 100644index 000000000..8bc290c06--- /dev/null+++ b/internal/gui/tests/account-row-line.test.cjs@@ -0,0 +1,125 @@+// Run with Node's test runner and Playwright on the module path; see README.md.+// A provider editor's accounts (the owner, 10-29: Make first sat alone on a+// line under the name, a band of hover pills took room they didn't show,+// and the sheet's left edge was twice its right). Each account's first+// line ends with what it is (First) or what it does (Make first) at the+// same right edge, on one line; nothing on it takes room it doesn't show,+// so its quota sits right under it. Its settings (models, cap, requests at+// once) and its Remove wait under ⋯, on a line of their own that ⋯ opens+// and closes; one that is set stays on the first line. The sheet's two+// edges match in the app, its scroll bar counted in. Every row of the accounts box is+// ruled off from the one above. In every language, at the window's+// narrowest and in a phone's browser. MAGPIE_ACC_ASSETS runs it on older+// assets.+const assert = require("node:assert/strict");+const fs = require("node:fs/promises");+const path = require("node:path");+const { test } = require("node:test");+const { chromium, webkit } = require("playwright");++const assets = path.resolve(process.env.MAGPIE_ACC_ASSETS || path.resolve(__dirname, "../assets"));+const claude = () => ({+ id: "claude", name: "Claude Code", icon: "claude-color", chat: "", responses: "", anthropic: "", catalog: "", routing: "",+ models: [{ id: "claude-opus-5-5", name: "Claude Opus 5.5", on: true }], agents: [], fallback: [], headers: {}, keyList: [],+ account: {+ agent: "claude", agentName: "Claude Code", user: "[email protected]", plan: "team",+ logins: [+ { user: "[email protected]", org: "Example", plan: "team", active: true, on: true },+ { user: "[email protected]", plan: "max", on: true },+ { user: "[email protected]", plan: "pro", on: true },+ ],+ },+ accountCaps: { "[email protected]": 70 },+});+const serve = (lang, web) => async (route) => {+ const url = new URL(route.request().url());+ const json = (data) => route.fulfill({ json: data });+ if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:${JSON.stringify(lang)},theme:"dark",web:${web}};` });+ if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });+ if (url.pathname === "/api/state") return json({ agents: [], profiles: [], settings: { lang, theme: "dark" } });+ if (url.pathname === "/api/providers") return json({ providers: [claude()], presets: [], excluded: [], gateway: { running: true, window: true } });+ if (url.pathname === "/api/groups") return json({ groups: [] });+ if (url.pathname === "/api/plugins") return json({ plugins: [] });+ if (url.pathname === "/api/login/usage") return json({+ "[email protected]": { windows: [{ label: "5h", used: 10, limit: 100 }, { label: "Weekly", used: 20, limit: 100 }] },+ "[email protected]": { error: "unavailable" },+ "[email protected]": { windows: [{ label: "5h", used: 30, limit: 100 }] },+ });+ if (url.pathname.startsWith("/api/")) return json({});+ const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname);+ const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];+ try { await route.fulfill({ body: await fs.readFile(file), contentType }); } catch { await route.fulfill({ status: 404, body: "" }); }+};++// each first line: its height, how far its last child ends from its+// right, and what on it is there but drawn at no width or not at all+const lines = (page) => page.evaluate(() => [...document.querySelectorAll(".editor .accts .acc")].filter((r) => r.dataset.accountId).map((r) => {+ const line = r.querySelector(".acc-line") || r, b = line.getBoundingClientRect();+ const kids = [...line.children].filter((c) => !c.classList.contains("grow"));+ const last = kids[kids.length - 1].getBoundingClientRect();+ const hidden = kids.filter((c) => { const k = c.getBoundingClientRect(), s = getComputedStyle(c); return k.width > 1 && (+s.opacity === 0 || s.visibility === "hidden") && !c.classList.contains("acc-more"); }).map((c) => c.className);+ const q = r.querySelector(".aq")?.getBoundingClientRect();+ return { who: r.dataset.accountId, h: Math.round(b.height), right: Math.round(b.right - last.right) + 0, hidden, last: kids[kids.length - 1].textContent, gap: q ? Math.round(q.top - b.bottom) : 0 };+}));++const langs = ["en", "zh", "zh-TW", "ja", "de"];+for (const [engine, browserType] of [["chromium", chromium], ["webkit", webkit]]) {+ test(engine + ": an account's first line ends at one edge, its settings under ⋯", async (t) => {+ const browser = await browserType.launch();+ t.after(() => browser.close());+ for (const [web, width] of [[false, 1000], [false, 560], [true, 390]]) for (const lang of langs) {+ const at = `${lang} ${web ? "web " : ""}${width}`;+ const context = await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: "reduce" });+ const page = await context.newPage();+ await page.route("**/*", serve(lang, web));+ await page.goto("http://magpie.test/?view=providers");+ await page.locator(".row.provider", { hasText: "Claude Code" }).first().click();+ const rows = page.locator(".editor .accts .acc[data-account-id]");+ await rows.nth(2).waitFor();+ await page.mouse.move(1, 1);+ const scrollY = await page.evaluate(() => document.querySelector(".modal .ebody")?.scrollTop ?? 0);++ for (const l of await lines(page)) {+ assert.equal(l.right, 0, `${at}: ${l.who}'s line ends with what ends it`);+ assert.deepEqual(l.hidden, [], `${at}: nothing on ${l.who}'s line takes room it doesn't show`);+ // one line: the tallest thing on it, a phone's touch-sized button+ assert.ok(l.h <= (web ? 48 : 24), `${at}: ${l.who}'s line is one line (${l.h}px)`);+ assert.ok(l.gap <= 8, `${at}: ${l.who}'s quota sits under its line (${l.gap}px)`);+ }+ const [first, spare, capped] = await lines(page);+ assert.ok(first.last.length && spare.last.length, `${at}: First and Make first end their lines`);+ // a cap that is set stays on the line, beside the name+ assert.equal(await rows.nth(2).locator(".acc-line > .acap.set").count(), 1, `${at}: a set cap stays on its line`);+ assert.equal(capped.right, 0);++ // ⋯ opens the settings line, and closes it+ const more = rows.nth(1).locator(".acc-more");+ const tools = rows.nth(1).locator(".acc-tools");+ assert.equal(await tools.isVisible(), false, `${at}: the settings wait under ⋯`);+ await rows.nth(1).hover();+ await more.click();+ assert.equal(await more.getAttribute("aria-expanded"), "true");+ for (const sel of [".amodels", ".acap", ".alane", ".text.quiet"]) assert.ok(await tools.locator(sel).isVisible(), `${at}: ⋯ shows ${sel}`);+ const tb = await tools.boundingBox(), lb = await rows.nth(1).locator(".acc-line").boundingBox();+ assert.ok(tb.y >= lb.y + lb.height, `${at}: the settings are on a line of their own`);+ assert.ok(tb.x + tb.width <= lb.x + lb.width + 1, `${at}: the settings line stays in the row`);+ await more.click();+ assert.equal(await tools.isVisible(), false, `${at}: ⋯ closes them`);+ assert.equal(await page.evaluate(() => document.querySelector(".modal .ebody")?.scrollTop ?? 0), scrollY, `${at}: a click moves nothing`);++ // every row of the box ruled off from the one above+ const unruled = await page.evaluate(() => [...document.querySelectorAll(".editor .accts > *")].slice(1).filter((x) => x.offsetHeight && parseFloat(getComputedStyle(x).borderTopWidth) < 1).map((x) => x.className));+ assert.deepEqual(unruled, [], `${at}: every row is ruled off`);++ // the sheet doesn't scroll sideways, and in the app, whose scroll bar+ // magpie draws, its edges match (a phone's bar takes no room)+ const m = await page.evaluate(() => {+ const body = document.querySelector(".modal .ebody"), b = body.getBoundingClientRect(), cs = getComputedStyle(body);+ return { wide: body.scrollWidth - body.clientWidth, left: parseFloat(cs.paddingLeft), right: b.right - body.getBoundingClientRect().left - body.clientWidth - parseFloat(cs.borderLeftWidth) + parseFloat(cs.paddingRight), bar: body.offsetWidth - body.clientWidth };+ });+ assert.ok(m.wide <= 0, `${at}: the sheet doesn't scroll sideways (${m.wide}px)`);+ if (!web && m.bar > 0) assert.ok(Math.abs(m.left - m.right) <= 1, `${at}: its left edge ${m.left}px, its right ${m.right}px`);+ await context.close();+ }+ });+}diff --git a/internal/gui/tests/codex-signout.test.cjs b/internal/gui/tests/codex-signout.test.cjsindex b8a0c4086..5fcee7284 100644--- a/internal/gui/tests/codex-signout.test.cjs+++ b/internal/gui/tests/codex-signout.test.cjs@@ -70,11 +70,15 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",return { page, errors, posts };};+ // an account's Remove and Sign out wait under its ⋯+ const more = async (row) => { await row.hover(); if (await row.locator(".acc-more").count()) await row.locator(".acc-more").click(); };+test(`${engine} ${lang}: Codex's only account signs out, asked first`, async (t) => {const { page, errors, posts } = await open(t, one);const top = await page.evaluate(() => document.scrollingElement.scrollTop);const row = page.locator(".editor .acc", { hasText: "[email protected]" });const out = row.getByRole("button", { name: w.out, exact: true });+ await more(row);assert.equal(await out.count(), 1, "the only account has Sign out");assert.ok(await out.getAttribute("title"));@@ -118,6 +122,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",const { page, errors, posts } = await open(t, two);for (const user of ["[email protected]", "[email protected]"]) {const row = page.locator(".editor .acc", { hasText: user });+ await more(row);assert.equal(await row.getByRole("button", { name: w.out, exact: true }).count(), 0, user);}const remove = page.locator(".editor .acc", { hasText: "[email protected]" }).getByRole("button", { name: w.remove, exact: true });@@ -142,6 +147,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",test(`${engine} ${lang}: a refusal says what to do, in the reader's language`, async (t) => {const { page, errors } = await open(t, one, true);+ await more(page.locator(".editor .acc", { hasText: "[email protected]" }));await page.locator(".editor .acc", { hasText: "[email protected]" }).getByRole("button", { name: w.out, exact: true }).click();const ask = page.locator("#modal .forget-ask");await ask.getByRole("button", { name: w.out, exact: true }).click();diff --git a/internal/gui/tests/lane-limit.test.cjs b/internal/gui/tests/lane-limit.test.cjsindex b9922f81e..eeb782bab 100644--- a/internal/gui/tests/lane-limit.test.cjs+++ b/internal/gui/tests/lane-limit.test.cjs@@ -4,7 +4,7 @@// routing group and agent. Its row has a pill: what runs and waits under// it while requests are out (the gateway's lanes, read again every two// seconds and written into the pill in place), else its limit; a row with-// none says so on hover only. A click opens the app's own menu (no native+// none says so under the account's ⋯ only. A click opens the app's own menu (no native// select): the provider's, no limit, a number, or Other… typed in place,// each posted to provider/accountconcurrency. The editor has the queue's// length and wait under Concurrency, saved with it and refused when not a@@ -103,7 +103,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",await page.route("**/*", serve(lang, posts, lanes));await page.goto("http://magpie.test/?view=providers");await page.locator(".row.provider", { hasText: name }).first().click();- await page.locator(".editor .accts .acc .alane").first().waitFor();+ await page.locator(".editor .accts .acc .alane").first().waitFor({ state: "attached" });await page.waitForTimeout(300);return { page, errors, posts };};@@ -128,6 +128,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",return posts.at(-1);};const opacity = (l) => l.evaluate((e) => getComputedStyle(e).opacity);+ // an account's unset settings wait under its ⋯+ const more = async (page, id) => { await row(page, id).hover(); await row(page, id).locator(".acc-more").click(); };test(`${engine} ${lang}: a key's limit on requests at once shows what runs and waits, and is set from the app's menu`, async (t) => {const lanes = { now: { "relay#k1": { busy: 1, waiting: 2, limit: 1 } }, reads: 0 };@@ -189,7 +191,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.deepEqual(errors, []);});- test(`${engine} ${lang}: an account's own limit is shown, and one with none only on hover`, async (t) => {+ test(`${engine} ${lang}: an account's own limit is shown, and one with none only under ⋯`, async (t) => {const lanes = { now: {}, reads: 0 };const { page, errors, posts } = await open(t, "Codex", lanes);assert.equal(await pill(page, "[email protected]").textContent(), w.four);@@ -197,10 +199,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",await page.mouse.move(0, 0);await page.waitForTimeout(250);assert.equal(await opacity(pill(page, "[email protected]")), "1");- assert.equal(await opacity(pill(page, "[email protected]")), "0", "none set: on hover only");- await row(page, "[email protected]").hover();+ assert.equal(await pill(page, "[email protected]").isVisible(), false, "none set: under ⋯ only");+ await more(page, "[email protected]");await page.waitForTimeout(250);assert.equal(await opacity(pill(page, "[email protected]")), "1");+ assert.equal(await pill(page, "[email protected]").isVisible(), true);await still(page, "[email protected]", pill(page, "[email protected]"));const n = posts.length;await item(page, "2").click();@@ -219,7 +222,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.equal(await me.textContent(), w.running);await page.mouse.move(0, 0);await page.waitForTimeout(250);- assert.equal(await opacity(me), "1", "running: shown without a hover");+ assert.equal(await me.isVisible(), true, "running: shown on its line, ⋯ closed");+ assert.equal(await me.evaluate((e) => e.parentElement.classList.contains("acc-line")), true);// the rest of the row's pill look, no colour of a full laneassert.equal(await me.evaluate((e) => e.classList.contains("busy-lane") || e.classList.contains("queued")), false);const el = await me.elementHandle();@@ -228,7 +232,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.equal(await me.textContent(), w.none);assert.equal(await el.evaluate((e) => e.isConnected), true, "the same pill, rewritten in place");await page.waitForTimeout(250);- assert.equal(await opacity(me), "0", "idle with no limit: on hover only again");+ assert.equal(await me.isVisible(), false, "idle with no limit: under ⋯ again");assert.equal(await pill(page, "[email protected]").textContent(), w.four);assert.deepEqual(errors, []);});diff --git a/internal/gui/tests/own-signin-remove.test.cjs b/internal/gui/tests/own-signin-remove.test.cjsindex f309d58a9..ddc974b4f 100644--- a/internal/gui/tests/own-signin-remove.test.cjs+++ b/internal/gui/tests/own-signin-remove.test.cjs@@ -60,6 +60,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",return { page, errors };};+ // an account's Remove waits under its ⋯+ const more = async (row) => { await row.hover(); if (await row.locator(".acc-more").count()) await row.locator(".acc-more").click(); };+test(`${engine} ${lang}: kiro-cli's own sign-in behind another can be removed, hidden`, async (t) => {const posts = [];const { page, errors } = await open(t, [@@ -67,6 +70,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",{ user: "Kiro account", plan: "KIRO FREE", on: true, own: true },], posts);const mine = page.locator(".accts .acc", { hasText: "[email protected]" });+ await more(mine);+ await more(page.locator(`.accts .acc[data-account-id="Kiro account"]`));assert.equal(await mine.getByRole("button", { name: remove[lang], exact: true }).count(), 0, "the first of magpie's has no Remove");const own = page.locator(".accts .acc", { hasText: "Kiro account" }).getByRole("button", { name: remove[lang], exact: true });assert.equal(await own.getAttribute("title"), title[lang]);@@ -81,6 +86,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",test(`${engine} ${lang}: kiro-cli's own sign-in in use first can be removed too`, async (t) => {const posts = [];const { page, errors } = await open(t, [{ user: "Kiro account", plan: "KIRO FREE", active: true, on: true, own: true }], posts);+ await more(page.locator(`.accts .acc[data-account-id="Kiro account"]`));const own = page.locator(".accts .acc", { hasText: "Kiro account" }).getByRole("button", { name: remove[lang], exact: true });assert.equal(await own.getAttribute("title"), title[lang]);await own.click();