Skip to content

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

providers: Picked only after Vendor's list gives the picks back (yyddbds)

yetonea72696cc4a73
diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js
index 33e2ef61d..045bb1d3e 100644
--- a/internal/gui/assets/app.js
+++ b/internal/gui/assets/app.js
@@ -9058,7 +9058,7 @@ function drawEditor(p, presetID) {
const another = isNew && !!pr?.added;
// an editor opened afresh has Names & levels folded: it stayed open in
// every editor after, until magpie was restarted (Hu9956, #868)
- if (!draft) naming = unpickedShown = null;
+ if (!draft) naming = unpickedShown = picksLeft = null;
draft = draft || (p
? draftOf(p)
: pr
@@ -10950,6 +10950,10 @@ let modelsOpen = false;
// other n; a click on a model shows them all, so nothing vanishes while
// picking, and Picked only clicked folds them away again
let unpickedShown = null;
+// picksLeft: the picks Vendor's list or Usage only set aside, given back
+// when Picked only is clicked again in the same editor (yyddbds: to the
+// list and back, every model came back picked, the 24 the list serves)
+let picksLeft = null;
const MCHIPS_MAX = 240;
// emptyModelsHint is what an empty model list says. Azure OpenAI's is its
// deployments, asked for with the key after it is added (#1995): while that
@@ -11585,9 +11589,11 @@ function renderModels(p) {
b.dataset.serves = v;
b.title = t(tip, { n: 24 });
b.onclick = () => {
+ if (v !== "picked" && draft.chosen.length) picksLeft = { id: p.id, picks: [...draft.chosen] };
if (v === "list") { draft.chosen = []; draft.typed = ""; draft.none = false; }
else if (v === "none") { draft.chosen = []; draft.typed = ""; draft.none = true; }
else {
+ if (!draft.chosen.length && picksLeft?.id === p.id) { draft.chosen = picksLeft.picks; draft.none = true; }
if (!draft.chosen.length) { draft.chosen = p.models.filter((m) => !noAPI(m)).slice(0, 24).map((m) => m.id); draft.none = true; }
unpickedShown = null;
}
diff --git a/internal/gui/tests/provider-picked-only-shows-picks.test.cjs b/internal/gui/tests/provider-picked-only-shows-picks.test.cjs
index 506755ae0..cbc381b50 100644
--- a/internal/gui/tests/provider-picked-only-shows-picks.test.cjs
+++ b/internal/gui/tests/provider-picked-only-shows-picks.test.cjs
@@ -5,7 +5,9 @@
// ticked, all 8 still shown under 仅所选). The others wait behind Show the
// other n; a click on a model while picking leaves them all in sight, and
// Picked only clicked again folds them away. Vendor's list and Usage only
-// show every model. In every language, Chromium and WebKit, at 1100 and 420.
+// show every model, and Picked only after them gives the picks back (to
+// the list and back, every model came back picked). In every language,
+// Chromium and WebKit, at 1100 and 420.
const assert = require("node:assert/strict");
const fs = require("node:fs/promises");
const path = require("node:path");
@@ -86,6 +88,18 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const box = await rest.boundingBox(), ed = await editor.boundingBox();
assert.ok(box && box.x >= ed.x - 1 && box.x + box.width <= ed.x + ed.width + 1, "the button fits the editor");
+ // to the vendor's list and back (yyddbds' second report: back on
+ // Picked only, every model came back picked), and by Usage only: the
+ // same 3 picks, the others behind the button
+ for (const away of ["list", "none"]) {
+ await seg(away).click();
+ assert.deepEqual(await shown(), names.map(([, n]) => n), away + ": every model");
+ await seg("picked").click();
+ assert.deepEqual(await shown(), picked.map(nameOf), "back from " + away + ": the picks, not the list");
+ assert.equal(await editor.locator(".mchips .mchip:not(.on)").count(), 0);
+ assert.equal((await rest.innerText()).trim(), w.rest);
+ }
+
// shown, all 8 are there to pick from, and a pick keeps them in sight
await rest.click();
assert.deepEqual(await shown(), names.map(([, n]) => n));