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>
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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": "样式组合",
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<div class="intro-copy">
|
||||
<h1>Output Strategy</h1>
|
||||
<p class="lede">Inject selected writing rules into model requests. Combine freely; all off by default.</p>
|
||||
<p class="attribution">An (unofficial) output-style plugin for magpie, developed and maintained by manjughosa.</p>
|
||||
</div>
|
||||
<p class="selection-count" aria-live="polite">
|
||||
<strong id="selectedCount">0 / 7</strong>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user