From dba24067c2d753c2197ede6bc4c6884e84d386cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=B1j=C5=AB=E1=B9=A3aka?= <153098568+manjughosa@users.noreply.github.com> Date: Wed, 11 Nov 2026 23:37:38 +0800 Subject: [PATCH] output-strategy 0.2.3: remove the panel byline; keep attribution in the README (#1009) Removes the "by" byline from the Output Strategy panel (index.html, i18n.js, style.css); the attribution stays in the README. Bumps the package to 0.2.3 so dist packs it (0.2.2 is already packed and is never packed again). Run at the reviewed head 121f571f (on mote, temp HOME): - `git diff 0d03f7bf 121f571f`: only package.json 0.2.2 -> 0.2.3 and the matching version assertion in test/page.test.mjs. Everything else was reviewed at 0d03f7bf. - packages/output-strategy `bun test`: 59 pass, 0 fail. `bun scripts/check.mjs`: ok. - Root `bun test` (suite lock) on origin/main a69931ec merged with #1009, #1012 and #1013: 8373 pass, 0 fail (8392 tests across 590 files, 361s; the rest skipped), on Linux (Ubuntu 24.04, magpie-desktop) because both Macs' suite locks were held by hours-long runs. `bun scripts/check.mjs` on that tree: ok. - Earlier, at 0d03f7bf: Playwright 1.62 Chromium and WebKit at 1200 and 420px, en and zh-CN, with a stub bridge. No byline, the conversation note shows, all 7 styles load, no horizontal overflow, no page errors. Broken by hand (at 0d03f7bf): putting main's page/index.html back, or main's page/i18n.js, makes 1 test fail ("shows conversation guidance in both languages without a panel byline"). Not tried: the panel inside a real magpie window. Co-authored-by: manjughosa <3220325975@qq.com> --- packages/output-strategy/package.json | 3 +-- packages/output-strategy/page/i18n.js | 1 - packages/output-strategy/page/index.html | 1 - packages/output-strategy/page/style.css | 6 ------ packages/output-strategy/test/page.test.mjs | 9 ++++----- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/packages/output-strategy/package.json b/packages/output-strategy/package.json index 30e9cd2..4260b31 100644 --- a/packages/output-strategy/package.json +++ b/packages/output-strategy/package.json @@ -1,10 +1,9 @@ { "name": "@magpie-community/middleware-output-strategy", - "version": "0.2.2", + "version": "0.2.3", "description": "Composable output-style instructions injected before the model call, with a small selection panel", "type": "module", "license": "MIT", - "author": "manjughosa (https://github.com/manjughosa)", "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", diff --git a/packages/output-strategy/page/i18n.js b/packages/output-strategy/page/i18n.js index 1cdf1d5..6e10dba 100644 --- a/packages/output-strategy/page/i18n.js +++ b/packages/output-strategy/page/i18n.js @@ -6,7 +6,6 @@ var ZH = { "Output Strategy": "输出策略", "Inject selected writing rules into model requests. Combine freely; all off by default.": "把选中的写作规则注入模型请求。可自由组合,全部默认关闭。", - "An (unofficial) output-style plugin for magpie, developed and maintained by manjughosa.": "本插件由 manjughosa 独立开发并维护,非官方出品。", "Saving does not rewrite conversation history. Existing conversations may retain previously injected rules; start a new conversation to fully switch or turn off styles.": "保存不会改写会话历史。已有会话可能保留先前注入的规则;要完整切换或关闭样式,请新建会话。", "selected": "已选择", "Style combinations": "样式组合", diff --git a/packages/output-strategy/page/index.html b/packages/output-strategy/page/index.html index b205138..9bf1a76 100644 --- a/packages/output-strategy/page/index.html +++ b/packages/output-strategy/page/index.html @@ -12,7 +12,6 @@

Output Strategy

Inject selected writing rules into model requests. Combine freely; all off by default.

-

An (unofficial) output-style plugin for magpie, developed and maintained by manjughosa.

0 / 7 diff --git a/packages/output-strategy/page/style.css b/packages/output-strategy/page/style.css index 885586c..de8bc79 100644 --- a/packages/output-strategy/page/style.css +++ b/packages/output-strategy/page/style.css @@ -66,12 +66,6 @@ h1 { font-size: 15px; } -.attribution { - margin: 10px 0 0; - color: var(--muted); - font-size: 12px; -} - #conversationNote { margin-bottom: 14px; } .selection-count { diff --git a/packages/output-strategy/test/page.test.mjs b/packages/output-strategy/test/page.test.mjs index 50d43b8..d5a74c1 100644 --- a/packages/output-strategy/test/page.test.mjs +++ b/packages/output-strategy/test/page.test.mjs @@ -245,7 +245,7 @@ describe("host language", () => { const closes = (css.match(/}/g) || []).length expect(closes).toBe(opens) expect(css).toContain("padding-top: 28px;\n }\n}\n\n@media (max-width: 460px)") - expect(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version).toBe("0.2.2") + expect(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version).toBe("0.2.3") }) test("falls back safely when host theme is missing", () => { @@ -255,17 +255,16 @@ describe("host language", () => { expect(sandbox.document.documentElement.lang).toBe("en") }) - test("shows author attribution and conversation guidance in both languages", () => { + test("shows conversation guidance in both languages without a panel byline", () => { const html = readFileSync(new URL("../page/index.html", import.meta.url), "utf8") - const author = "An (unofficial) output-style plugin for magpie, developed and maintained by manjughosa." const note = "Saving does not rewrite conversation history. Existing conversations may retain previously injected rules; start a new conversation to fully switch or turn off styles." - expect(html).toContain(author) expect(html).toContain(note) + expect(html.toLowerCase()).not.toContain("manjughosa") const sandbox = { document: { documentElement: {}, body: null }, magpie: { theme: { lang: "zh-CN" } } } vm.createContext(sandbox) vm.runInContext(i18nSource, sandbox) - expect(sandbox.OutputStrategyI18n.t(author)).toBe("本插件由 manjughosa 独立开发并维护,非官方出品。") expect(sandbox.OutputStrategyI18n.t(note)).toBe("保存不会改写会话历史。已有会话可能保留先前注入的规则;要完整切换或关闭样式,请新建会话。") + expect(i18nSource.toLowerCase()).not.toContain("manjughosa") }) test("ships English HTML and no private stats or local language switch", () => {