diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index d95f52a21..e4a60edba 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -4623,246 +4623,14 @@ async function openWhatsNew(b, last = "") { showWhatsNew(list, false, { failed, current: w?.current, url: w?.url, last, retry: () => openWhatsNew(null, last) }); } -// wnRange is Settings' pick of which notes (Linka): since the last update, -// or this version and 10, 20, 50 or 100 before it -function wnRange(last) { - const name = (v) => v ? t("This version and {n} before", { n: v }) : t("Since the last update"); - const b = el("button", "sess-pick wn-range"); - b.type = "button"; - b.setAttribute("aria-haspopup", "menu"); - b.append(el("span", "", name(last)), svg(CHEV, 11, 1.6)); - b.onclick = (e) => { - e.stopPropagation(); - if (b.classList.contains("open")) return closeProtoMenu(); - openProtoMenu(b, ["", "10", "20", "50", "100"].map((v) => ({ v, name: name(v), note: "", literalName: true })), last, (v) => v !== last && openWhatsNew(b, v), "Release notes shown", "sess-menu", "right"); - }; - return b; -} - -// auto: shown by itself after an update, with "Don't show again today" -// (#525: releases come many a day); Settings' row opens it without one. -// more (from Settings): failed, the current version's notes couldn't be -// had, retry asks again; current and url, the version and its release -// page, for a dialog with no notes. -function showWhatsNew(releases, auto, more = {}) { - const ed = el("div", "editor whatsnew"); - const head = el("div", "ehead"); - 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); - 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)); - if (r.pending) h.append(el("span", "badge", t("Not installed yet"))); - sec.append(h, noteBlocks(r.notes)); - ed.append(sec); - } - if (more.failed || !releases.length) { - const sec = el("section", "wn-rel wn-none" + (more.failed ? " wn-failed" : "")); - const h = el("div", "wn-ver"); - if (more.current) h.append(el("b", "", "v" + more.current)); - const p = el("p", "wn-msg", more.failed ? t("Couldn't load the release notes") : t("No release notes provided.")); - const acts = el("div", "wn-acts"); - if (more.failed && more.retry) { - const again = el("button", "text", t("Try again")); - again.onclick = async (e) => { - e.stopPropagation(); - again.disabled = true; - again.classList.add("busy"); - await more.retry(); - }; - acts.append(again); - } - if (more.url) acts.append(noteLink(t("Open the release page"), more.url)); - sec.append(h, p, acts); - head.after(sec); // above the notes kept from before - } - const bar = el("div", "bar"); - const ok = el("button", "text primary", t("Close")); - ok.onclick = cancelAsk; - if (auto) { - // told at once, so Escape or a click outside keeps it as well as Close - const [quiet, box] = tick(t("Don't show again today"), false); - quiet.classList.add("wn-quiet"); - box.onchange = () => api("whatsnew/today", { on: box.checked }).catch(statusErr); - bar.append(quiet); - } - bar.append(el("span", "grow"), ok); - ed.append(bar); - confirmAsk = ed; - openModal(ed); - $("#modal").classList.add("lib"); - ok.focus(NO_SCROLL); -} - -// noteBlocks draws a release's markdown as text: headings (tHeading), -// bullets, paragraphs, inline bold, code and links, never as HTML; #123 -// links the issue. -function noteBlocks(md) { - const box = el("div", "wn-notes"); - let list = null; - for (const line of String(md || "").split(/\r?\n/)) { - const h = /^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(line); - const li = /^\s*[-*+]\s+(.*)$/.exec(line); - if (h) { - list = null; - box.append(inlineMD(el("div", "wn-h wn-h" + Math.min(h[1].length, 4)), tHeading(h[2]))); - } else if (li) { - if (!list) box.append(list = el("ul")); - list.append(inlineMD(el("li"), li[1])); - } else if (!line.trim()) { - list = null; - } else if (list && /^\s{2,}\S/.test(line)) { - inlineMD(list.lastElementChild, " " + line.trim()); - } else { - list = null; - box.append(inlineMD(el("p"), line.trim())); - } - } - 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) { - const re = /\*\*(.+?)\*\*|`([^`]+)`|\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|(https?:\/\/[^\s<>)]+)|(^|[\s(\[])#(\d+)\b/g; - let at = 0, m; - while ((m = re.exec(s))) { - if (m.index > at) e.append(s.slice(at, m.index)); - if (m[1] !== undefined) e.append(inlineMD(el("b"), m[1])); - else if (m[2] !== undefined) e.append(el("code", "", m[2])); - else if (m[3] !== undefined) e.append(noteLink(m[3], m[4])); - else if (m[5] !== undefined) e.append(noteLink(m[5], m[5])); - else e.append(m[6], noteLink("#" + m[7], ISSUES + m[7])); - at = re.lastIndex; - } - if (at < s.length) e.append(s.slice(at)); - return e; -} - -// a link in the notes opens in the browser, as the app's other links do -function noteLink(text, url) { - const a = el("a", "wn-link", text); - a.href = url; - a.target = "_blank"; - a.rel = "noopener"; - a.onclick = (e) => { e.preventDefault(); e.stopPropagation(); api("open", { url }).catch(() => {}); }; - return a; -} - -// confirmUpdate shows what changed before an update downloaded is put in -// (Hu9956, #844: every update came unseen, its notes three clicks away in -// Settings › About): every release's notes after this one up to it, newest -// first, with Restart to update and Later. The update's own notes show at -// once; the releases between come in after. go restarts. The tray's panel, -// with no room for a dialog, restarts as before. +// The release notes' dialogs (What's new, the update's ask) are in +// whatsnew.js, loaded when one opens; the tray's panel restarts as before. +const notesJS = () => import("./whatsnew.js"); +const showWhatsNew = (...a) => notesJS().then(() => window.wnShow(...a)); async function confirmUpdate(u, go) { if (mode === "panel" || !$("#modal").hidden) return go(); - const ed = el("div", "editor whatsnew update-ask"); - const head = el("div", "ehead"); - const title = el("b", "", t("Update to {v}", { v: "v" + u.latest })); - head.append(title); - if (u.current) head.append(el("span", "wn-since", t("What changed since {v}", { v: "v" + u.current }))); - const box = el("div", "wn-list"); - const draw = (releases) => { - box.replaceChildren(); - 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)); - sec.append(h, noteBlocks(r.notes)); - box.append(sec); - } - if (!releases.length) { - const sec = el("section", "wn-rel wn-none"); - sec.append(el("p", "wn-msg", t("No release notes provided."))); - if (u.url) sec.append(noteLink(t("Open the release page"), u.url)); - box.append(sec); - } - }; - draw(u.notes ? [{ version: u.latest, notes: u.notes }] : []); - const bar = el("div", "bar"); - const later = el("button", "text", t("Later")); - later.onclick = cancelAsk; - const ok = el("button", "text primary", t("Restart to update")); - ok.onclick = (e) => { e.stopPropagation(); closeConfirmAsk(); go(); }; - bar.append(el("span", "grow"), later, ok); - ed.append(head, box, bar); - confirmAsk = ed; - openModal(ed); - $("#modal").classList.add("lib"); - ok.focus(NO_SCROLL); - // the notes' answer asks the feed again first, and names a release out - // since the one downloaded (#910), which the restart then waits for - const w = await api(updatePath("update/notes")).catch(() => null); - if (confirmAsk !== ed) return; - if (w?.latest && w.latest !== u.latest) title.textContent = t("Update to {v}", { v: "v" + w.latest }); - if (w?.releases?.length) draw(w.releases); + try { await notesJS(); } catch { return go(); } + return window.wnConfirm(u, go); } // ---------- picker ---------- diff --git a/internal/gui/assets/whatsnew.js b/internal/gui/assets/whatsnew.js new file mode 100644 index 000000000..daf88a646 --- /dev/null +++ b/internal/gui/assets/whatsnew.js @@ -0,0 +1,246 @@ +// The release notes' dialogs: What's new (after an update, and Settings' +// row) and the ask before an update is put in. app.js imports this when +// one opens (notesJS), so it weighs nothing on the core. +// wnRange is Settings' pick of which notes (Linka): since the last update, +// or this version and 10, 20, 50 or 100 before it +function wnRange(last) { + const name = (v) => v ? t("This version and {n} before", { n: v }) : t("Since the last update"); + const b = el("button", "sess-pick wn-range"); + b.type = "button"; + b.setAttribute("aria-haspopup", "menu"); + b.append(el("span", "", name(last)), svg(CHEV, 11, 1.6)); + b.onclick = (e) => { + e.stopPropagation(); + if (b.classList.contains("open")) return closeProtoMenu(); + openProtoMenu(b, ["", "10", "20", "50", "100"].map((v) => ({ v, name: name(v), note: "", literalName: true })), last, (v) => v !== last && openWhatsNew(b, v), "Release notes shown", "sess-menu", "right"); + }; + return b; +} + +// auto: shown by itself after an update, with "Don't show again today" +// (#525: releases come many a day); Settings' row opens it without one. +// more (from Settings): failed, the current version's notes couldn't be +// had, retry asks again; current and url, the version and its release +// page, for a dialog with no notes. +function showWhatsNew(releases, auto, more = {}) { + const ed = el("div", "editor whatsnew"); + const head = el("div", "ehead"); + 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); + 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)); + if (r.pending) h.append(el("span", "badge", t("Not installed yet"))); + sec.append(h, noteBlocks(r.notes)); + ed.append(sec); + } + if (more.failed || !releases.length) { + const sec = el("section", "wn-rel wn-none" + (more.failed ? " wn-failed" : "")); + const h = el("div", "wn-ver"); + if (more.current) h.append(el("b", "", "v" + more.current)); + const p = el("p", "wn-msg", more.failed ? t("Couldn't load the release notes") : t("No release notes provided.")); + const acts = el("div", "wn-acts"); + if (more.failed && more.retry) { + const again = el("button", "text", t("Try again")); + again.onclick = async (e) => { + e.stopPropagation(); + again.disabled = true; + again.classList.add("busy"); + await more.retry(); + }; + acts.append(again); + } + if (more.url) acts.append(noteLink(t("Open the release page"), more.url)); + sec.append(h, p, acts); + head.after(sec); // above the notes kept from before + } + const bar = el("div", "bar"); + const ok = el("button", "text primary", t("Close")); + ok.onclick = cancelAsk; + if (auto) { + // told at once, so Escape or a click outside keeps it as well as Close + const [quiet, box] = tick(t("Don't show again today"), false); + quiet.classList.add("wn-quiet"); + box.onchange = () => api("whatsnew/today", { on: box.checked }).catch(statusErr); + bar.append(quiet); + } + bar.append(el("span", "grow"), ok); + ed.append(bar); + confirmAsk = ed; + openModal(ed); + $("#modal").classList.add("lib"); + ok.focus(NO_SCROLL); +} + +// noteBlocks draws a release's markdown as text: headings (tHeading), +// bullets, paragraphs, inline bold, code and links, never as HTML; #123 +// links the issue. +function noteBlocks(md) { + const box = el("div", "wn-notes"); + let list = null; + for (const line of String(md || "").split(/\r?\n/)) { + const h = /^\s{0,3}(#{1,6})\s+(.*?)\s*#*\s*$/.exec(line); + const li = /^\s*[-*+]\s+(.*)$/.exec(line); + if (h) { + list = null; + box.append(inlineMD(el("div", "wn-h wn-h" + Math.min(h[1].length, 4)), tHeading(h[2]))); + } else if (li) { + if (!list) box.append(list = el("ul")); + list.append(inlineMD(el("li"), li[1])); + } else if (!line.trim()) { + list = null; + } else if (list && /^\s{2,}\S/.test(line)) { + inlineMD(list.lastElementChild, " " + line.trim()); + } else { + list = null; + box.append(inlineMD(el("p"), line.trim())); + } + } + 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) { + const re = /\*\*(.+?)\*\*|`([^`]+)`|\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)|(https?:\/\/[^\s<>)]+)|(^|[\s(\[])#(\d+)\b/g; + let at = 0, m; + while ((m = re.exec(s))) { + if (m.index > at) e.append(s.slice(at, m.index)); + if (m[1] !== undefined) e.append(inlineMD(el("b"), m[1])); + else if (m[2] !== undefined) e.append(el("code", "", m[2])); + else if (m[3] !== undefined) e.append(noteLink(m[3], m[4])); + else if (m[5] !== undefined) e.append(noteLink(m[5], m[5])); + else e.append(m[6], noteLink("#" + m[7], ISSUES + m[7])); + at = re.lastIndex; + } + if (at < s.length) e.append(s.slice(at)); + return e; +} + +// a link in the notes opens in the browser, as the app's other links do +function noteLink(text, url) { + const a = el("a", "wn-link", text); + a.href = url; + a.target = "_blank"; + a.rel = "noopener"; + a.onclick = (e) => { e.preventDefault(); e.stopPropagation(); api("open", { url }).catch(() => {}); }; + return a; +} + +// confirmUpdate shows what changed before an update downloaded is put in +// (Hu9956, #844: every update came unseen, its notes three clicks away in +// Settings › About): every release's notes after this one up to it, newest +// first, with Restart to update and Later. The update's own notes show at +// once; the releases between come in after. go restarts. The tray's panel, +// with no room for a dialog, restarts as before. +async function confirmUpdate(u, go) { + const ed = el("div", "editor whatsnew update-ask"); + const head = el("div", "ehead"); + const title = el("b", "", t("Update to {v}", { v: "v" + u.latest })); + head.append(title); + if (u.current) head.append(el("span", "wn-since", t("What changed since {v}", { v: "v" + u.current }))); + const box = el("div", "wn-list"); + const draw = (releases) => { + box.replaceChildren(); + 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)); + sec.append(h, noteBlocks(r.notes)); + box.append(sec); + } + if (!releases.length) { + const sec = el("section", "wn-rel wn-none"); + sec.append(el("p", "wn-msg", t("No release notes provided."))); + if (u.url) sec.append(noteLink(t("Open the release page"), u.url)); + box.append(sec); + } + }; + draw(u.notes ? [{ version: u.latest, notes: u.notes }] : []); + const bar = el("div", "bar"); + const later = el("button", "text", t("Later")); + later.onclick = cancelAsk; + const ok = el("button", "text primary", t("Restart to update")); + ok.onclick = (e) => { e.stopPropagation(); closeConfirmAsk(); go(); }; + bar.append(el("span", "grow"), later, ok); + ed.append(head, box, bar); + confirmAsk = ed; + openModal(ed); + $("#modal").classList.add("lib"); + ok.focus(NO_SCROLL); + // the notes' answer asks the feed again first, and names a release out + // since the one downloaded (#910), which the restart then waits for + const w = await api(updatePath("update/notes")).catch(() => null); + if (confirmAsk !== ed) return; + if (w?.latest && w.latest !== u.latest) title.textContent = t("Update to {v}", { v: "v" + w.latest }); + if (w?.releases?.length) draw(w.releases); +} + +window.wnShow = showWhatsNew; +window.wnConfirm = confirmUpdate; diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.go index ac2ce1e1a..c7223c64f 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_316_874 // 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); 1,315,316 with the Agents row of a Claude Code or Codex not connected saying the account it is signed in to and switching it to another (Switch accounts only, the owner on X), in place of the failover line's ChatGPT accounts button, the Agents page's, the core's own, its comments cut down, with no room added (10-30); 1,317,705 with a Claude account added from a setup-token (sfss5362 on X): the sign-in's Use a setup-token instead…, its sheet, and its account row's magpie only, the provider editor's account rows, the core's own editor, its comments cut down, with no room added (10-30); back to 1,315,316 with the setup-token sheet and Copilot's GHE.com one moved out to signsheets.js, loaded when one is asked for (signAsk, 10-30); 1,315,479 with the provider editor lining its Advanced up with its fields (the owner: 高级这个折叠按钮为什么在一个前不着村后不着店的位置?) and a refresh on each of its accounts (在这里也要加上手动刷新用量的按钮), the core's own editor, with no room added (10-31); 1,315,603 with About's Log row, the path of the log the app writes and an Open for its folder (rayem1w on X), in app.js, its comment cut to one line, with no room added (10-31); 1,316,781 with a provider's model listed by an id of the user's (zeewell on X), the provider editor's Names & levels Listed as box beside Same as, the core's own editor, with no room added (10-31); 1,316,874 with a package manager's magpie (the AUR's magpie-bin) naming the command that updates it in Settings' Version row and lighting no Update pill (shuhai on Discord), the core's own update row, which the tray panel reads too, its comments cut to one line, with no room added (10-31) - coreScriptBudget = 1_541_798 // 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); 1,532,602 with a plugin's README waiting for its bird to land on three lines before it goes in, however soon it came (the owner, 10-30), in plugins.js, with no room added; 1,536,357 with Switch accounts only on the Agents row (the owner on X), in app.js, with no room added (10-30); 1,537,034 with a plugin's README read once shown at once, with no bird, when its page opens again and read again behind it, the last 20 kept (the owner), in plugins.js, with no room added (10-30); 1,539,423 with a Claude account added from a setup-token (sfss5362 on X), in app.js, with no room added (10-30); 1,538,975 with purposes.js written as compact JSON by genpurposes and the MCP tool purpose in it, 448 bytes less in all (ferock on Discord), lowered to it (10-30); 1,536,586 with the setup-token sheet and Copilot's GHE.com one moved out to signsheets.js, lowered by the 2,389 the setup-token raised it (10-30); 1,536,631 with the 45 bytes b62fa332f added to app.js (Send requests unmasked for subscriptions and plugin providers too) without a raise, with no room added (10-31); 1,537,356 with Settings › Models › Replies › Claude Code's interactive mode, a row beside Short Claude system prompt (the owner), in app.js, with no room added (10-31); Long conversations in Codex's row naming the config.toml keys Codex reads before it, with Take it out, and the window magpie tells Codex for the model it runs (zgjfjfl on Discord) raised it to 1,537,669, and it is back under 1,537,356 with the key list and the window's size written by the server (codexKeysText, tokensSize) and the row's words cut, no raise (10-31); 1,538,554 with the same two, with no room added (10-31); 1,538,678 with About's Log row (rayem1w on X), with no room added (10-31); 1,539,856 with a model's Listed as id (zeewell on X), in app.js, with no room added (10-31); 1,541,427 with Tuned for you's Codex row offering the advice to background compaction, its foreground limit kept (herman_hong on Discord), in context.js, which Usage and Routing draw, the Codex-too-old line shared with Settings' row (codexHeld, app.js 278 bytes less), with no room added (10-31); 1,541,798 with a package manager's magpie naming its command (shuhai on Discord), in app.js, with no room added (10-31) + coreScriptBudget = 1_539_856 // 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); 1,532,602 with a plugin's README waiting for its bird to land on three lines before it goes in, however soon it came (the owner, 10-30), in plugins.js, with no room added; 1,536,357 with Switch accounts only on the Agents row (the owner on X), in app.js, with no room added (10-30); 1,537,034 with a plugin's README read once shown at once, with no bird, when its page opens again and read again behind it, the last 20 kept (the owner), in plugins.js, with no room added (10-30); 1,539,423 with a Claude account added from a setup-token (sfss5362 on X), in app.js, with no room added (10-30); 1,538,975 with purposes.js written as compact JSON by genpurposes and the MCP tool purpose in it, 448 bytes less in all (ferock on Discord), lowered to it (10-30); 1,536,586 with the setup-token sheet and Copilot's GHE.com one moved out to signsheets.js, lowered by the 2,389 the setup-token raised it (10-30); 1,536,631 with the 45 bytes b62fa332f added to app.js (Send requests unmasked for subscriptions and plugin providers too) without a raise, with no room added (10-31); 1,537,356 with Settings › Models › Replies › Claude Code's interactive mode, a row beside Short Claude system prompt (the owner), in app.js, with no room added (10-31); Long conversations in Codex's row naming the config.toml keys Codex reads before it, with Take it out, and the window magpie tells Codex for the model it runs (zgjfjfl on Discord) raised it to 1,537,669, and it is back under 1,537,356 with the key list and the window's size written by the server (codexKeysText, tokensSize) and the row's words cut, no raise (10-31); 1,538,554 with the same two, with no room added (10-31); 1,538,678 with About's Log row (rayem1w on X), with no room added (10-31); 1,539,856 with a model's Listed as id (zeewell on X), in app.js, with no room added (10-31); Tuned for you's Codex row offering the advice to background compaction (herman_hong on Discord) and a package manager's magpie naming its command (shuhai on Discord) took it to 1,541,798, and the release notes' dialogs (What's new, the update's ask) moved out to whatsnew.js, loaded when one opens, brought it back under 1,539,856, no raise (10-31) ) func TestCoreScriptBudget(t *testing.T) { diff --git a/internal/gui/tests/old-webkit.test.cjs b/internal/gui/tests/old-webkit.test.cjs index 1dc06013a..0bb9bc295 100644 --- a/internal/gui/tests/old-webkit.test.cjs +++ b/internal/gui/tests/old-webkit.test.cjs @@ -147,8 +147,9 @@ test("compat.js is the first of the page's own scripts", async () => { // a provider editor draws its rate windows, traywindows.js when the menu // bar shows a card, autoresetown.js when Settings draws Codex's auto-use // rows, registry.js when Plugins draws its npm registry, navlamp.js when - // the sidebar draws a sub-list; the checks above still read them - for (const f of await scripts()) if (!["webfonts.js", "cfgblocked.js", "signsheets.js", "ruleedit.js", "ratewindows.js", "traywindows.js", "autoresetown.js", "registry.js", "navlamp.js"].includes(f)) assert(all.includes(f), f + " is not loaded by index.html"); + // the sidebar draws a sub-list, whatsnew.js when release notes open; the + // checks above still read them + for (const f of await scripts()) if (!["webfonts.js", "cfgblocked.js", "signsheets.js", "ruleedit.js", "ratewindows.js", "traywindows.js", "autoresetown.js", "registry.js", "navlamp.js", "whatsnew.js"].includes(f)) assert(all.includes(f), f + " is not loaded by index.html"); }); test("the styles hold up in Safari 15.0", async () => {