Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

gui: Settings descriptions wrap instead of ending in … (arculongus on Discord)

yetone208bd5c48baf
diff --git a/docs/subsystems/gateway-routing.md b/docs/subsystems/gateway-routing.md
index bc6fe1bc9..4f346b141 100644
--- a/docs/subsystems/gateway-routing.md
+++ b/docs/subsystems/gateway-routing.md
@@ -481,7 +481,7 @@ A searcher named in Settings gives way to no other provider. Its error goes
back to the model, and `webSearch` then asks the search APIs, when any are
set up. `namedFailed` keeps the last search it didn't make, cleared when it
next searches. Settings › Web search shows that (`SearcherFailed`,
-`searchFailed`) at the start of the row's help, ahead of its ellipsis.
+`searchFailed`) at the start of the row's help, which wraps whole.
Gearclickist on Discord picked Grok. Their grok-4.7 rows were about 1.3k
tokens, the size of a request Grok ran no search for (one that searched
took 6k-66k on our account). Every search then went on to Codex's
diff --git a/docs/subsystems/gui-shell.md b/docs/subsystems/gui-shell.md
index 2f3c4cb1a..91c7405a3 100644
--- a/docs/subsystems/gui-shell.md
+++ b/docs/subsystems/gui-shell.md
@@ -368,6 +368,7 @@ covers it in both engines, every language and a narrow window.
### Shared UI rules
- Settings → General is laid out as macOS System Settings is (1ooogle on X): a row says its name alone when that says enough (Appearance, Colorblind mode, Language, Text size, the fonts, the tray click, Open at login, Show in Dock), and keeps one short line where the setting isn't clear from its name or has a consequence (Lightweight mode, Prevent sleep, Session terminal). Codex's and Claude Code's own settings (Codex subagents, Long conversations, background compaction, thread titles and descriptions, composer predictions, the auto-review and memories models) aren't here: they are in the agent's opened row on the Agents page (`AGENT_PREFS`, `connectPanel`), the panel's row has a Settings line that opens them in a sheet (`openAgentPrefs`), as does the agent's menu, and Settings' search finds them with a row that opens that sheet (`#agentPrefLinks`). Each row is one element moved between its places, so its handlers and state go with it (the owner, 10-20; `agent-prefs.test.cjs`). Long conversations is the exception with no Codex or Claude Code here, in gateway mode or a magpie in Docker: it sets the windows the gateway serves, which agents on other computers read, so it stays in General (`renderAgentPrefLinks`, Linka on Discord). A font row's line shows only while its fonts load or fail; the text size keys are the choices' tooltip, and Colorblind mode's note is its Off/On control's (`#colorblindSegs`). Colorblind mode (`settings.Colorblind`, `data-colorblind="1"` on `:root`, #2073) switches the chart series (`--c1`…`--c7`) in both light and dark themes to an Okabe–Ito palette where adjacent series differ in hue and lightness. On a quota curve each window (`data-series`, its index mod 7, set by `drawQuotaPlot` and `quotaCurve`'s legend only) gets a dash of its own on `path.qc-line`, its legend key shows a sample of that line (`.qc-sample`) for the dot, and the even paces (`line.qc-even`) are dotted; the curve's tooltip says so. The balance curve sets no `data-series` and keeps its solid line, dashed fit and dot. The Context tab's "good" grade, which takes `--c2` as a colour rather than a series, keeps a blue (`--c1`). Language is one menu button showing the language picked, opened in the app's menu (`renderLangPick`). See `settings-general.test.cjs` and `quota-curve.test.cjs`. Open at login reads `autostart.Enabled`, which on macOS 13 and later also asks Background Task Management about magpie's launch agent (`SMAppService.statusForLegacyURL:`, matched by the plist's Label, not its path); a record the user switched off in System Settings › General › Login Items reads as needing allowing, and the row keeps On with one line saying so and a button that opens Login Items (`/api/open` allows that one `x-apple.systempreferences` URL). The status read again when the window comes back to the front clears the line. On macOS 12, in a build without cgo, or when the system can't be asked, the plist alone decides, as before (#2120, `login-allow.test.cjs`, `login_allow_test.go`).
+- A setting row's line under its name (`.row.pref .sub`, in Settings, Plugins › Built-in and an agent's own settings) wraps whole beside its control, never cut to one line with an ellipsis (arculongus on Discord, `settings-lines-wrap.test.cjs`).
- Settings' search-provider picker offers **Off**, saved as `searcher: "off"`. Its help explains API-only search and suppresses provider fallback/own-search hints while off; the search priority row is hidden because no provider competes with the APIs. See [gateway search behavior](gateway-routing.md#turning-provider-search-off), [`renderSearcher`](../../internal/gui/assets/app.js), `TestSettingsSearchProviderOff` and `searcher-pick.test.cjs`.
- Settings' search APIs are asked in their listed order: each API's row (with its keys' row) is dragged as one, or moved with Alt+↑/↓, and has a switch that turns it off without removing its key (#2286). See [the search APIs' order](gateway-routing.md#the-search-apis-order-and-one-switched-off), `searchArrange` in [`app.js`](../../internal/gui/assets/app.js) and `search-order.test.cjs`.
- Settings' Search APIs add row has a base URL field under the key for every API (#1580): the vendor's own address is its placeholder, picking an API already added fills in its saved URL so a new key alone keeps it, and Add with no key changes only the URL. See [a search API's base URL](gateway-routing.md#a-search-apis-base-url), [`renderSearch`](../../internal/gui/assets/app.js) and `search-api.test.cjs`.
diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css
index 9b8a868ca..fa472c37e 100644
--- a/internal/gui/assets/app.css
+++ b/internal/gui/assets/app.css
@@ -3346,7 +3346,10 @@ img.nav-ic { border-radius: 3px; object-fit: contain; }
one-line rows, which min-height centred (the owner, 10-22) */
.row.pref, body.window .row.pref { min-height: 48px; padding: 12px 12px 12px 14px; gap: 14px; }
.row.pref .who { flex: 1 1 auto; }
-.row.pref .sub { margin-top: 2px; color: var(--fg-2); }
+/* a setting's line under its name is read whole, wrapped beside the control
+ it explains: one line cut with an ellipsis hid what the setting does
+ (arculongus on Discord, 10-25) */
+.row.pref .sub { margin-top: 2px; color: var(--fg-2); white-space: normal; overflow-wrap: anywhere; }
.row.pref.font-row { flex-wrap: wrap; gap: 8px 14px; }
.font-row .who { flex-basis: 160px; }
.font-row .font-note { white-space: normal; }
diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js
index ef4a12c58..0e0bb8d0a 100644
--- a/internal/gui/assets/app.js
+++ b/internal/gui/assets/app.js
@@ -21657,7 +21657,7 @@ function renderSearcher(s, keep, box) {
// the one named didn't search last time, and no other provider searched
// in its place (Gearclickist on Discord: Grok picked answered without
// searching, and Codex's pricier model searched instead, unasked). First,
- // so the one-line help's ellipsis doesn't hide it.
+ // so it reads before the help.
const failed = s.searchFailed;
if (!off && v && !s.searchUnused && failed) {
const why = failed.notSearched ? t("it answered without searching the web, so its account or plan may not offer web search") : failed.nothingFound ? t("its reply named no page it found") : failed.why || t("it failed");
diff --git a/internal/gui/tests/connect-address-kept.test.cjs b/internal/gui/tests/connect-address-kept.test.cjs
index aeca56f6a..4e9bcc647 100644
--- a/internal/gui/tests/connect-address-kept.test.cjs
+++ b/internal/gui/tests/connect-address-kept.test.cjs
@@ -2,7 +2,7 @@ const assert = require("node:assert/strict");
const { test } = require("node:test");
const { chromium, webkit } = require("playwright");
const { fixture } = require("./fixtures/caller-keys.cjs");
-const { openPart } = require("./reader.cjs");
+const { openPart, reach } = require("./reader.cjs");
// coeo91 on Discord: the LAN address picked as Gateway's Base URL went back
// to 127.0.0.1 after a restart or an update. The address and the gateway key
@@ -62,6 +62,10 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await page.locator("#prefs").click();
await openPart(page, "network");
await page.locator("#lanList .lan-address-row").waitFor();
+ // wheeled to as a reader would: the rows above, their lines wrapped
+ // whole (arculongus on Discord), put it below a narrow window, and
+ // Playwright's own scroll to it is undone, its menu opened out of sight
+ await reach(page, page.locator("#lanList .lan-interface"));
await pick("#lanList .lan-interface", "10.0.0.10");
await page.reload();
await page.locator("#prefs").click();
diff --git a/internal/gui/tests/member-model-setting.test.cjs b/internal/gui/tests/member-model-setting.test.cjs
index 23d43f185..6481ef291 100644
--- a/internal/gui/tests/member-model-setting.test.cjs
+++ b/internal/gui/tests/member-model-setting.test.cjs
@@ -9,7 +9,7 @@ const fs = require("node:fs/promises");
const path = require("node:path");
const { test } = require("node:test");
const { chromium, webkit } = require("playwright");
-const { watchSettingsReads, settingsDrawn } = require("./reader.cjs");
+const { watchSettingsReads, settingsDrawn, reach } = require("./reader.cjs");
const assets = path.resolve(__dirname, "../assets");
const words = {
@@ -59,12 +59,15 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await settingsDrawn(page); // rows found are the ones that stay (#1659)
const row = page.locator("#replyList #memberModelRow");
await row.waitFor();
- await row.scrollIntoViewIfNeeded();
assert.equal(await row.locator(".name").textContent(), w.name);
assert((await row.locator(".sub").textContent()).includes(w.sub));
assert.equal(await page.locator("#replyList").evaluate((l) => l.previousElementSibling.textContent.trim()), w.head);
const on = row.locator(".segs button", { hasText: w.on });
assert.notEqual(await on.getAttribute("aria-pressed"), "true", "Off at first");
+ // wheeled to as a reader would: the app puts back a scroll it didn't
+ // get from the reader (scrollIntoViewIfNeeded), and with Settings'
+ // lines wrapped whole the row is below the window's foot
+ await reach(page, on);
const before = await page.evaluate(() => [scrollX, scrollY, document.scrollingElement.scrollTop]);
const b = await on.boundingBox();
diff --git a/internal/gui/tests/mobile-web.test.cjs b/internal/gui/tests/mobile-web.test.cjs
index 46016de93..5c9e07ba2 100644
--- a/internal/gui/tests/mobile-web.test.cjs
+++ b/internal/gui/tests/mobile-web.test.cjs
@@ -370,6 +370,14 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await current.locator("#claudeLeanRow").evaluate((r) => r.remove());
await current.waitForTimeout(350);
}
+ // A setting row's line wraps whole (arculongus on Discord):
+ // until BASE_REF has that, the page is compared with the lines
+ // held to one line as they were; settings-lines-wrap.test.cjs
+ // covers the wrapping.
+ if (view === "settings" && !baselineFile("app.css").includes("arculongus")) {
+ await current.addStyleTag({ content: ".row.pref .sub { white-space: nowrap; overflow-wrap: normal; }" });
+ await current.waitForTimeout(350);
+ }
const before = PNG.sync.read(await still(original));
const after = PNG.sync.read(await still(current));
const sameSize = before.width === after.width && before.height === after.height;
diff --git a/internal/gui/tests/reader.cjs b/internal/gui/tests/reader.cjs
index 055dff9ae..ee8aecb23 100644
--- a/internal/gui/tests/reader.cjs
+++ b/internal/gui/tests/reader.cjs
@@ -46,7 +46,10 @@ async function reach(page, locator) {
const v = await page.locator("#" + id).boundingBox();
await page.mouse.move(v.x + v.width / 2, v.y + v.height / 2);
let stalls = 0;
- for (let i = 0; i < 120; i++) {
+ // 20px a wheel: 120 of them reached only 2,400px down, and once Settings'
+ // lines wrapped whole (arculongus on Discord) Allowances' last account
+ // was further than that at 420px. The view's end stops it sooner.
+ for (let i = 0; i < 400; i++) {
// found and read in one call (evaluateAll): locator.evaluate finds the
// control in one call and reads it in the next, and a part the page
// draws again in between (Routing's account rows, a row whose numbers
diff --git a/internal/gui/tests/searcher-pick.test.cjs b/internal/gui/tests/searcher-pick.test.cjs
index c073a5539..c342b8454 100644
--- a/internal/gui/tests/searcher-pick.test.cjs
+++ b/internal/gui/tests/searcher-pick.test.cjs
@@ -14,8 +14,9 @@
// keeps the pick (prefsKeep). No click moves the page. English and Chinese, Chromium and
// WebKit, with the API faked. Search help covers costs for every provider and
// explains current eligibility without claiming a provider can never search.
-// The help is also checked in Japanese and German, preserving desktop ellipsis
-// and hover titles as well as the existing narrow-web layout.
+// The help is also checked in Japanese and German, wrapped whole beside the
+// picker at every width (arculongus on Discord: cut with an ellipsis on the
+// desktop, it couldn't be read; settings-lines-wrap.test.cjs).
const assert = require("node:assert/strict");
const fs = require("node:fs/promises");
const path = require("node:path");
@@ -368,19 +369,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
});
assert(layout.clipped <= 1 && layout.fits, JSON.stringify(layout));
const sub = row.locator(".sub");
- assert.equal(await sub.getAttribute("class"), "sub", "copy changes must not opt into wrapping");
- if (width === 1000) {
- assert.equal(layout.whiteSpace, "nowrap", "desktop help stays on one line");
- assert.equal(layout.textOverflow, "ellipsis");
- assert(layout.overflow > 0, "long help is truncated");
- await sub.hover();
- const full = await sub.evaluate((e) => e.textContent.replace(/\s+/g, " ").trim());
- assert.equal(await sub.getAttribute("title"), full, "hover exposes the complete updated help");
- assert.equal(await sub.getAttribute("data-full-tip"), full);
- } else {
- assert.equal(layout.whiteSpace, "normal", "retain the existing narrow-web layout");
- assert(layout.overflow <= 1, JSON.stringify(layout));
- }
+ assert.equal(await sub.getAttribute("class"), "sub", "every setting row's line wraps, with no class of its own to opt in");
+ assert.equal(layout.whiteSpace, "normal", "the help wraps");
+ assert(layout.overflow <= 1, JSON.stringify(layout));
if (process.env.ARTIFACT_DIR) {
await fs.mkdir(process.env.ARTIFACT_DIR, { recursive: true });
await row.screenshot({ path: path.join(process.env.ARTIFACT_DIR, `${engine}-${lang}-${theme}-${width}-search-help.png`) });
diff --git a/internal/gui/tests/settings-general.test.cjs b/internal/gui/tests/settings-general.test.cjs
index 3a6358a3b..4967b541f 100644
--- a/internal/gui/tests/settings-general.test.cjs
+++ b/internal/gui/tests/settings-general.test.cjs
@@ -6,7 +6,8 @@
// 1000px and 440px, in both engines, on a Mac (the Dock and Session terminal
// rows show only there), with the API faked:
// - the rows whose names say enough have no line under them, and the lines
-// kept are each one line, not cut short on a wide window;
+// kept are never cut short, one line each on a wide window (narrower,
+// they wrap whole beside the control: arculongus on Discord);
// - Codex's and Claude Code's own settings aren't here: they are on the
// agents' rows (the owner, 10-20);
// - Language is a button (never a native <select>) showing the language;
@@ -100,8 +101,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.equal(await page.locator("#view-settings :is(#codexAgentsV1Row, #codexAsyncRow, #codexTitlesRow, #codexDescriptionsRow, #codexPredictionsRow, #codexAutoReviewRow, #codexMemoriesRow)").count(), 0, "an agent's own settings are on its row");
for (const [sel, sub] of rows.kept) {
assert.equal(typeof sub, "object", `${sel}: ${sub}`);
- assert.ok(sub.text.trim() && sub.lines <= 1, `${sel}: ${JSON.stringify(sub)}`);
- if (width === 1000) assert.equal(sub.cut, false, `${sel}'s line is cut short: ${sub.text}`);
+ assert.ok(sub.text.trim(), `${sel}: ${JSON.stringify(sub)}`);
+ if (width === 1000) assert.ok(sub.lines <= 1, `${sel} takes more than one line: ${JSON.stringify(sub)}`);
+ assert.equal(sub.cut, false, `${sel}'s line is cut short: ${sub.text}`);
}
assert.equal(rows.stripes, 0, "a row has a stripe down its left");
assert.equal(rows.sideways, false, "the page scrolls sideways");
diff --git a/internal/gui/tests/settings-lines-wrap.test.cjs b/internal/gui/tests/settings-lines-wrap.test.cjs
new file mode 100644
index 000000000..712ea3b8f
--- /dev/null
+++ b/internal/gui/tests/settings-lines-wrap.test.cjs
@@ -0,0 +1,135 @@
+// Run with Node's test runner and Playwright on the module path; see README.md.
+// arculongus on Discord: on Settings many rows' lines under their names
+// ended in "…" and couldn't be read: Image generation's ChatGPT note, the
+// Image recognition MCP server, Web search's Searches for other models. A
+// row with a control on its right held its line to one line, cut with an
+// ellipsis (`.row .sub`), while rows that had opted out (`.wraps`) wrapped.
+// Now every setting row's line wraps beside its control. In the window (not
+// browser mode, which wrapped at a phone's width already), in every
+// language, at 1000px and 440px, in both engines, on every part of Settings
+// and on Plugins › Built-in (the same rows):
+// - no row's line is cut: each is as wide as its words, with no ellipsis;
+// - the row's control stays inside the row, at its own width, and the page
+// doesn't scroll sideways.
+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 { watchSettingsReads, settingsDrawn, openPart } = require("./reader.cjs");
+
+const assets = path.resolve(process.env.MAGPIE_WRAP_ASSETS || path.join(__dirname, "../assets"));
+
+function settings(lang) {
+ return {
+ theme: "light", lang, tray: "panel", currency: "usd", textSize: 100, proxy: "", proxyNow: "none", proxySource: "none",
+ redact: true, redactPersonal: true, redactWords: [], version: "0.1.400", dir: "~/.config/magpie", gateway: "http://127.0.0.1:3425",
+ lanURLs: [], searchVendors: [], searchAPIs: [], vision: "", imageGen: "",
+ visionModels: [{ id: "codex/gpt-5", name: "GPT-5", provider: "codex", providerName: "Codex" }],
+ // a ChatGPT account draws, so Image generation has its second note
+ imageGenAuto: "codex/gpt-image-2",
+ imageGenModels: [{ id: "codex/gpt-image-2", name: "GPT Image", provider: "codex", providerName: "Codex", icon: "openai", vendorPicks: true }],
+ fx: { rate: 7.2, at: new Date().toISOString(), stale: false },
+ };
+}
+
+// Plugins › Built-in's rows: a name, what it is, a switch (builtins.test.cjs)
+const builtins = [
+ { id: "groups", name: "Routing groups", sub: "Several models agents pick as one: each request goes to the right one, and to the next when one fails", on: true, chosen: true, source: "preset", state: "active", inUse: 0 },
+ { id: "warmups", name: "Warm-up and check-in", sub: "Start a subscription's usage window at a time you pick, and claim vendors' daily check-in credits", on: true, chosen: false, source: "in use", state: "active", inUse: 2, use: "{n} warm-ups and check-ins on" },
+];
+
+function serve(lang) {
+ return async (r) => {
+ const url = new URL(r.request().url());
+ const json = (data) => r.fulfill({ json: data });
+ if (url.pathname === "/boot.js") return r.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"${lang}",theme:"light",web:false};` });
+ if (url.pathname === "/wails/runtime.js") return r.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
+ if (url.pathname === "/api/state") return json({ agents: [], profiles: [], settings: settings(lang) });
+ if (url.pathname === "/api/settings") return json(settings(lang));
+ if (url.pathname === "/api/providers") return json({ providers: [], presets: [], excluded: [], gateway: { running: true, window: true, url: "http://127.0.0.1:3999" } });
+ if (url.pathname === "/api/groups") return json({ models: [], groups: [], pools: [] });
+ if (url.pathname === "/api/plugins/builtin") return json(builtins);
+ if (url.pathname === "/api/plugins") return json({ bun: true, bunVersion: "1.4.2", plugins: [], picker: false, movable: [] });
+ if (url.pathname === "/api/usage/quotas") return json([]);
+ 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)];
+ const body = await fs.readFile(file).catch(() => null);
+ await (body ? r.fulfill({ body, contentType }) : r.fulfill({ status: 404, body: "" }));
+ };
+}
+
+// every shown setting row's lines and controls, in the part shown
+const measure = (scope) => {
+ const shown = (e) => e.getClientRects().length && !e.closest("[hidden]");
+ const rows = [...document.querySelectorAll(`${scope} .row.pref`)].filter(shown);
+ const cut = [], out = [];
+ for (const r of rows) {
+ const rb = r.getBoundingClientRect();
+ for (const s of r.querySelectorAll(".who .sub")) {
+ if (!shown(s) || !s.textContent.trim()) continue;
+ const cs = getComputedStyle(s);
+ if (s.scrollWidth > s.clientWidth + 1 || cs.whiteSpace === "nowrap") cut.push({ text: s.textContent.slice(0, 80), scroll: s.scrollWidth, width: s.clientWidth, whiteSpace: cs.whiteSpace });
+ }
+ const v = r.querySelector(":scope > .val");
+ if (v && shown(v)) {
+ const b = v.getBoundingClientRect();
+ if (b.right > rb.right + 0.5 || b.left < rb.left - 0.5) out.push({ row: r.querySelector(".name")?.textContent, val: [b.left, b.right], rowBox: [rb.left, rb.right] });
+ }
+ }
+ return { rows: rows.length, cut, out, sideways: document.documentElement.scrollWidth > innerWidth };
+};
+
+const engines = process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"];
+for (const engine of engines) {
+ for (const lang of ["en", "zh", "zh-TW", "ja", "de"]) for (const width of [1000, 440]) {
+ test(`${engine} ${lang} ${width}px: every Settings row's line wraps whole beside its control`, async (t) => {
+ const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
+ t.after(() => browser.close());
+ const page = await (await browser.newContext({ viewport: { width, height: 760 }, reducedMotion: "reduce" })).newPage();
+ page.setDefaultTimeout(8000);
+ const errors = [];
+ page.on("pageerror", (e) => errors.push(e.message));
+ await page.addInitScript(() => Object.defineProperty(navigator, "platform", { get: () => "MacIntel" }));
+ await page.route("**/*", serve(lang));
+ await watchSettingsReads(page);
+ await page.goto("http://magpie.test/?view=settings&tab=general");
+ await settingsDrawn(page);
+ const parts = await page.$$eval("[id^=setTab-]", (bs) => bs.filter((b) => !b.hidden).map((b) => b.dataset.set));
+ assert.ok(parts.length >= 7, `parts: ${parts}`);
+ let seen = 0;
+ for (const part of parts) {
+ await openPart(page, part);
+ await page.locator(`#setPage-${part}`).waitFor();
+ await settingsDrawn(page);
+ const m = await page.evaluate(measure, `#setPage-${part}`);
+ seen += m.rows;
+ assert.deepEqual(m.cut, [], `${part}: a row's line is cut short`);
+ assert.deepEqual(m.out, [], `${part}: a row's control runs out of its row`);
+ assert.equal(m.sideways, false, `${part}: the page scrolls sideways`);
+ }
+ assert.ok(seen > 30, `only ${seen} setting rows were looked at`);
+ // the reported rows were among them, and read whole
+ await openPart(page, "models");
+ for (const sel of ["#imagesList .image-gen-vendor", "#visionMcpRow .sub", ".searcher-row .who > .sub"]) {
+ const s = page.locator(sel).first();
+ await s.waitFor();
+ const whole = await s.evaluate((e) => e.scrollWidth <= e.clientWidth + 1 && getComputedStyle(e).whiteSpace !== "nowrap");
+ assert.equal(whole, true, `${sel} is cut`);
+ }
+
+ // Plugins › Built-in: the same rows
+ // (its tab is the page's own strip's first below 1024 points)
+ await page.goto("http://magpie.test/?view=plugins");
+ await page.locator("#view-plugins .lib-tabs .opt").first().press("Enter");
+ await page.locator("#builtinList .feat-row").first().waitFor();
+ const m = await page.evaluate(measure, "#builtinList");
+ assert.ok(m.rows >= builtins.length, `built-in rows: ${m.rows}`);
+ assert.deepEqual(m.cut, [], "a built-in plugin's line is cut short");
+ assert.deepEqual(m.out, [], "a built-in plugin's switch runs out of its row");
+ assert.equal(m.sideways, false, "Plugins scrolls sideways");
+ assert.deepEqual(errors, []);
+ });
+ }
+}
diff --git a/internal/gui/tests/tray-cost.test.cjs b/internal/gui/tests/tray-cost.test.cjs
index b358b4ebe..398f1a2ba 100644
--- a/internal/gui/tests/tray-cost.test.cjs
+++ b/internal/gui/tests/tray-cost.test.cjs
@@ -10,7 +10,7 @@ const fs = require("node:fs/promises");
const path = require("node:path");
const { test } = require("node:test");
const { chromium, webkit } = require("playwright");
-const { openPart } = require("./reader.cjs");
+const { openPart, reach } = require("./reader.cjs"); // reach: wheeled to as a reader would, rows taller since their lines wrap whole (arculongus on Discord); a Playwright scroll is undone
const assets = path.resolve(__dirname, "../assets");
@@ -110,7 +110,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
// the cost shown, as before
assert.equal(await opts.nth(1).evaluate((b) => b.classList.contains("on")), true, "the cost on by default");
// the row fits: nothing cut off nor pushed past the page
- await row.scrollIntoViewIfNeeded();
+ await reach(page, row);
const fit = await row.evaluate((r) => {
const b = r.getBoundingClientRect(), s = r.querySelector("#trayCostSegs").getBoundingClientRect();
return { over: r.scrollWidth - r.clientWidth, right: s.right - b.right, page: document.documentElement.scrollWidth - document.documentElement.clientWidth };
diff --git a/internal/gui/tests/tray-totals.test.cjs b/internal/gui/tests/tray-totals.test.cjs
index c63c3f5fd..aebf19c8b 100644
--- a/internal/gui/tests/tray-totals.test.cjs
+++ b/internal/gui/tests/tray-totals.test.cjs
@@ -12,7 +12,7 @@ const fs = require("node:fs/promises");
const path = require("node:path");
const { test } = require("node:test");
const { chromium, webkit } = require("playwright");
-const { openPart } = require("./reader.cjs");
+const { openPart, reach } = require("./reader.cjs"); // reach: wheeled to as a reader would, rows taller since their lines wrap whole (arculongus on Discord); a Playwright scroll is undone
const assets = path.resolve(__dirname, "../assets");
@@ -111,8 +111,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const pill = page.locator("#trayUsagePick button");
await pill.waitFor();
await pillIs(page, w.off);
- await pill.scrollIntoViewIfNeeded();
+ await reach(page, pill);
const before = await view(page);
+ const pillY = (await pill.boundingBox()).y;
// the two totals follow the subscriptions, each with a box to tick
await pill.click();
@@ -160,7 +161,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.deepEqual(posts.at(-1).trayUsages, ["usage:7d"]);
await page.waitForTimeout(300);
- assert.equal(await view(page), before, "no click moved the page");
+ // the pill's name changes its width, and the row's line, wrapped
+ // whole beside it (arculongus on Discord), can take a line more or
+ // less: the page then moves only to keep the pill under the pointer (WebKit
+ // scrolls by whole pixels, so four holds can leave it ~1.3px off)
+ if (await view(page) !== before) assert.ok(Math.abs((await pill.boundingBox()).y - pillY) <= 2, "a click moved the page, and the pill with it");
assert.deepEqual(errors, []);
await context.close();
});
diff --git a/internal/gui/tests/turn-done.test.cjs b/internal/gui/tests/turn-done.test.cjs
index a957a96a8..b114fc772 100644
--- a/internal/gui/tests/turn-done.test.cjs
+++ b/internal/gui/tests/turn-done.test.cjs
@@ -116,6 +116,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await page.waitForTimeout(300);
assert.equal(await scrolled(), top, "no click moved the page");
+ // back up past Currency's rows, taller now their lines wrap whole
+ // (arculongus on Discord)
+ await reach(page, opts.nth(0));
await opts.nth(0).click();
assert.equal((await posted(3)).turnDoneAlert, 0, "Off saves 0");
assert.equal(await page.locator("#turnDoneRow").evaluate((e) => getComputedStyle(e).borderLeftWidth), "0px");
diff --git a/internal/gui/tests/update-download.test.cjs b/internal/gui/tests/update-download.test.cjs
index f4e670c86..e4b48c854 100644
--- a/internal/gui/tests/update-download.test.cjs
+++ b/internal/gui/tests/update-download.test.cjs
@@ -139,8 +139,13 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.equal(await dl.locator(".opt").nth(1).evaluate((o) => o.classList.contains("on")), true, "on by default");
// off: saved, nothing else changed, the row says what off does
+ // the click scrolls nothing but to keep what was clicked where it
+ // was: the row's line says what off does, and wrapped whole
+ // (arculongus on Discord) it can take another line, the switch
+ // beside it held under the pointer
await showRow(page, dl);
let before = await scrolls(page);
+ const y0 = (await dl.locator(".opt").nth(0).boundingBox()).y;
await dl.locator(".opt").nth(0).click();
await page.waitForFunction(() => document.querySelectorAll(".update-download-row .opt")[0]?.classList.contains("on"));
assert.equal(ctl.saves.at(-1).noAutoDownload, true);
@@ -149,7 +154,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.equal(ctl.saves.at(-1).autoRestart, false);
await dl.locator(".sub", { hasText: w.off }).waitFor();
await page.waitForTimeout(400);
- assert.equal(await scrolls(page), before, "the click must not scroll the page");
+ const y1 = (await dl.locator(".opt").nth(0).boundingBox()).y;
+ if (await scrolls(page) !== before) assert.ok(Math.abs(y1 - y0) <= 1, `the click scrolled the page, and the switch moved ${y1 - y0}px`);
await fits(page, dl, width);
// kept after a reload; Check now finds 0.1.401 and only says so
diff --git a/internal/gui/tests/update-restart.test.cjs b/internal/gui/tests/update-restart.test.cjs
index b24c59c30..632b8bac4 100644
--- a/internal/gui/tests/update-restart.test.cjs
+++ b/internal/gui/tests/update-restart.test.cjs
@@ -162,7 +162,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.equal(ctl.saves.at(-1).autoRestart, true);
await page.waitForTimeout(400);
const y1 = (await auto.locator(".opt").nth(0).boundingBox()).y;
- if (atTop) {
+ // (the Version row's line wraps whole, arculongus on Discord: at a
+ // narrow width it can grow the row past the switch's height, and
+ // then the switch is held where it was clicked)
+ const held = Math.abs(y1 - y0) <= 1;
+ if (atTop && !held) {
assert.equal(await settings.evaluate((v) => v.scrollTop), 0, "a view at its top stays at its top");
const tall = (await auto.locator(".opt").nth(0).boundingBox()).height;
assert.ok(y1 - y0 >= -1 && y1 - y0 < tall, `the clicked switch moved ${y1 - y0}px, its height ${tall}px`);