gui: the Library's project section is titled by what it holds

The owner (11-12): the MCP tab's 项目中 ("In projects") read oddly over
the servers a project gets. The heading now says what the section is:
"Project servers" on the MCP tab and "Project skills" on the Skills tab,
which shares the section (项目服务器 / 项目技能, 專案伺服器 / 專案技能,
プロジェクトのサーバー / プロジェクトのスキル, Projektserver /
Projekt-Skills).

Run on mica, at this tree: project-servers, project-skills-groups,
project-scope, library-mcp-agentless, library-all, i18n-keys and
i18n-en-no-cjk, chromium and webkit: all ok (6, 12, 6, 22, 26, 4, 4).
project-servers checks the heading in en and zh, project-skills-groups
in every language. Broken by hand (t("In projects") back): both go red,
6 of 6 and 12 of 12.

Not tried: the real app; the change is the heading's words.
This commit is contained in:
yetone
2026-11-13 04:03:55 +08:00
parent 1729e1193a
commit af7edcc02a
6 changed files with 18 additions and 9 deletions
@@ -6117,7 +6117,7 @@ magpie.plugin("library", (ctx) => {
function renderProjects(body, kind) {
const rh = el("div", "row-head");
rh.append(el("span", "label", t("In projects")), el("span", "grow"));
rh.append(el("span", "label", kind === "skills" ? t("Project skills") : t("Project servers")), el("span", "grow"));
if (!addingProject) rh.append(button(t("Add a project"), "action lib-updall", () => { addingProject = { dir: "" }; render(); }));
body.append(rh);
if (addingProject) body.append(addProjectCard(kind));
+8 -4
View File
@@ -713,7 +713,8 @@ magpie.strings({
"not in the library — bring one in to give it to the others": "不在资源库中 — 导入后可以给其他 Agent",
"{agents} has no skills folder.": "{agents} 没有技能文件夹。",
"Claude Desktop shows skill changes once its window is reloaded ({keys}). It gets a copy of each skill, and one you change in Desktop is left as it is.": "Claude Desktop 刷新窗口({keys})后才显示技能变化。它使用技能的副本,在 Desktop 中改过的副本不会被覆盖。",
"In projects": "项目中",
"Project servers": "项目服务器",
"Project skills": "项目技能",
"Add a project": "添加项目",
"Give a project's agents some of these skills as the project's own: magpie links them into its .claude/skills and .agents/skills and keeps them out of git.": "将部分技能作为项目技能提供给项目中的 Agent:链接到项目的 .claude/skills 和 .agents/skills,并让 git 忽略。",
"The project's folder, like ~/code/app": "项目文件夹,例如 ~/code/app",
@@ -1710,7 +1711,8 @@ magpie.strings({
"not in the library — bring one in to give it to the others": "不在資源庫中 — 匯入後可以給其他 Agent",
"{agents} has no skills folder.": "{agents} 沒有技能資料夾。",
"Claude Desktop shows skill changes once its window is reloaded ({keys}). It gets a copy of each skill, and one you change in Desktop is left as it is.": "Claude Desktop 重新整理視窗({keys})後才顯示技能變化。它使用技能的副本,在 Desktop 中改過的副本不會被覆蓋。",
"In projects": "專案中",
"Project servers": "專案伺服器",
"Project skills": "專案技能",
"Add a project": "新增專案",
"Give a project's agents some of these skills as the project's own: magpie links them into its .claude/skills and .agents/skills and keeps them out of git.": "將部分技能作為專案技能提供給專案中的 Agent:連結到專案的 .claude/skills 和 .agents/skills,並讓 git 忽略。",
"The project's folder, like ~/code/app": "專案資料夾,例如 ~/code/app",
@@ -2698,7 +2700,8 @@ magpie.strings({
"not in the library — bring one in to give it to the others": "ライブラリにありません — 取り込むと他のエージェントにも渡せます",
"{agents} has no skills folder.": "{agents} にはスキルフォルダがありません。",
"Claude Desktop shows skill changes once its window is reloaded ({keys}). It gets a copy of each skill, and one you change in Desktop is left as it is.": "Claude Desktop はウィンドウを再読み込み({keys})するとスキルの変更を表示します。各スキルのコピーを受け取り、Desktop で変更したものはそのまま残ります。",
"In projects": "プロジェクト内",
"Project servers": "プロジェクトのサーバー",
"Project skills": "プロジェクトのスキル",
"Add a project": "プロジェクトを追加",
"Give a project's agents some of these skills as the project's own: magpie links them into its .claude/skills and .agents/skills and keeps them out of git.": "プロジェクトのエージェントに、これらのスキルの一部をプロジェクト固有のものとして渡します:magpie はそれらを .claude/skills と .agents/skills にリンクし、git の対象外にします。",
"The project's folder, like ~/code/app": "プロジェクトのフォルダ(例:~/code/app)",
@@ -3691,7 +3694,8 @@ magpie.strings({
"not in the library — bring one in to give it to the others": "nicht in der Bibliothek – übernehmen Sie einen, um ihn den anderen zu geben",
"{agents} has no skills folder.": "{agents} hat keinen Skills-Ordner.",
"Claude Desktop shows skill changes once its window is reloaded ({keys}). It gets a copy of each skill, and one you change in Desktop is left as it is.": "Claude Desktop zeigt Skill-Änderungen erst nach dem Neuladen des Fensters ({keys}). Es erhält von jedem Skill eine Kopie, und eine in Desktop geänderte bleibt unverändert.",
"In projects": "In Projekten",
"Project servers": "Projektserver",
"Project skills": "Projekt-Skills",
"Add a project": "Projekt hinzufügen",
"Give a project's agents some of these skills as the project's own: magpie links them into its .claude/skills and .agents/skills and keeps them out of git.": "Geben Sie den Agenten eines Projekts einige dieser Skills als projekteigene: magpie verlinkt sie in dessen .claude/skills und .agents/skills und hält sie aus git heraus.",
"The project's folder, like ~/code/app": "Der Ordner des Projekts, z. B. ~/code/app",
+1 -1
View File
@@ -97,7 +97,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await browser.close();
});
const open = async (lang, tab, posts, fail, { width = 980, fixture } = {}) => {
const ctx = await browser.newContext({ viewport: { width, height: 800 } }); // the MCP tab fits, its "In projects" too
const ctx = await browser.newContext({ viewport: { width, height: 800 } }); // the MCP tab fits, its "Project servers" too
await ctx.addInitScript((tab) => { try { localStorage.setItem("magpie.libTab", tab); } catch {} }, tab);
const page = await ctx.newPage();
page.setDefaultTimeout(5000);
@@ -123,7 +123,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
assert.equal(await v.locator(".lib-server").count(), 1, where);
assert.equal(await v.locator(".lib-ag, .lib-agents").count(), 0, `${where}: agent chips`);
const text = await v.textContent();
for (const gone of [w("In your agents"), w("In projects"), "Claude Code", "agent-own"]) assert.ok(!text.includes(gone), `${where}: ${gone} is shown`);
for (const gone of [w("In your agents"), w("Project servers"), "Claude Code", "agent-own"]) assert.ok(!text.includes(gone), `${where}: ${gone} is shown`);
assert.equal(await page.locator("select").count(), 0);
// off: what it would do
+4 -2
View File
@@ -73,8 +73,8 @@ const chip = async (page, loc) => {
};
const words = {
en: { none: "No servers yet", one: "fs is in app for Claude Code", on: "fs is in app for Claude Code, Codex", off: "fs is out of app", foot: "Written into .mcp.json, .codex/config.toml of the project" },
zh: { none: "还没有服务器", one: "fs 已写入 app,供 Claude Code 使用", on: "fs 已写入 app,供 Claude Code, Codex 使用", off: "fs 已从 app 移除", foot: "写入项目的 .mcp.json, .codex/config.toml" },
en: { head: "Project servers", none: "No servers yet", one: "fs is in app for Claude Code", on: "fs is in app for Claude Code, Codex", off: "fs is out of app", foot: "Written into .mcp.json, .codex/config.toml of the project" },
zh: { head: "项目服务器", none: "还没有服务器", one: "fs 已写入 app,供 Claude Code 使用", on: "fs 已写入 app,供 Claude Code, Codex 使用", off: "fs 已从 app 移除", foot: "写入项目的 .mcp.json, .codex/config.toml" },
};
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
@@ -101,6 +101,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const card = page.locator("#view-library .lib-project");
await card.waitFor();
assert.equal((await card.locator(".lib-tags").textContent()).trim(), w.none);
// the section says what it holds, never "In projects" (the owner, 11-12)
assert.ok((await page.locator("#view-library .row-head .label").allTextContents()).includes(w.head));
await card.locator(".lib-projhead").scrollIntoViewIfNeeded();
const before = await scrolled(page);
@@ -60,6 +60,7 @@ function server(lang, posts) {
}
const heads = { en: "On this computer", zh: "本机", "zh-TW": "本機", ja: "このコンピュータ", de: "Auf diesem Computer" };
const projHeads = { en: "Project skills", zh: "项目技能", "zh-TW": "專案技能", ja: "プロジェクトのスキル", de: "Projekt-Skills" };
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
test(engine + ": a project's Skills menu is grouped by source", async (t) => {
@@ -80,6 +81,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
await page.locator('button[data-view="library"]').click();
const app = page.locator("#view-library .lib-project").filter({ hasText: "~/code/app" });
await app.waitFor();
// the section says what it holds, never "In projects" (the owner, 11-12)
assert.ok((await page.locator("#view-library .row-head .label").allTextContents()).includes(projHeads[lang]));
await app.locator(".lib-projhead").click();
await app.locator(".lib-projskill").first().waitFor();
const menu = page.locator(".proto-menu");