Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.
whatsnew: many releases' notes read as one list, by kind
yetone7ad6df865c37
diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.cssindex 2da07aff7..2c5439c32 100644--- a/internal/gui/assets/app.css+++ b/internal/gui/assets/app.css@@ -3625,6 +3625,11 @@ html.theming, html.theming *, html.theming *::before, html.theming *::after {.whatsnew .wn-notes ul { margin: 2px 0; padding-left: 18px; }.whatsnew .wn-notes li + li { margin-top: 2px; }.whatsnew .wn-notes p { margin: 4px 0; }+.whatsnew .wn-span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }+.whatsnew .wn-merged .wn-h { display: flex; align-items: baseline; gap: 6px; margin-top: 14px; }+.whatsnew .wn-merged .wn-n { font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }+.whatsnew .wn-merged li + li { margin-top: 4px; }+.whatsnew .wn-v { margin-left: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }.whatsnew .wn-notes code { font: var(--code-style, normal) var(--code-weight, 400) 11.5px/1.4 var(--code-font, var(--code)); font-stretch: var(--code-stretch, 100%); padding: 0 4px; border-radius: 4px; background: var(--pill); }.whatsnew .wn-link { color: var(--accent); text-decoration: none; }.whatsnew .wn-link:hover { text-decoration: underline; }diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.jsindex a55649234..ea0a98607 100644--- a/internal/gui/assets/app.js+++ b/internal/gui/assets/app.js@@ -4418,7 +4418,18 @@ function showWhatsNew(releases, auto, more = {}) {head.append(el("b", "", t("What's new in {v}", { v: "v" + (releases[0]?.version || more.current) })));if (!auto) head.append(el("span", "grow"), wnRange(more.last || ""));ed.append(head);- for (const r of releases) {+ if (releases.length > 1) {+ const sec = el("section", "wn-rel");+ const wait = releases.filter((r) => r.pending);+ if (wait.length) {+ const h = el("div", "wn-ver");+ h.append(el("b", "", "v" + wait.at(-1).version + (wait.length > 1 ? " – v" + wait[0].version : "")), el("span", "badge", t("Not installed yet")));+ sec.append(h);+ }+ sec.append(mergedNotes(releases));+ ed.append(sec);+ }+ else for (const r of releases) {const sec = el("section", "wn-rel");const h = el("div", "wn-ver");h.append(el("b", "", "v" + r.version));@@ -4491,6 +4502,54 @@ function noteBlocks(md) {return box;}+// NOTE_ORDER: the merged notes' sections, what's new first+const NOTE_ORDER = ["Features", "Improvements", "Performance Improvements", "Bug Fixes", "Security", "Provider Changes", "Changes", "Documentation"];++// mergedNotes draws many releases' notes as one (the owner: nine releases+// of a line each read as a scattered list): their bullets gathered under+// one heading per kind, New features first, each with the version it came+// in, newest first, and a line that says the range. A line outside a list+// is a bullet of its own; a release with no notes is left out.+function mergedNotes(releases) {+ const secs = new Map();+ for (const r of releases) {+ const of = (k) => secs.get(k) || secs.set(k, []).get(k);+ let sec = null, li = null;+ const put = (text) => {+ sec ??= of(t("Changes"));+ li = sec.some((b) => b.text === text) ? null : { text, v: r.version };+ if (li) sec.push(li);+ };+ for (const line of String(r.notes || "").split(/\r?\n/)) {+ const h = /^\s{0,3}#{1,6}\s+(.*?)\s*#*\s*$/.exec(line);+ const b = /^\s*[-*+]\s+(.*)$/.exec(line);+ if (h) {+ sec = of(tHeading(h[1]));+ li = null;+ } else if (b) put(b[1]);+ else if (!line.trim()) li = null;+ else if (li && /^\s{2,}\S/.test(line)) li.text += " " + line.trim();+ else put(line.trim());+ }+ }+ const rank = (k) => { const i = NOTE_ORDER.findIndex((o) => t(o) === k); return i < 0 ? NOTE_ORDER.length : i; };+ const box = el("div", "wn-notes wn-merged");+ const vs = releases.map((r) => r.version);+ box.append(el("div", "wn-span", t("{n} releases · {from} – {to}", { n: vs.length, from: "v" + vs.at(-1), to: "v" + vs[0] })));+ for (const [k, items] of [...secs].filter(([, x]) => x.length).sort((a, b) => rank(a[0]) - rank(b[0]))) {+ const h = el("div", "wn-h wn-h2");+ h.append(k, el("span", "wn-n", String(items.length)));+ const list = el("ul");+ for (const it of items) {+ const e = inlineMD(el("li"), it.text);+ e.append(el("span", "wn-v", "v" + it.v));+ list.append(e);+ }+ box.append(h, list);+ }+ return box;+}+// inlineMD appends text to e with **bold**, `code`, [links](https://…),// bare https:// links and #123 issue links; only http(s) addresses link.function inlineMD(e, s) {@@ -4535,7 +4594,12 @@ async function confirmUpdate(u, go) {const box = el("div", "wn-list");const draw = (releases) => {box.replaceChildren();- for (const r of releases) {+ if (releases.length > 1) {+ const sec = el("section", "wn-rel");+ sec.append(mergedNotes(releases));+ box.append(sec);+ }+ else for (const r of releases) {const sec = el("section", "wn-rel");const h = el("div", "wn-ver");h.append(el("b", "", "v" + r.version));diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.jsindex 4e8fb9ba2..baab0174f 100644--- a/internal/gui/assets/i18n.js+++ b/internal/gui/assets/i18n.js@@ -168,6 +168,7 @@ const I18N = {"Turn {n}": "第 {n} 轮","{n} earlier turns": "更早的 {n} 轮","{n} more": "另外 {n} 项",+ "{n} releases · {from} – {to}": "{n} 个版本 · {from} – {to}","{n} files": "{n} 个文件","Healthy": "健康","Filling up": "渐满",@@ -4156,6 +4157,7 @@ const I18N = {"Turn {n}": "第 {n} 輪","{n} earlier turns": "更早的 {n} 輪","{n} more": "另外 {n} 項",+ "{n} releases · {from} – {to}": "{n} 個版本 · {from} – {to}","{n} files": "{n} 個檔案","Healthy": "健康","Filling up": "漸滿",@@ -8091,6 +8093,7 @@ const I18N = {"Turn {n}": "ターン {n}","{n} earlier turns": "それ以前の {n} ターン","{n} more": "ほか {n} 件",+ "{n} releases · {from} – {to}": "{n} リリース · {from} – {to}","{n} files": "{n} ファイル","Healthy": "良好","Filling up": "埋まりつつある",@@ -12047,6 +12050,7 @@ const I18N = {"Turn {n}": "Runde {n}","{n} earlier turns": "{n} frühere Runden","{n} more": "{n} weitere",+ "{n} releases · {from} – {to}": "{n} Versionen · {from} – {to}","{n} files": "{n} Dateien","Healthy": "Gesund","Filling up": "Füllt sich",diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.goindex 5c76ba35b..4437a7822 100644--- a/internal/gui/core_budget_test.go+++ b/internal/gui/core_budget_test.go@@ -15,8 +15,8 @@ import (// so a page can't quietly grow back into the core; a change that needs more// raises them and says why in its commit.const (- appScriptBudget = 1_323_401 // 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)- coreScriptBudget = 1_534_312 // 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)+ appScriptBudget = 1_326_105 // 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)+ coreScriptBudget = 1_537_016 // 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))func TestCoreScriptBudget(t *testing.T) {diff --git a/internal/gui/tests/update-notes-ask.test.cjs b/internal/gui/tests/update-notes-ask.test.cjsindex de9dc7ce0..b30bc996a 100644--- a/internal/gui/tests/update-notes-ask.test.cjs+++ b/internal/gui/tests/update-notes-ask.test.cjs@@ -15,8 +15,8 @@ const { chromium, webkit } = require("playwright");const assets = path.resolve(__dirname, "../assets");const words = {- en: { pill: "Update", restart: "Restart to update", later: "Later", head: "Update to v0.1.402", newer: "Update to v0.1.403", since: "What changed since v0.1.400", version: "Version" },- zh: { pill: "更新", restart: "重启以更新", later: "稍后", head: "更新到 v0.1.402", newer: "更新到 v0.1.403", since: "自 v0.1.400 以来的更新内容", version: "版本" },+ en: { pill: "Update", restart: "Restart to update", later: "Later", head: "Update to v0.1.402", newer: "Update to v0.1.403", since: "What changed since v0.1.400", span: "2 releases · v0.1.401 – v0.1.402", span3: "3 releases · v0.1.401 – v0.1.403", version: "Version" },+ zh: { pill: "更新", restart: "重启以更新", later: "稍后", head: "更新到 v0.1.402", newer: "更新到 v0.1.403", since: "自 v0.1.400 以来的更新内容", span: "2 个版本 · v0.1.401 – v0.1.402", span3: "3 个版本 · v0.1.401 – v0.1.403", version: "版本" },};function server(lang, ctl) {@@ -33,7 +33,9 @@ function server(lang, ctl) {ctl.asked.push(url.searchParams.get("lang"));await new Promise((r) => setTimeout(r, 200));// #910: the feed asked again names a release out since the download- if (ctl.newer) return json({ latest: "0.1.403", releases: [{ version: "0.1.403", notes: "- Three: out since" }, { version: "0.1.402", notes: "- Two: the pill asks first" }, { version: "0.1.401", notes: "- One: a fix" }] });+ // a line two releases both carry is said once, at the newest+ if (ctl.newer) return json({ latest: "0.1.403", releases: [{ version: "0.1.403", notes: "- Three: out since\n- One: a fix" }, { version: "0.1.402", notes: "- Two: the pill asks first" }, { version: "0.1.401", notes: "- One: a fix" }] });+ if (ctl.one) return json({ latest: "0.1.402", releases: [{ version: "0.1.402", notes: "- Two: the pill asks first" }] });return json({ latest: "0.1.402", releases: [{ version: "0.1.402", notes: "- Two: the pill asks first" }, { version: "0.1.401", notes: "- One: a fix" }] });}if (url.pathname === "/api/update/install") {@@ -52,7 +54,10 @@ function server(lang, ctl) {const scrolls = (page) => page.evaluate(() => [window.scrollY, document.scrollingElement.scrollTop, ...[...document.querySelectorAll(".view")].map((v) => v.scrollTop)].join(","));// the sheet's releases: each version with its notes-const shown = (page) => page.$$eval("#modal .update-ask .wn-rel", (rs) => rs.map((r) => [r.querySelector(".wn-ver")?.textContent.trim(), r.querySelector(".wn-notes")?.textContent.trim()]));+// the releases' lines, merged under one list (the owner), each with the+// version it came in+const shown = (page) => page.$$eval("#modal .update-ask .wn-merged li", (ls) => ls.map((l) => [l.querySelector(".wn-v")?.textContent, l.firstChild.textContent.trim()]));+const lines = (n) => document.querySelectorAll("#modal .update-ask .wn-merged li").length === n;for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {for (const lang of ["en", "zh"]) {@@ -75,8 +80,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",await ask.waitFor();assert.equal((await ask.locator(".ehead b").textContent()).trim(), w.head);assert.equal((await ask.locator(".wn-since").textContent()).trim(), w.since);- await page.waitForFunction(() => document.querySelectorAll("#modal .update-ask .wn-rel").length === 2);+ await page.waitForFunction(lines, 2);assert.deepEqual(await shown(page), [["v0.1.402", "Two: the pill asks first"], ["v0.1.401", "One: a fix"]]);+ assert.equal(await ask.locator(".wn-span").textContent(), w.span);assert.deepEqual(ctl.asked, [lang], "the notes are asked for in the page's language");assert.deepEqual(await ask.locator(".bar button").allTextContents(), [w.later, w.restart]);for (const n of [ask, ask.locator(".wn-rel").first()]) assert.equal(await n.evaluate((e) => getComputedStyle(e).borderLeftStyle), "none");@@ -102,7 +108,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",const row = page.locator("#about .row.pref", { has: page.locator(".name", { hasText: w.version }) }).first();await row.locator("button", { hasText: w.restart }).click();await ask.waitFor();- await page.waitForFunction(() => document.querySelectorAll("#modal .update-ask .wn-rel").length === 2);+ await page.waitForFunction(lines, 2);assert.equal(ctl.installs.length, 1, "the row's click asks first");await ask.locator(".bar button.primary").click();for (let i = 0; i < 50 && ctl.installs.length < 2; i++) await page.waitForTimeout(20);@@ -110,6 +116,30 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.deepEqual(errors, []);});+ // one release reads as before: its version over its notes, nothing merged+ test(`${engine} ${lang}: one release is shown by itself`, async (t) => {+ const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));+ t.after(() => browser.close());+ const ctl = { installs: [], asked: [], one: true }, errors = [];+ const page = await (await browser.newContext({ viewport: { width: 1000, height: 640 }, reducedMotion: "reduce" })).newPage();+ page.setDefaultTimeout(5000);+ page.on("pageerror", (e) => errors.push(e.message));+ await page.route("**/*", server(lang, ctl));+ await page.goto("http://magpie.test/?view=agents");+ const pill = page.locator("#update");+ await pill.waitFor({ state: "visible" });+ await pill.click();+ const ask = page.locator("#modal .update-ask");+ await ask.waitFor();+ await page.waitForFunction(() => document.querySelector("#modal .update-ask .wn-ver"));+ for (let i = 0; i < 50 && !ctl.asked.length; i++) await page.waitForTimeout(20);+ await page.waitForTimeout(400);+ assert.deepEqual(await ask.locator(".wn-ver b").allTextContents(), ["v0.1.402"]);+ assert.equal((await ask.locator(".wn-notes").textContent()).trim(), "Two: the pill asks first");+ assert.equal(await ask.locator(".wn-merged, .wn-span").count(), 0);+ assert.deepEqual(errors, []);+ });+// Moody-Sin, #910: an update downloaded hours ago held the sheet to its// version with newer ones out; the notes' answer asks the feed again,// and the sheet names the newest, with every release up to it@@ -127,10 +157,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",await pill.click();const ask = page.locator("#modal .update-ask");await ask.waitFor();- await page.waitForFunction(() => document.querySelectorAll("#modal .update-ask .wn-rel").length === 3);+ await page.waitForFunction(lines, 3);assert.equal((await ask.locator(".ehead b").textContent()).trim(), w.newer);assert.equal((await ask.locator(".wn-since").textContent()).trim(), w.since);- assert.deepEqual((await shown(page)).map((r) => r[0]), ["v0.1.403", "v0.1.402", "v0.1.401"]);+ assert.deepEqual(await shown(page), [["v0.1.403", "Three: out since"], ["v0.1.403", "One: a fix"], ["v0.1.402", "Two: the pill asks first"]]);+ assert.equal(await ask.locator(".wn-span").textContent(), w.span3);assert.deepEqual(errors, []);});}diff --git a/internal/gui/tests/whats-new-range.test.cjs b/internal/gui/tests/whats-new-range.test.cjsindex f4351247c..70d6e03bf 100644--- a/internal/gui/tests/whats-new-range.test.cjs+++ b/internal/gui/tests/whats-new-range.test.cjs@@ -66,11 +66,11 @@ function serve(lang, ctl) {}const words = {- en: { open: "Open", since: "Since the last update", back: (n) => `This version and ${n} before`, head: "Release notes shown", failed: "Couldn't load the release notes", retry: "Try again" },- zh: { open: "打开", since: "上次更新以来", back: (n) => `当前版本及之前 ${n} 个版本`, head: "显示的更新说明", failed: "无法获取更新说明", retry: "重试" },- "zh-TW": { open: "開啟", since: "上次更新以來", back: (n) => `目前版本及之前 ${n} 個版本`, head: "顯示的更新說明", failed: "無法取得更新說明", retry: "重試" },- ja: { open: "開く", since: "前回のアップデート以降", back: (n) => `このバージョンと前の ${n} 件`, head: "表示するリリースノート", failed: "リリースノートを読み込めませんでした", retry: "再試行" },- de: { open: "Öffnen", since: "Seit dem letzten Update", back: (n) => `Diese Version und ${n} davor`, head: "Angezeigte Versionshinweise", failed: "Versionshinweise konnten nicht geladen werden", retry: "Erneut versuchen" },+ en: { span: (n, a, b) => `${n} releases · ${a} – ${b}`, open: "Open", since: "Since the last update", back: (n) => `This version and ${n} before`, head: "Release notes shown", failed: "Couldn't load the release notes", retry: "Try again" },+ zh: { span: (n, a, b) => `${n} 个版本 · ${a} – ${b}`, open: "打开", since: "上次更新以来", back: (n) => `当前版本及之前 ${n} 个版本`, head: "显示的更新说明", failed: "无法获取更新说明", retry: "重试" },+ "zh-TW": { span: (n, a, b) => `${n} 個版本 · ${a} – ${b}`, open: "開啟", since: "上次更新以來", back: (n) => `目前版本及之前 ${n} 個版本`, head: "顯示的更新說明", failed: "無法取得更新說明", retry: "重試" },+ ja: { span: (n, a, b) => `${n} リリース · ${a} – ${b}`, open: "開く", since: "前回のアップデート以降", back: (n) => `このバージョンと前の ${n} 件`, head: "表示するリリースノート", failed: "リリースノートを読み込めませんでした", retry: "再試行" },+ de: { span: (n, a, b) => `${n} Versionen · ${a} – ${b}`, open: "Öffnen", since: "Seit dem letzten Update", back: (n) => `Diese Version und ${n} davor`, head: "Angezeigte Versionshinweise", failed: "Versionshinweise konnten nicht geladen werden", retry: "Erneut versuchen" },};for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {@@ -104,7 +104,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",await page.waitForTimeout(200);const at = await view.evaluate((v) => v.scrollTop);const still = async (what) => assert.equal(await view.evaluate((v) => v.scrollTop), at, what + " moved the page");- const shown = () => dialog.locator(".wn-rel:not(.wn-none) .wn-ver b").allTextContents();+ // the releases are merged (the owner): each line says its version+ const shown = () => dialog.locator(".wn-merged li .wn-v").allTextContents();const vs = (list) => list.map((r) => "v" + r.version);const pill = dialog.locator(".ehead .wn-range");const pick = async (name) => {@@ -128,7 +129,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",// this version and the 10 before it: eleven, newest firstawait pick(w.back(10));- await dialog.locator(".wn-rel").nth(10).waitFor();+ await dialog.locator(".wn-merged li").nth(10).waitFor();+ assert.equal(await dialog.locator(".wn-span").textContent(), w.span(11, "v0.1.1399", "v0.1.1410"));assert.deepEqual(ctl.asked, ["", "10"]);assert.deepEqual(await shown(), vs(back(10)));assert.equal(await pill.textContent(), w.back(10));@@ -140,7 +142,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",// 100: past the 40 the default stops atawait pick(w.back(100));- await dialog.locator(".wn-rel").nth(100).waitFor();+ await dialog.locator(".wn-merged li").nth(100).waitFor();assert.deepEqual(await shown(), vs(back(100)));// a range that fails keeps the notes shown, says so above them, and@@ -155,7 +157,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",assert.match(firstRel, /wn-failed/, "the failure is said above the kept notes");ctl.down = false;await dialog.getByRole("button", { name: w.retry }).click();- await page.waitForFunction(() => !document.querySelector("#modal .wn-failed") && document.querySelectorAll("#modal .wn-rel").length === 51);+ await page.waitForFunction(() => !document.querySelector("#modal .wn-failed") && document.querySelectorAll("#modal .wn-merged li").length === 51);assert.deepEqual(ctl.asked.slice(-2), ["50", "50"]);assert.deepEqual(await shown(), vs(back(50)));await still("Try again");diff --git a/internal/gui/tests/whats-new.test.cjs b/internal/gui/tests/whats-new.test.cjsindex b0fe2fdd4..2d611e990 100644--- a/internal/gui/tests/whats-new.test.cjs+++ b/internal/gui/tests/whats-new.test.cjs@@ -89,9 +89,12 @@ function serve(lang, ctl) {};}+// a merged section's heading and how many lines it has+const heads = (box) => box.locator(".wn-h").evaluateAll((hs) => hs.map((h) => [h.firstChild.textContent, h.querySelector(".wn-n")?.textContent]));+const words = {- en: { heads: ["Bug Fixes", "Improvements"], heads603: ["Bug Fixes", "Bug Fixes", "Thanks"], headPending: "Features", quiet: "Don't show again today", title: "What's new in v0.1.604", pendingTitle: "What's new in v0.1.607", close: "Close", again: "What's new", open: "Open", pending: "Not installed yet" },- zh: { heads: ["错误修复", "改进"], heads603: ["错误修复", "错误修复", "Thanks"], headPending: "新功能", quiet: "今天不再弹出", title: "v0.1.604 更新内容", pendingTitle: "v0.1.607 更新内容", close: "关闭", again: "更新内容", open: "打开", pending: "尚未安装" },+ en: { span: "2 releases · v0.1.603 – v0.1.604", heads: [["Improvements", "1"], ["Bug Fixes", "4"], ["Thanks", "1"]], span5: "5 releases · v0.1.603 – v0.1.607", headsPending: [["Features", "1"], ["Improvements", "1"], ["Bug Fixes", "4"], ["Changes", "2"], ["Thanks", "1"]], quiet: "Don't show again today", title: "What's new in v0.1.604", pendingTitle: "What's new in v0.1.607", close: "Close", again: "What's new", open: "Open", pending: "Not installed yet" },+ zh: { span: "2 个版本 · v0.1.603 – v0.1.604", heads: [["改进", "1"], ["错误修复", "4"], ["Thanks", "1"]], span5: "5 个版本 · v0.1.603 – v0.1.607", headsPending: [["新功能", "1"], ["改进", "1"], ["错误修复", "4"], ["更新", "2"], ["Thanks", "1"]], quiet: "今天不再弹出", title: "v0.1.604 更新内容", pendingTitle: "v0.1.607 更新内容", close: "关闭", again: "更新内容", open: "打开", pending: "尚未安装" },};for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {@@ -165,17 +168,20 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",await page.screenshot({ path: path.join(process.env.ARTIFACT_DIR, `${engine}-${lang}-whats-new.png`) });}assert.equal(await dialog(page).locator(".ehead b").textContent(), w.title);- assert.deepEqual(await dialog(page).locator(".wn-ver b").allTextContents(), ["v0.1.604", "v0.1.603"]);+ // the releases merged (the owner): one heading per kind with how+ // many, each line with the version it came in, newest first+ assert.equal(await dialog(page).locator(".wn-span").textContent(), w.span);+ assert.equal(await dialog(page).locator(".wn-ver").count(), 0, "a release each, not merged");const notes = dialog(page).locator(".wn-rel").first();// every release's headings in the page's language, however its notes say them- assert.deepEqual(await notes.locator(".wn-h").allTextContents(), w.heads);- assert.deepEqual(await dialog(page).locator(".wn-rel").nth(1).locator(".wn-h").allTextContents(), w.heads603);- assert.equal(await notes.locator("li").count(), 3);+ assert.deepEqual(await heads(notes), w.heads);+ assert.deepEqual(await notes.locator("li .wn-v").allTextContents(), ["v0.1.604", "v0.1.604", "v0.1.604", "v0.1.603", "v0.1.603", "v0.1.603"]);+ assert.equal(await notes.locator("li").count(), 6);assert.equal(await notes.locator("li b").first().textContent(), "model picks");assert.equal(await notes.locator("li code").first().textContent(), "providers.json");// HTML is textassert.equal(await dialog(page).locator("img, li > b:has-text('raw')").count(), 0, "no HTML from the notes");- assert((await notes.locator("li").nth(1).textContent()).startsWith('<img src=x onerror="window.__pwned=1"> <b>raw</b> tags stay text.'));+ assert((await notes.locator("li", { hasText: "tags stay text" }).textContent()).startsWith('<img src=x onerror="window.__pwned=1"> <b>raw</b> tags stay text.'));// links: issues, markdown http(s) links; javascript: is textconst issue = notes.getByRole("link", { name: "#464" });assert.equal(await issue.getAttribute("href"), "https://github.com/yetone/magpie/issues/464");@@ -248,9 +254,9 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",await dialog(page).waitFor();assert.equal(await view.evaluate((v) => v.scrollTop), at, "the click moved the page");assert.equal(await dialog(page).locator(".ehead b").textContent(), w.pendingTitle);- assert.deepEqual(await dialog(page).locator(".wn-ver b").allTextContents(), ["v0.1.607", "v0.1.606", "v0.1.605", "v0.1.604", "v0.1.603"]);- assert.deepEqual(await dialog(page).locator(".wn-rel .badge").allTextContents(), [w.pending, w.pending, w.pending], "every release up to the update is not installed yet");- assert.deepEqual(await dialog(page).locator(".wn-rel").first().locator(".wn-h").allTextContents(), [w.headPending]);+ assert.equal(await dialog(page).locator(".wn-span").textContent(), w.span5);+ assert.deepEqual(await dialog(page).locator(".wn-ver").allTextContents(), ["v0.1.605 – v0.1.607" + w.pending], "every release up to the update is not installed yet");+ assert.deepEqual(await heads(dialog(page).locator(".wn-rel").first()), w.headsPending);assert.equal(ctl.asked.at(-1), "all");assert.equal(ctl.seen, 1, "asking again isn't a first showing");assert.equal(await dialog(page).getByRole("checkbox").count(), 0, "Settings' notes have no \"don't show again today\"");