fix(queue): 账本上限/进行中保留 + 任务队列页工具区与状态修正

This commit is contained in:
qiqi committed 2026-12-03 09:44:35 +08:00
1 parent f5859b7596
commit a0f86bf09c
7 files changed
+16 -15

No files matched your search

+3 -3
View File
@@ -8174,7 +8174,7 @@ const tbCenterSeed = (type, refs) => {
setWsMorePos,
setWsMoreOpen,
})
: (shellView === 'plugins' ? null : el(ProductNav, { shellView, setShellView, setSettingOpen: openSettings, setHelpOpen, toggleTheme, theme }))
: ((shellView === 'plugins' || shellView === 'page') ? null : el(ProductNav, { shellView, setShellView, setSettingOpen: openSettings, setHelpOpen, toggleTheme, theme }))
// 底栏工具栏:稳定动作(useCallback 读 refs/selRef) + 派生状态(拖拽时不变化) → React.memo 跳过重渲,缩小拖拽 re-render 范围
// 工具栏编组/取消编组按钮已移除;多选节点组气泡的禁用态直接用 sel / groupOf 判定,故不再需要派生 canGroup/canUngroup。
const tbOnAdd = React.useCallback((t) => addNode(t, null, null, tbCenterSeed(t, refs)), [])
@@ -8406,7 +8406,7 @@ const tbCenterSeed = (type, refs) => {
const dockPanels = (typeof window !== 'undefined' && window.IWBUIDockPanels)
? window.IWBUIDockPanels.build(PluginHost, wPluginPanels)
: {}
return el('div', { className: 'iwb-overlay' + (shellView === 'landing' ? ' iwb-view-landing' : shellView === 'home' ? ' iwb-view-home' : (shellView === 'plugins' ? ' iwb-view-plugins' : ' iwb-view-canvas')) + (drawerOpen ? ' drawer-open' : '') + ((nodes.length && loaded) ? ' has-minimap' : '') },
return el('div', { className: 'iwb-overlay' + (shellView === 'landing' ? ' iwb-view-landing' : shellView === 'home' ? ' iwb-view-home' : ((shellView === 'plugins' || shellView === 'page') ? ' iwb-view-plugins' : ' iwb-view-canvas')) + (drawerOpen ? ' drawer-open' : '') + ((nodes.length && loaded) ? ' has-minimap' : '') },
// 页面加载动画(真实进度条:src/ui-splash.js + src/boot-progress.js,加载完成后淡出)
!splashDone && window.IWBUISplash ? el(window.IWBUISplash.Splash, { fade: loaded, icon: I('palette') }) : null,
shellView === 'home' ? el('div', { className: 'iwb-home-panel' },
@@ -8504,7 +8504,7 @@ const tbCenterSeed = (type, refs) => {
NavRail ? el(NavRail, {
I,
logoIcon: 'brand',
view: shellView === 'plugins' ? 'plugins' : (shellView === 'home' ? 'home' : 'canvas'),
view: shellView === 'page' ? '' : (shellView === 'plugins' ? 'plugins' : (shellView === 'home' ? 'home' : 'canvas')),
pages: wPluginPages.slice(),
activePage: pluginPage ? (pluginPage.pluginId + ':' + pluginPage.pageId) : '',
onPage: (pid, id) => { setPluginPage({ pluginId: pid, pageId: id }); setShellView('page') },
+1 -1
View File
@@ -22,7 +22,7 @@
- 图片**新写入主通道 = IndexedDB Blob `{__blob}` / key `imgblob_<hash>_<len>`** (A) `app.js:2143`;`{__cache}`(Cache Storage)为兜底;\`ref_\`(`app.js` 内定义的 `IDB_REF_PREFIX = 'ref_'`)为 legacy 形态 (A)。
- 大图判定:`isBigDataUrl` = `data:` 且 `length > 3000` (A) `app.js:2018`;**画布保存保留阈值** `< 16384` 才原样保留 (A) `app.js:2182`。**两处阈值并存,含义不同**。
- 单测是**源码契约测试**:`tests/` 目录共 **493** 处源码文本钉点(`source.includes` / `source.indexOf` / `/re/.test(source)`),分布在 **20** 个文件(其中 `iwb-v32-web-test.js` 一个就占 **407**)→ **结构性重构会先打红测试**。**该数字已由 `tests/source-text-ratchet-test.js` 的「只减不增」棘轮守门**(2026-10-20 起守卫范围从 1 个文件扩到全目录:新增任何一处源码文本钉点都会打红)。**2026-11-12 复算**(`npm run audit:pins`,v3.24.76):二分 STRUCT **417** / NAME **76**;形态 **POS 403 / NEG 87 / COUNT 3**;难度 **易 62 / 中 316 / 难 115**。钉点减法第一批(v3.24.72)把 **537 → 505**:8 条探针钉点改为「门禁内 spec 是否真的读该计数器」、5 条改为运行时断言(生产态 `window` 上无探针)、10 条改为 DOM 断言(质量档位禁用 / 传输页无三模式按钮 / 模型项 title)、4 条改为运行时对象断言(健康检查两域、策略对象冻结)、其余 9 条有同文件 DOM 等价断言或仅剩 NEG。第二批(v3.24.76)把 **505 → 493**:94-5~7 三条「多标签释放语义」(10 处正则)换成 `tests/iwb-tabs-release.spec.js` 的 3 条真 e2e,剩 1 条「消费方契约」(断言该 spec 在门禁内且 spec 源码真的读两个探针);另 2 条 `wPurgeIntent.add` 钉点改为读 `src/workspace-purge.js`。**这一批一换就查出 3 个真缺陷**(objectURL 从未释放 / 彻底删除留孤儿标签 · session / 刷新后误回收打开标签的图)—— 见 CHANGELOG v3.24.76。
- `app.js` = 单 IIFE **9,309 行**(**双层预算**:绝对上限 9,309 / 占总源码 ≤ 40%,现 **26.2%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,652 行**(上限 **2,652**,余量 0;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **128** 个模块 / 26,184 行,`sourceModules` 128 项;v3.24.68 新增 `clipboard-graph.js`,v3.24.74 新增 `image-admit.js`,v3.24.75 新增 `image-dedupe.js`,v3.24.76 新增 `workspace-purge.js`,v3.24.79 新增 `generation-provider-ping.js`,v3.24.80 删除无调用的 `createWBFlushViewport` 17 行)。
- `app.js` = 单 IIFE **9,309 行**(**双层预算**:绝对上限 9,309 / 占总源码 ≤ 40%,现 **26.2%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,652 行**(上限 **2,652**,余量 0;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **128** 个模块 / 26,185 行,`sourceModules` 128 项;v3.24.68 新增 `clipboard-graph.js`,v3.24.74 新增 `image-admit.js`,v3.24.75 新增 `image-dedupe.js`,v3.24.76 新增 `workspace-purge.js`,v3.24.79 新增 `generation-provider-ping.js`,v3.24.80 删除无调用的 `createWBFlushViewport` 17 行)。
- 门禁:`npm run verify` = `verify:ci`(`build` → `node --check app.js` → `node --check dist/app.js` → `check-dist.js` → `lint`(ESLint 正确性规则,`src/` + `app.js`,P4-16a)→ `test:unit` → `test` → `test:facts`)+ `test:e2e` (A) `package.json`。
## 1.5 内存基线(2026-11-30,v3.26.115,Windows / WebView2 实测)
+2 -2
View File
@@ -104,8 +104,8 @@
"style": "styles.css",
"version": "1.0.0",
"files": {
"main.js": "d851da3572c34b89561277ecfc7635dc0e20d6d78c4427c60fe662e4f1b75531",
"styles.css": "eba20885ccd0120cae494a04ca8ff3e92b67766f6d7ed89270e6426a9553bbb6"
"main.js": "f0f6d0e5426dca62e2f7130da2870ad6acc7321c62301ff27d0cc4d4b6243883",
"styles.css": "322e5b2336a87a796bd9c3fcfef99754e19833091d0bc0567ea8afe9d5d61a80"
}
}
]
+1 -1
View File
@@ -99,7 +99,7 @@
el('path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4' }),
el('polyline', { points: '7 10 12 15 17 10' }),
el('line', { x1: '12', x2: '12', y1: '15', y2: '3' })),
el('span', { text: '仅记录' }))
el('span', { text: it.kind === 'only' ? '仅记录' : '' }))
}
function badgeOf (it) {
+2 -2
View File
@@ -13,7 +13,7 @@
"记录"
],
"files": {
"main.js": "d851da3572c34b89561277ecfc7635dc0e20d6d78c4427c60fe662e4f1b75531",
"styles.css": "eba20885ccd0120cae494a04ca8ff3e92b67766f6d7ed89270e6426a9553bbb6"
"main.js": "f0f6d0e5426dca62e2f7130da2870ad6acc7321c62301ff27d0cc4d4b6243883",
"styles.css": "322e5b2336a87a796bd9c3fcfef99754e19833091d0bc0567ea8afe9d5d61a80"
}
}
+6 -6
View File
@@ -1,11 +1,11 @@
/* 任务队列页(插件)—— 颜色/字号/圆角/间距全部走宿主 token;结构尺寸允许字面量。 */
.iwb-tq { display: flex; flex-direction: column; min-height: 100%; gap: var(--iwb-space-10); }
.iwb-tq-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--iwb-space-16); flex-wrap: wrap; }
.iwb-tq { display: flex; flex-direction: column; min-height: 0; gap: var(--iwb-space-10); }
.iwb-tq-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--iwb-space-16); flex-wrap: nowrap; }
.iwb-tq-sub { color: var(--iwb-text2); font-size: var(--iwb-font-sm); }
.iwb-tq-tools { display: flex; align-items: center; gap: var(--iwb-space-8); }
.iwb-tq-tool-lbl { font-size: var(--iwb-font-sm); color: var(--iwb-text2); }
.iwb-tq-limit { height: 28px; padding: 0 var(--iwb-space-8); }
.iwb-tq-ghost { background: var(--iwb-panel); }
.iwb-tq-tools { display: flex; align-items: center; gap: var(--iwb-space-8); flex: 0 0 auto; flex-wrap: nowrap; }
.iwb-tq-tool-lbl { font-size: var(--iwb-font-sm); color: var(--iwb-text2); white-space: nowrap; }
.iwb-tq-limit { height: 28px; padding: 0 var(--iwb-space-8); flex: 0 0 auto; width: auto; min-width: 76px; max-width: 96px; }
.iwb-tq-ghost { background: var(--iwb-panel); white-space: nowrap; flex: 0 0 auto; }
.iwb-tq-tabs { display: flex; gap: var(--iwb-space-4); border-bottom: 1px solid var(--iwb-border); }
.iwb-tq-tab { display: inline-flex; align-items: center; gap: var(--iwb-space-6); padding: var(--iwb-space-6) var(--iwb-space-10); border: 0; background: transparent; color: var(--iwb-text2); font: inherit; font-size: var(--iwb-font-sm); border-radius: var(--iwb-radius-card) var(--iwb-radius-card) 0 0; cursor: pointer; }
.iwb-tq-tab:hover { color: var(--iwb-text); background: var(--iwb-hover); }
+1
View File
@@ -231,6 +231,7 @@
const e = Object.assign({}, raw, { meta: raw.meta || {} })
if (e.status === STATE.READY) e.status = STATE.READY
else if (e.status === STATE.FAILED) e.status = STATE.FAILED
else if (e.status === STATE.LINK_ONLY) e.status = STATE.LINK_ONLY
else e.status = STATE.QUEUED
entries.set(e.id, e)
if (e.status === STATE.QUEUED) queue.push(e.id)