From ba4b7b05458c80e63e454fbe2ff359e21f28fd34 Mon Sep 17 00:00:00 2001 From: YangHonghang <60209620+YangHonghang@users.noreply.github.com> Date: Thu, 5 Nov 2026 14:56:39 +0800 Subject: [PATCH] window-warmup 0.1.3: a task's editor opens under its own row, and the footer link no longer restyles the editor's buttons (#752) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renderList used to append the task editor after every row, so opening a task that wasn't the last one, or starting a new task while saved ones were listed, put the editor at the bottom of the list. Now the editor follows the row it opened: under the clicked task, or under the new row at the top. The footer's 反馈问题 button had reused the `.link` class, so its 11.5px faint rule restyled the editor's 立即发送一次 and 重试 buttons. The footer now has its own `.foot-link`. window-warmup goes 0.1.2 -> 0.1.3. The browser smoke test (Chromium and WebKit) checks three things. Opening the first of two saved tasks puts the editor right under that row and not last in the list. Clicking 新建任务 then puts it right under the new top row, with one editor and not last. 立即发送一次 computes to 12px while the footer computes to 11.5px. Run at the reviewed head b5787fee (on mote, macOS, Bun 1.4.2, Playwright 1.62.0 Chromium + WebKit): - package `bun test`: 265 pass, 0 fail, browser smoke included in both engines. The browser file ran again on its own: 6 pass, 0 fail. - `tsc --noEmit` (typescript 5.9.3, @types/bun 1.4.4): exit 0. - `bun scripts/build.ts` rebuilds `dist/` byte for byte. - `bun scripts/check.mjs`: window-warmup passes. - repo root `HOME=$(mktemp -d) bun test`: 5926 tests, 0 fail. Browser tests skip at the root because bun test doesn't read NODE_PATH. - merges cleanly onto main f2dc68c1. PR CI (test, on-npm) green. Broken by hand, rebuilt into dist/, browser file run again each time: - Only the new-task branch put back (editor appended after the loop): red in both engines. The wait for the editor under the top row times out after 15s. - Footer back on `.link` in index.html and style.css: red in both engines, with run 11.5px instead of 12px. - The whole old renderList: red in both engines, with editorIsLast true and prevIsOpenRow false. - Head restored: green in both engines. Not tried: the page inside a real magpie window. --- packages/window-warmup/dist/plugin.js | 2 +- packages/window-warmup/dist/ui/app.js | 6 +- packages/window-warmup/dist/ui/index.html | 2 +- packages/window-warmup/dist/ui/style.css | 4 +- packages/window-warmup/package.json | 2 +- packages/window-warmup/tests/browser.test.ts | 78 ++++++++++++++++++++ packages/window-warmup/web/app.ts | 5 +- packages/window-warmup/web/index.html | 2 +- packages/window-warmup/web/style.css | 4 +- 9 files changed, 92 insertions(+), 13 deletions(-) diff --git a/packages/window-warmup/dist/plugin.js b/packages/window-warmup/dist/plugin.js index 082a6be..a0a0654 100644 --- a/packages/window-warmup/dist/plugin.js +++ b/packages/window-warmup/dist/plugin.js @@ -963,7 +963,7 @@ import { randomBytes, timingSafeEqual } from "crypto"; import { readFile as readFile3 } from "fs/promises"; import path2, { basename, extname, join as join3, resolve as resolve2 } from "path"; // package.json -var version = "0.1.2"; +var version = "0.1.3"; // src/diagnostics.ts var DIAGNOSTICS_SCHEMA = "window-warmup-diagnostics/1"; diff --git a/packages/window-warmup/dist/ui/app.js b/packages/window-warmup/dist/ui/app.js index c891f0a..1652fad 100644 --- a/packages/window-warmup/dist/ui/app.js +++ b/packages/window-warmup/dist/ui/app.js @@ -1718,13 +1718,13 @@ function renderList() { return nodes; } if (isNew && draft) - nodes.push(rowEl(draft, null, true)); + nodes.push(rowEl(draft, null, true), buildEditor()); for (const t of tasks) { const open = openId === t.id; nodes.push(rowEl(open && draft ? draft : t, t, open)); + if (open && draft) + nodes.push(buildEditor()); } - if (openId && draft) - nodes.push(buildEditor()); return nodes; }); restoreFocus(list, focus); diff --git a/packages/window-warmup/dist/ui/index.html b/packages/window-warmup/dist/ui/index.html index 4556998..af4c62f 100644 --- a/packages/window-warmup/dist/ui/index.html +++ b/packages/window-warmup/dist/ui/index.html @@ -17,7 +17,7 @@
- + diff --git a/packages/window-warmup/dist/ui/style.css b/packages/window-warmup/dist/ui/style.css index 0b6885d..dd3bffd 100644 --- a/packages/window-warmup/dist/ui/style.css +++ b/packages/window-warmup/dist/ui/style.css @@ -149,8 +149,8 @@ input.text::placeholder { color:var(--faint); } /* 反馈问题:页脚的低调文字入口 + 两步复制面板(沙箱里打不开外链,只能复制) */ .foot { display:flex; justify-content:flex-end; margin-top:10px; } -.link { color:var(--faint); font-size:11.5px; padding:2px 4px; } -.link:hover { color:var(--fg-2); text-decoration:underline; } +.foot-link { color:var(--faint); font-size:11.5px; padding:2px 4px; } +.foot-link:hover { color:var(--fg-2); text-decoration:underline; } .fb { margin-top:6px; background:var(--card); border:1px solid var(--line); border-radius:10px; padding:10px 12px; display:flex; flex-direction:column; gap:8px; } .fb .hint { margin-top:0; } .fb-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; } diff --git a/packages/window-warmup/package.json b/packages/window-warmup/package.json index 61a254c..365893a 100644 --- a/packages/window-warmup/package.json +++ b/packages/window-warmup/package.json @@ -1,6 +1,6 @@ { "name": "@magpie-community/page-window-warmup", - "version": "0.1.2", + "version": "0.1.3", "description": "窗口预热 Window Warmup:定时消息插件,定时给指定供应商/账号/模型发一条短消息,在额度窗口重置后、每天定时或每隔几小时自动预热保活,提前开启5小时/每周订阅额度(配额)窗口,适用 Codex、Claude、GLM 智谱、ZCode 等。Scheduled keep-alive message to warm up quota / usage / rate limit windows after reset (cron-like).", "author": "YangHonghang (https://github.com/YangHonghang)", "type": "module", diff --git a/packages/window-warmup/tests/browser.test.ts b/packages/window-warmup/tests/browser.test.ts index d9a586f..e2bc173 100644 --- a/packages/window-warmup/tests/browser.test.ts +++ b/packages/window-warmup/tests/browser.test.ts @@ -30,6 +30,8 @@ interface FrameLocator { } interface Page { frameLocator(selector: string): FrameLocator; + evaluate