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