Skip to content

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

gui: every slow page's skeletons get magpie's bird hopping bar to bar

yetoneed5cc959a70e
diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css
index 05f232f4c..103ef1cb1 100644
--- a/internal/gui/assets/app.css
+++ b/internal/gui/assets/app.css
@@ -1068,6 +1068,15 @@ body.masked :hover > .acct-eye, body.masked :focus-within > .acct-eye, .acct-eye
@media (prefers-reduced-motion: reduce) { .quota-refresh { transition: none; } }
.skeleton { display: block; border-radius: 5px; background: linear-gradient(90deg, var(--skel, var(--pill)) 25%, var(--skel-hi, var(--pill-hover)) 45%, var(--skel, var(--pill)) 65%); background-size: 240% 100%; animation: skeleton-shift 1.4s ease-in-out infinite; }
@keyframes skeleton-shift { from { background-position: 100% 0; } to { background-position: -100% 0; } }
+/* magpie's bird on what is loading, placed by its feet (skelBird, and the
+ plugin page's README strings) */
+.sk-bird { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 1; pointer-events: none; }
+.sk-bird.roam { position: fixed; z-index: 32; }
+.sk-bird svg { position: absolute; left: -13.2px; top: -19.6px; width: 22px; height: 22px; color: var(--fg); fill: currentColor; overflow: visible; }
+.sk-bird .tail { transform-box: view-box; transform-origin: 14px 22px; }
+.sk-bird .wing { transform-box: view-box; transform-origin: 30px 19.8px; }
+.sk-bird[data-flap] .wing { animation: sk-flap .16s ease-in-out infinite alternate; }
+@keyframes sk-flap { from { transform: rotate(-22deg); } to { transform: rotate(18deg); } }
.sk-cost { width: 72px; height: 15px; }
.skeleton-card { min-height: 78px; display: flex; flex-direction: column; gap: 9px; justify-content: center; }
.sk-title { width: 38%; height: 12px; }
@@ -3670,7 +3679,7 @@ body.panel .modal { padding: 16px 12px; }
the old one, and the page stayed a few pixels wider than the window
(#2142, #1864, #2023). No specificity: any transition declared wins. */
:where(*), :where(*)::before, :where(*)::after { transition-property: none; }
- .skeleton { animation: none !important; }
+ .skeleton, .sk-bird .wing { animation: none !important; }
}
/* A browser on a phone: keep the desktop and tray's layout independent.
diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js
index f8f7bf36b..5aea36b18 100644
--- a/internal/gui/assets/app.js
+++ b/internal/gui/assets/app.js
@@ -8240,6 +8240,89 @@ const SPRING = CSS.supports?.("animation-timing-function", "linear(0, 1)")
const IOS_EASE = "cubic-bezier(.32, .72, 0, 1)";
// a declaration, so code above it can ask too
function calm() { return matchMedia("(prefers-reduced-motion: reduce)").matches; }
+// magpie's bird in parts, its wing and tail free to move (the header's logo
+// holds the shapes)
+const BIRD = `<svg viewBox="0 0 44 44"><use href="#bird" clip-path="url(#bird-body)"/><g class="tail"><use href="#bird" clip-path="url(#bird-tail)"/></g><g class="wing"><use href="#bird" clip-path="url(#bird-wing)"/></g></svg>`;
+// what is loading, with magpie's bird on it (the owner, after the plugin
+// page's README): skeletons still up after a moment, as on a slow page, get
+// the bird. It drops onto one, hops from bar to bar, each bar giving under
+// its feet, and flies off once none is left. One bird for the window, over
+// whatever page or dialog shows them; a quick load never sees it, and with
+// reduced motion the bars stand still and no bird comes.
+const SKEL = ".skeleton, .pm-card.ghost .sk";
+// the skeletons a reader sees now: on screen, big enough to stand on, and
+// not under a dialog or out of their scroller
+function skelSeen() {
+ const out = [];
+ for (const s of document.querySelectorAll(SKEL)) {
+ const r = s.getBoundingClientRect();
+ if (r.width < 16 || r.height < 4 || r.top < 24 || r.bottom > innerHeight || r.left < 0 || r.right > innerWidth) continue;
+ const hit = document.elementFromPoint(r.left + r.width / 2, r.top + Math.min(r.height / 2, 3));
+ // a bar that lets clicks through hits what holds it
+ if (hit && (s.contains(hit) || hit.contains(s))) out.push(s);
+ }
+ return out;
+}
+let skelSince = 0, skelFlying = false;
+setInterval(() => {
+ if (skelFlying || document.hidden || calm() || !document.querySelector(SKEL)) return (skelSince = 0);
+ if (!skelSince) return (skelSince = Date.now());
+ if (Date.now() - skelSince >= 450 && skelSeen().length) skelBird();
+}, 250);
+async function skelBird() {
+ skelFlying = true;
+ const b = el("div", "sk-bird roam");
+ b.innerHTML = BIRD;
+ document.body.append(b);
+ let x = 0, y = 0, f = 1, r = 0, sx = 1, sy = 1;
+ const put = (o) => { ({ x = x, y = y, f = f, r = r, sx = sx, sy = sy } = o); b.style.transform = `translate(${x}px,${y}px) rotate(${r * f}deg) scale(${f * sx},${sy})`; };
+ const tween = (ms, fn, ease = (t) => t) => new Promise((ok) => {
+ const t0 = performance.now();
+ const step = (now) => { const t = Math.min(1, (now - t0) / ms); fn(ease(t), t); t < 1 ? requestAnimationFrame(step) : ok(); };
+ requestAnimationFrame(step);
+ });
+ const easeIn = (t) => t * t * t, easeOut = (t) => 1 - (1 - t) ** 3;
+ // where on a bar it lands: somewhere along it, clear of its ends
+ const spot = (s) => { const q = s.getBoundingClientRect(); return { x: q.left + Math.min(14, q.width / 3) + Math.random() * Math.max(0, q.width - 2 * Math.min(14, q.width / 3)), y: q.top }; };
+ // the next bar: the nearest one after this one, and back to the first
+ const next = (s) => {
+ const seen = skelSeen().filter((t) => t !== s);
+ if (!seen.length || !s?.isConnected) return seen[0];
+ const after = seen.filter((t) => s.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING);
+ return after[0] || seen[0];
+ };
+ let s = next(null);
+ if (!s) return void (b.remove(), (skelFlying = false));
+ try {
+ let at = spot(s);
+ put({ x: at.x - 24, y: at.y - 40, f: 1 });
+ await tween(300, (e, t) => put({ x: at.x - 24 + 24 * t, y: at.y - 40 + 40 * e, sx: 1 - .05 * t, sy: 1 + .08 * t }), easeIn);
+ for (let hops = 0; hops < 400; hops++) {
+ // it lands: the bar dips under it and springs back
+ s.animate([{ transform: "none" }, { transform: "translateY(3px)", offset: .3 }, { transform: "translateY(-1.2px)", offset: .6 }, { transform: "translateY(.4px)", offset: .8 }, { transform: "none" }], { duration: 560, easing: "ease-out" });
+ await tween(130, (e) => put({ y: at.y + 3 * e, sx: 1 + .14 * e, sy: 1 - .18 * e }), easeOut);
+ await tween(90, (e) => put({ y: at.y + 3 * (1 - e), sx: 1.14 - .14 * e, sy: .82 + .18 * e }), easeIn);
+ const to = next(s);
+ if (!to) break;
+ const from = { x, y }, go = spot(to), h = 16 + Math.min(40, Math.hypot(go.x - from.x, go.y - from.y) * .15);
+ put({ f: go.x >= from.x ? 1 : -1 });
+ await tween(340, (e, t) => {
+ put({ x: from.x + (go.x - from.x) * t, y: from.y + (go.y - from.y) * t - h * 4 * t * (1 - t), sx: 1 - .06 * Math.sin(Math.PI * t), sy: 1 + .12 * Math.sin(Math.PI * t), r: (t - .5) * 20 });
+ });
+ put({ r: 0, sx: 1, sy: 1 });
+ if (!to.isConnected) break;
+ s = to; at = { x, y };
+ }
+ } finally {
+ // nothing left to stand on: it flies off, up and away
+ b.dataset.flap = "";
+ const from = { x, y };
+ await tween(480, (e) => put({ x: from.x + (innerWidth + 60 - from.x) * e, y: from.y - (from.y + 80) * e, f: 1, r: -14, sx: 1, sy: 1 }), easeIn);
+ b.remove();
+ skelFlying = false;
+ skelSince = 0;
+ }
+}
// what was last pressed, and a way to find it again once re-rendered
let pressed = null;
document.addEventListener("pointerdown", (e) => {
diff --git a/internal/gui/assets/plugins.css b/internal/gui/assets/plugins.css
index 5a6a1bec9..11a925d15 100644
--- a/internal/gui/assets/plugins.css
+++ b/internal/gui/assets/plugins.css
@@ -260,12 +260,6 @@ button.pm-chip:disabled { cursor: default; opacity: .6; }
.pm-bounce[data-gone] > svg { opacity: 0; }
.pm-bounce path { fill: none; stroke: var(--skel, var(--pill)); stroke-width: 10; stroke-linecap: round; transition: stroke .35s ease-out; }
.pm-bounce path[data-lit] { stroke: color-mix(in srgb, var(--accent) 18%, var(--skel, var(--pill))); }
-.pm-bird { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 1; }
-.pm-bird svg { position: absolute; left: -13.2px; top: -19.6px; width: 22px; height: 22px; color: var(--fg); fill: currentColor; overflow: visible; }
-.pm-bird .tail { transform-box: view-box; transform-origin: 14px 22px; }
-.pm-bird .wing { transform-box: view-box; transform-origin: 30px 19.8px; }
-.pm-bird[data-flap] .wing { animation: pm-flap .16s ease-in-out infinite alternate; }
-@keyframes pm-flap { from { transform: rotate(-22deg); } to { transform: rotate(18deg); } }
/* a README */
.pm-md { font-size: 12.5px; line-height: 1.6; color: var(--fg-2); overflow-wrap: anywhere; }
@@ -303,6 +297,6 @@ button.pm-chip:disabled { cursor: default; opacity: .6; }
}
@media (prefers-reduced-motion: reduce) {
.pm-card { transition: none; }
- .pm-card.ghost .sk, .pm-bird .wing, .pm-ghlook, .pm-ghlook .dots i, .pm-arrive .pm-card { animation: none; }
+ .pm-card.ghost .sk, .pm-ghlook, .pm-ghlook .dots i, .pm-arrive .pm-card { animation: none; }
.pm-ghlook .dots i { opacity: .5; }
}
diff --git a/internal/gui/assets/plugins.js b/internal/gui/assets/plugins.js
index 5c65cba93..75f5a7d63 100644
--- a/internal/gui/assets/plugins.js
+++ b/internal/gui/assets/plugins.js
@@ -1503,9 +1503,9 @@
// it; leave() sends it off when the README comes. Its marks are data-*,
// not classes, so the dialog's observer doesn't place it again each hop
function bounceLoader() {
- const box = el("div", "pm-bounce"), s = document.createElementNS("http://www.w3.org/2000/svg", "svg"), b = el("div", "pm-bird");
+ const box = el("div", "pm-bounce"), s = document.createElementNS("http://www.w3.org/2000/svg", "svg"), b = el("div", "sk-bird");
s.innerHTML = "<path/><path/><path/><path/>";
- b.innerHTML = `<svg viewBox="0 0 44 44"><use href="#bird" clip-path="url(#bird-body)"/><g class="tail"><use href="#bird" clip-path="url(#bird-tail)"/></g><g class="wing"><use href="#bird" clip-path="url(#bird-wing)"/></g></svg>`;
+ b.innerHTML = BIRD;
box.append(s, b);
const ps = [...s.children], ws = [1, .94, .6, .82], at = [.16, .44, .3, .58];
const L = ws.map((w, i) => ({ y: 31 + i * 22, d: 0, v: 0, bx: 0, hold: false }));
diff --git a/internal/gui/core_budget_test.go b/internal/gui/core_budget_test.go
index 7ad4b1a92..7d6c2bfed 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_321_319 // 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)
- coreScriptBudget = 1_537_645 // 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)
+ appScriptBudget = 1_325_845 // 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)
+ coreScriptBudget = 1_541_967 // 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)
)
func TestCoreScriptBudget(t *testing.T) {
diff --git a/internal/gui/tests/plugin-readme-bird.test.cjs b/internal/gui/tests/plugin-readme-bird.test.cjs
index 821404b30..a16c7db0d 100644
--- a/internal/gui/tests/plugin-readme-bird.test.cjs
+++ b/internal/gui/tests/plugin-readme-bird.test.cjs
@@ -41,8 +41,8 @@ function server(reply) {
const look = (page) => page.evaluate(() => {
const b = document.querySelector("#modal .pm-bounce");
if (!b) return null;
- return { paths: [...b.querySelectorAll("path")].map((p) => p.getAttribute("d")), bird: b.querySelector(".pm-bird").style.transform,
- feet: b.querySelector(".pm-bird svg").getBoundingClientRect().height };
+ return { paths: [...b.querySelectorAll("path")].map((p) => p.getAttribute("d")), bird: b.querySelector(".sk-bird").style.transform,
+ feet: b.querySelector(".sk-bird svg").getBoundingClientRect().height };
});
// how far a line's middle bends below its ends
const bend = (d) => { const n = (d || "").match(/-?[\d.]+/g)?.map(Number) || []; return n.length < 14 ? 0 : n[7] - n[1]; };
@@ -82,7 +82,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
if (n.length >= 14) out.bend = Math.max(out.bend, n[7] - n[1]);
}
out.lit = Math.max(out.lit, b.querySelectorAll("path[data-lit]").length);
- out.places.add(b.querySelector(".pm-bird").style.transform);
+ out.places.add(b.querySelector(".sk-bird").style.transform);
if (performance.now() - t0 > 2000) return done({ bend: out.bend, places: out.places.size, lit: out.lit });
requestAnimationFrame(step);
};
diff --git a/internal/gui/tests/skeleton-bird.test.cjs b/internal/gui/tests/skeleton-bird.test.cjs
new file mode 100644
index 000000000..9f87cb7b8
--- /dev/null
+++ b/internal/gui/tests/skeleton-bird.test.cjs
@@ -0,0 +1,107 @@
+// Run with Node's test runner and Playwright on the module path; see README.md.
+// What is loading has magpie's bird on it (the owner, 10-26): skeletons
+// still up after a moment, as on a slow page, get the bird, which hops from
+// bar to bar, each bar dipping under it, and flies off once they are gone.
+// A quick load never sees it, and with reduced motion no bird comes.
+const assert = require("node:assert/strict");
+const fs = require("node:fs/promises");
+const path = require("node:path");
+const { test } = require("node:test");
+const { chromium, webkit } = require("playwright");
+
+const assets = path.resolve(__dirname, "../assets");
+const listings = [{ package: "opencode-copilot-auth", name: "GitHub Copilot", icon: "githubcopilot", providers: ["github-copilot"],
+ summary: { en: "Your GitHub Copilot plan." }, npm: { version: "0.0.9", weekly: 48213, publisher: "thdxr" } }];
+
+function server(market) {
+ return async (route) => {
+ const url = new URL(route.request().url());
+ const json = (data) => route.fulfill({ json: data });
+ if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:"en",theme:"light",web:false};` });
+ if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
+ if (url.pathname === "/api/state") return json({ agents: [], profiles: [], settings: { lang: "en", theme: "light" } });
+ if (url.pathname === "/api/providers") return json({ providers: [], presets: [], excluded: [], gateway: { running: true, window: true }, plugins: [] });
+ if (url.pathname === "/api/groups") return json({ groups: [], pools: [] });
+ const state = { bun: true, bunVersion: "1.3.0", plugins: [] };
+ if (url.pathname === "/api/plugins/market") { await market(); return json({ listings, state }); }
+ if (url.pathname === "/api/plugins") return json(state);
+ if (url.pathname === "/api/plugins/listings") { await market(); return json({ listings }); }
+ if (url.pathname.startsWith("/api/")) return json({});
+ if (!/^\/[\w./-]*$/.test(url.pathname) || url.host !== "magpie.test") return route.fulfill({ status: 404, body: "" });
+ const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname);
+ const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];
+ try { await route.fulfill({ body: await fs.readFile(file), contentType }); } catch { await route.fulfill({ status: 404, body: "" }); }
+ };
+}
+
+async function open(browser, reduced, market) {
+ const page = await (await browser.newContext({ viewport: { width: 980, height: 820 }, reducedMotion: reduced ? "reduce" : "no-preference" })).newPage();
+ page.setDefaultTimeout(5000);
+ const errors = [];
+ page.on("pageerror", (e) => errors.push(e.message));
+ await page.addInitScript(() => {
+ // every bird that came, and every bar that dipped
+ window.seen = { birds: 0, places: new Set(), dips: 0 };
+ new MutationObserver((ms) => { for (const m of ms) for (const n of m.addedNodes) if (n.classList?.contains("sk-bird")) seen.birds++; })
+ .observe(document, { childList: true, subtree: true });
+ const step = () => {
+ const b = document.querySelector(".sk-bird.roam");
+ if (b) seen.places.add(b.style.transform);
+ seen.dips = Math.max(seen.dips, document.getAnimations().filter((a) => a.effect?.target?.matches?.(".skeleton, .pm-card.ghost .sk")
+ && a.effect.getKeyframes().some((k) => /translateY/.test(k.transform || ""))).length);
+ requestAnimationFrame(step);
+ };
+ requestAnimationFrame(step);
+ });
+ await page.route("**/*", server(market));
+ await page.goto("http://magpie.test/?view=plugins");
+ return { page, errors };
+}
+
+for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
+ const launch = () => (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: "chromium" }));
+
+ test(engine + ": a slow page's skeletons get the bird, hopping bar to bar, and it flies off when they go", async (t) => {
+ const browser = await launch();
+ t.after(() => browser.close());
+ let release;
+ const held = new Promise((r) => { release = r; });
+ const { page, errors } = await open(browser, false, () => held);
+ await page.locator("#view-plugins .pm-card.ghost").first().waitFor();
+ await page.locator(".sk-bird.roam").waitFor({ state: "attached", timeout: 3000 });
+ await page.waitForFunction(() => seen.places.size > 30 && seen.dips > 0, null, { timeout: 4000 });
+ const feet = await page.evaluate(() => {
+ const r = document.querySelector(".sk-bird.roam svg").getBoundingClientRect();
+ return { w: r.width, h: r.height };
+ });
+ assert(feet.w > 10 && feet.h > 10, `the bird is drawn: ${JSON.stringify(feet)}`);
+ release();
+ await page.waitForFunction(() => !document.querySelector("#view-plugins .pm-card.ghost"));
+ await page.waitForFunction(() => !document.querySelector(".sk-bird"), null, { timeout: 2000 });
+ assert.deepEqual(errors, []);
+ });
+
+ test(engine + ": a quick load never sees the bird", async (t) => {
+ const browser = await launch();
+ t.after(() => browser.close());
+ const { page, errors } = await open(browser, false, () => new Promise((r) => setTimeout(r, 150)));
+ await page.waitForFunction(() => !document.querySelector("#view-plugins .pm-card.ghost"));
+ await page.waitForTimeout(800);
+ assert.equal(await page.evaluate(() => seen.birds), 0, "no bird came");
+ assert.deepEqual(errors, []);
+ });
+
+ test(engine + ": with reduced motion no bird comes and no bar moves", async (t) => {
+ const browser = await launch();
+ t.after(() => browser.close());
+ let release;
+ const held = new Promise((r) => { release = r; });
+ const { page, errors } = await open(browser, true, () => held);
+ await page.locator("#view-plugins .pm-card.ghost").first().waitFor();
+ await page.waitForTimeout(1200);
+ assert.deepEqual(await page.evaluate(() => [seen.birds, seen.dips]), [0, 0]);
+ release();
+ await page.waitForFunction(() => !document.querySelector("#view-plugins .pm-card.ghost"));
+ assert.deepEqual(errors, []);
+ });
+}