Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed581a8089 | ||
|
|
ac441455c0 | ||
|
|
4092307757 | ||
|
|
d1a7ec8f76 | ||
|
|
1961f415ca | ||
|
|
7b43002f6b | ||
|
|
ebc6ce1251 | ||
|
|
55408acca1 | ||
|
|
0ae9c6091c | ||
|
|
e63f3eea48 | ||
|
|
40607a48be | ||
|
|
43d6a63f9f |
No files matched your search
@@ -16,6 +16,35 @@
|
||||
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
|
||||
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
|
||||
|
||||
## v3.26.89(2026-11-26)生成即落盘根治:桌面端强制保留原图
|
||||
|
||||
- **桌面端不再受「入库时同时保留原图」开关限制**:每张新图生成后立刻把原图字节写进资料目录 `images/gallery/`(缩略图另存 `images/thumbs/`)。图床链接会过期,只有本地字节可靠。
|
||||
- 生成归档仍是**逐张**的(`archiveEntryNow → addOutputs → storeOutputThumb`):写完才回填 `orig: 'ok'`;抓取/写盘失败标 `missing`,在**图库角标**与**诊断页**可见,并可一键补存。
|
||||
- 设置 → 通用 → 图片与图库:桌面端复选框**强制勾选并禁用**,文案改为实际落盘路径;网页版保留原开关与红色警告。
|
||||
- 现有「归档即通知」链路保留(每张归档后 emit,图库面板 260ms 合并刷新);本轮没有新增自动启动对账任务。
|
||||
- 代价:桌面端每张生成图都会占一份原图磁盘空间(按用户要求:可靠性优先)。
|
||||
|
||||
## v3.26.88(2026-11-26)图库落盘 P0:状态可见 + 一键补存
|
||||
|
||||
- 图库索引条目新增 `orig` 状态(`pending` / `ok` / `missing` / `off`):写入成功回填 `ok`,抓取或写盘失败标 `missing`;插件列表把它带出来,老条目按 `origIdb` 是否存在推导。
|
||||
- **图库面板**:原图缺失的格子左上角显示「仅缩略图 / 未备份」角标;底栏出现「**N 张仅缩略图 · 补存**」,点一下批量补存;右键单张多出「补存原图」。
|
||||
- **补存链路**:`gallery.backfill` 强制忽略「已知抓不到」的内存缓存,重新抓远程字节写回 `images/gallery`,成功后把条目改成 `orig: 'ok'`,并刷新面板。
|
||||
- **设置 → 通用 → 图片与图库**:关闭「入库时同时保留原图」时显示红字警告;「补存缺失的原图」按钮改为**强制补存**(不再被开关挡住)。
|
||||
- 图库插件 **1.7.4**(已上架市场)。
|
||||
|
||||
## v3.26.87(2026-11-26)结果图拖到画布:复用图库插入链路
|
||||
|
||||
- 输出节点的结果图可**直接拖到画布**生成参考图节点:`dragstart` 写 `application/x-iwb-output-ref`(结果 URL),`drop` 时先按 URL 在图库索引里找条目 → 走**本地字节**(原图/缩略图)→ 引用化;没命中也不阻断,退回 URL 建节点。
|
||||
- `pointerdown` 在图片上停止冒泡:**拖图不会顺带拖动节点**;单击仍选中、双击仍预览。
|
||||
- 插入后清一次画布手势残留(原生拖放期间 pointerup 不落地),避免「拖完第一次点节点被当成收尾」。
|
||||
- 与图库拖入共用同一段插入代码,不新造第二条落点/引用化逻辑。
|
||||
|
||||
## v3.26.86(2026-11-26)输出节点双击预览:改在真实渲染位置 + 行为测试
|
||||
|
||||
- **真实位置**:输出节点的结果图由 `src/ui-node-bodies.js` 的 `renderOutBody → outCell` 渲染,不是 `ui-components.js` 的 `ResultImg`。v3.26.83 没匹配到的原因就在这里;v3.26.85 已把 outCell 改成**单击选中、双击预览**,本版补上测试与遗留组件对齐。
|
||||
- `ResultImg` 同步手势:单击只阻止冒泡(让节点选中),双击才 `onPreview`;`title` 改「双击放大」。
|
||||
- 新增 `tests/result-img-doubleclick-test.js`:用假 React 树断言「单击不预览 / 双击带 URL」,以及共享下载浮层两个按钮的回调与 `pointerdown` 不冒泡(不拖动节点)。
|
||||
|
||||
## v3.26.85(2026-11-26)动效 token + 下载浮层(图库 / 输出节点共用一套 hover)
|
||||
|
||||
- 新增 7 个 L2 token:`--iwb-motion-hover` / `--iwb-ease-hover` / `--iwb-hover-lift` / `--iwb-hover-scale` / `--iwb-hover-shadow` / `--iwb-hover-border` / `--iwb-scrim`;`design-tokens.css` 由 `tokens:write` 生成,token 棘轮零增长。
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ build esbuild 打包到 dist/(单 dist/app.js = src/ 模块按序
|
||||
node --check app.js 与 dist/app.js 语法
|
||||
check-dist.js 产物体检
|
||||
lint ESLint(src/ + app.js,正确性规则)
|
||||
test:unit 130 个单测文件(jsdom 契约测试;2026-11-07 新增 sync-facts-guard(事实一致性)/ _helpers/source(统一源文本);2026-11-12 新增 provider-ping(测速 no-cors 兜底))
|
||||
test:unit 131 个单测文件(jsdom 契约测试;2026-11-07 新增 sync-facts-guard(事实一致性)/ _helpers/source(统一源文本);2026-11-12 新增 provider-ping(测速 no-cors 兜底))
|
||||
test relay-task-graph-fixture + iwb-v32-web-test
|
||||
test:facts 事实基线守门(见 §5)
|
||||
typecheck 渐进类型检查(tsc --noEmit;范围 = src/*.js,不含 app.js)
|
||||
|
||||
@@ -1912,10 +1912,10 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
const wThumbFail = new Set()
|
||||
const wThumbProxyTried = new Set() // 经本站代理重试过(每个 URL 只试一次)
|
||||
const wThumbFailKey = (item) => String((item && item.url) || (item && item.name) || '')
|
||||
function storeOutputThumb(item) {
|
||||
function storeOutputThumb(item, forceOrig) {
|
||||
iwbDebugCounter('storeOutputThumb:start', item && item.name)
|
||||
const fkEarly = wThumbFailKey(item)
|
||||
if (fkEarly && wThumbFail.has(fkEarly)) return Promise.resolve(null) // 已知抓不到:不再重试
|
||||
if (fkEarly && !forceOrig && wThumbFail.has(fkEarly)) return Promise.resolve(null) // 已知抓不到:不再重试
|
||||
// 图库本地:缩略图(out_,320px)+ [应用内备份原图开→ 完整原图 out_orig_]。
|
||||
// 远程图床可能 CORS/403 拦 fetch——失败则明确记录(不再静默),仅保留 url 兜底。
|
||||
// 关键:原图落库与缩略图落库**解耦**——只要抓到 src,先写 out_orig_ + origIdb,
|
||||
@@ -1923,7 +1923,7 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
const cfg = wRawCfg() || {}
|
||||
// v3.87.37:原图备份改为**显式开启才做**(默认配置不持久化该键 ⇒ 默认即关)。
|
||||
// 默认开启会让每张生成图都抓完整原图存 base64(诊断实测空闲堆 1.4GB+ 的主因之一)。
|
||||
const backup = !!(cfg.canvas && cfg.canvas.backupOriginals === true)
|
||||
const backup = !!forceOrig || wIsTauri() || !!(cfg.canvas && cfg.canvas.backupOriginals === true) // 桌面端强制落原图:图床链接会过期,只有本地字节是可靠的
|
||||
// v3.87.59(丙方案收尾):C3 之后 item.data/item.url 可能是**引用对象**({__cache}/{__blob}),
|
||||
// 旧实现 String() 后判前缀 ⇒ 必然落空(缩略图缺失、可能多一次代理抓取)✗。这里先按需解析:
|
||||
// {__cache} → 虚拟 URL;{__blob} → objectURL;{__idb} → 仍为 null(迁移后已少见,保持原兜底行为)。
|
||||
@@ -1936,7 +1936,7 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
: Promise.resolve(null))
|
||||
return src0.then(async (src) => {
|
||||
iwbDebugCounter('storeOutputThumb:source', { name: item && item.name, found: !!src })
|
||||
if (!src) {
|
||||
if (!src) { if (backup) { try { idxSet({ orig: 'missing' }) } catch (e) { /* ignore */ } }
|
||||
// v3.87.35:直连失败(多为图床无 CORS 头)时,改走本站同源代理再试一次——
|
||||
// 这样豆包图也能归档出缩略图/本地原图(下载第②步此后可离线命中)。
|
||||
if (fkEarly && /^https:/i.test(fkEarly) && !wThumbProxyTried.has(fkEarly)) {
|
||||
@@ -1961,7 +1961,7 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
}
|
||||
// ① 原图独立落库:先写 out_orig_ + 回写 origIdb(缩略图失败也不影响)
|
||||
const origJob = backup
|
||||
? IDB.put(IDB_ORIG_PREFIX + item.name, src).then((ok) => { if (ok) { item.origIdb = IDB_ORIG_PREFIX + item.name; idxSet({ origIdb: item.origIdb }) } return ok }).catch((e) => { try { console.warn('[iwb] 原图写入 IndexedDB 失败:', item.name, e) } catch (e2) { /* ignore */ } return false })
|
||||
? IDB.put(IDB_ORIG_PREFIX + item.name, src).then((ok) => { if (ok) { item.origIdb = IDB_ORIG_PREFIX + item.name; idxSet({ origIdb: item.origIdb, orig: 'ok' }) } else { try { idxSet({ orig: 'missing' }) } catch (e3) { /* ignore */ } } return ok }).catch((e) => { try { console.warn('[iwb] 原图写入 IndexedDB 失败:', item.name, e) } catch (e2) { /* ignore */ } try { idxSet({ orig: 'missing' }) } catch (e3) { /* ignore */ } return false })
|
||||
: Promise.resolve(false)
|
||||
// ② 缩略图独立落库(失败不阻断原图)
|
||||
const thumbJob = new Promise((resolve) => { compressDataUrl(src, { enabled: true, force: true, maxMB: 0, maxEdge: 320, quality: 0.72, format: 'jpeg' }, resolve) }).then((thumb) => {
|
||||
@@ -2043,7 +2043,7 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
const items = []
|
||||
for (const r of (results || [])) {
|
||||
if (!r || !r.ok || !r.url) continue
|
||||
items.push({ name: 'gen_' + Date.now() + '_' + Math.floor(Math.random() * 1e6) + '.png', url: r.url, size: 0, mtime: Date.now(), width: r.width || 0, height: r.height || 0, label: r.label || '', snapshot: r.snapshot || null })
|
||||
items.push({ name: 'gen_' + Date.now() + '_' + Math.floor(Math.random() * 1e6) + '.png', url: r.url, size: 0, mtime: Date.now(), width: r.width || 0, height: r.height || 0, label: r.label || '', snapshot: r.snapshot || null, orig: (wRawCfg().canvas && wRawCfg().canvas.backupOriginals === true) ? 'pending' : 'off' })
|
||||
}
|
||||
const prevIdx = lsGet(OUT_KEY, [])
|
||||
const modular = await ModularOutputStore.add(items, { retention: wRawCfg().outputsRetention })
|
||||
@@ -2082,7 +2082,7 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
for (const r of (results || [])) {
|
||||
if (!r || !r.ok || !r.url) continue
|
||||
const name = 'gen_' + Date.now() + '_' + Math.floor(Math.random() * 1e6) + '.png'
|
||||
idx.push({ name, url: r.url, size: 0, mtime: Date.now(), w: r.width || 0, h: r.height || 0, label: r.label || '', snapshot: r.snapshot || null })
|
||||
idx.push({ name, url: r.url, size: 0, mtime: Date.now(), w: r.width || 0, h: r.height || 0, label: r.label || '', snapshot: r.snapshot || null, orig: (wRawCfg().canvas && wRawCfg().canvas.backupOriginals === true) ? 'pending' : 'off' })
|
||||
added.push(name)
|
||||
}
|
||||
lsSet(OUT_KEY, idx)
|
||||
@@ -8354,7 +8354,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
return { ok: failed.length === 0, count: n, failed: failed }
|
||||
},
|
||||
insert: async (names, o) => ({ ok: true, inserted: await insertOutputsToCanvas((outputs || []).filter((f) => names.indexOf(f.name) >= 0), (o && o.insertK) || '1k') }),
|
||||
remove: async (names) => { const n = await deleteOutputs(names); return { ok: n > 0, removed: n } }, openFolder: () => window.IWBDesktopHelpers.openGalleryDir(),
|
||||
remove: async (names) => { const n = await deleteOutputs(names); return { ok: n > 0, removed: n } }, openFolder: () => window.IWBDesktopHelpers.openGalleryDir(), backfill: (names) => { const want = Array.isArray(names) ? names : []; const hits = (outputs || []).filter((f) => want.indexOf(f.name) >= 0); return Promise.all(hits.map((f) => storeOutputThumb(f, true))).then((rs) => ({ ok: rs.filter(Boolean).length, count: rs.filter(Boolean).length, failed: hits.filter((f, i) => !rs[i]).map((f) => f.name) })) },
|
||||
})
|
||||
// 节点组库插件(grouplib):数据仍由宿主持有,插件只拿读写/实例化能力
|
||||
if (window.IWBPluginGroupLib) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 现状架构与性能事实基线(桌面版)
|
||||
|
||||
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
|
||||
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = a4c5cca`(线上 `v3.26.85+a4c5cca` —— 2026-11-24 **图库:出图即入图库 + 插入落本地副本(能标注)**:每张生成完成即归档并通知插件(此前只在整轮结束写一次 ⇒ 生成中图库一直空)、插入取源改本地字节优先并引用化(抓不到才留原链接 + 提示)、`getNodeImage` 补 `data.localRef` 候选(远程缓存命中却仍判「不支持标注」的直接成因)、批量插入改 4 列栅格(旧实现同批全叠一处),逻辑落 `src/gallery-sync.js`,app.js 只装配;上一条 `v3.26.60+cf0e9a0` —— **浮层字号上调一档**:「模型设置」「图像设置」选择项 11→13px、高 22→28、左右内距 6→10、间距 4→6、标题 12→14、面板 328→360,改动全落在 `.iwb-pop` 的 6 个 token(两面板共用一套);上一条 `v3.26.59+e966b34` —— 备份新增 `plugin-files/` 通道,提示词封面换机不再丢;再上一条 2026-11-23 **节点正文文本区修复**:提示词/文本节点正文透明继承卡片底色(白卡片消失)、编辑态三层框(控件 border / 聚焦光晕 / D8 焦点环)全去掉,规范补表面角色三分法与 `node-scope-test` 第 5 条守卫,8 张基线重录;上一条 `v3.26.51+21554b0` —— **M6 延展验证**:插件面板两段六次叠加样式合并重写、133 行新增零裸值;补 `--iwb-font-base`(14px) 第 8 档与亮色状态色调深(对浅页面 2.13 → ≥4.6),对比度守卫 114→138 对;新增 ⑦⑧ 组件夹具基线共 16 张;`batch-export` 1.2.2 状态色走宿主 token、去掉纯蓝主按钮;棘轮基线首次下调。M1–M6 全部完成;上一条 `v3.26.50+cab473c` —— **M5 闸门**:新增 `scripts/token-lint.js`(只查 diff 新增行,CSS 与 JS 内联样式两套判据、四类白名单)+ `tests/design-token-ratchet-test.js`(13 项计数只降不升)+ `tests/theme-contrast-test.js`(亮/暗 × 文字 × 表面 114 对),三条各做一次打红验证后接进 `verify:ci`;顺手把首启动「选择资料目录」弹窗 token 化(全仓最后一个完全未 token 化的界面);上一条 `v3.26.49+1743453` —— **M4-B6 收尾**:`style.css` 剩余 16 处半像素字号全清零(守卫收紧为全文件断言)、`--iwb-control-h` 裁定不扩到全局控件(并排表单 vs 成组紧凑控件);插件主题契约重写,`ALLOW_FILES` 文件级豁免 **6 → 0** —— 改为「私有皮肤 manifest 自声明 `skin` + chroma 强调色判据 + 内容色行内标记」,声明私有皮肤的插件不得引用宿主颜色 token;同步 4 个插件版本,插件侧中性色写死归零;视觉基线 8 张因字号栅格化变化更新,A/B 回退确认非环境噪声;上一条 `v3.26.48+cb9cb9c` —— **M4-B5 节点**:节点卡内部表面统一 `--iwb-field` —— 端口底色从 `#161616`(暗色对卡片差 39 级,一颗黑洞)改 `#494949`(差 12 级),同病灶另 6 处(ref-img/ref-single/upload-link/refmini-empty/task-result-img/node-head:hover)一并改;浮条与任务卡 hover 改 `color-mix(text 10%)`(原来 panel 与 layer2 深色同色,hover 无反馈);字号 12/15/11/13 全归档位、圆角 8/6/5/14 归并、间距 52 处等值 + 13 处 1px 级微调;删 6 个死类名;新增 `tests/node-scope-test.js` 钉「节点内禁用面板表面色」;上一条 `v3.26.47+f5c8174` —— **M4-B4 设置/外观**:新增 `--iwb-control-h`(30px) 修「同行输入框 33px / 按钮 24px」的 9px 落差;设置页正文 14→13、标题 16→15,范围内半像素字号清零;删 21 条死规则(setcell/setgrid/set-row/appear-val 等);新增 `tests/settings-scope-test.js` 钉「控件等高 / 死类名不复现 / 引用的 token 必须存在」;上一条 `v3.26.46+9f29996` —— 2026-11-23 **M4-B3 首页/库**:删 30 条零生产者规则(25 个类名在产物里 0 次)+ 4 条被 specificity 覆盖的死声明,`style.css` 2391→2339 行;首页/库 106 条规则换 token,间距写死 91→5(只剩版心与导航让位的布局值)、字号写死清零,新增 `--iwb-font-display:24px` 第 7 档;验收改为「计算样式逐元素 diff + 12 张基线只首页 2 张变化」;上一条 `v3.26.45+968ff46` —— **M4-B2 浮层层级表 + 阴影四档**:14 档 `--iwb-z-*`(裸 z-index 取值种类 42→31)、`--iwb-elevation-1..4`(浮层 8 种阴影写法→4 档)、`.iwb-pop` 圆角 18→`radius-popover(14)`;修「弹窗里点保存看不到提示」—— 根因不是层级数字而是 `.iwb-overlay` 本身就是堆叠上下文,toast 改为 portal 到 `body`;新增 `tests/overlay-layer-test.js` 钉 9 条顺序约束;上一条 `v3.26.44+846a59b` —— **设计 token 体系重建**:D1–D9 色彩模型改为真正的深色(#121Line truncated
|
||||
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 4092307`(线上 `v3.26.89+4092307` —— 2026-11-24 **图库:出图即入图库 + 插入落本地副本(能标注)**:每张生成完成即归档并通知插件(此前只在整轮结束写一次 ⇒ 生成中图库一直空)、插入取源改本地字节优先并引用化(抓不到才留原链接 + 提示)、`getNodeImage` 补 `data.localRef` 候选(远程缓存命中却仍判「不支持标注」的直接成因)、批量插入改 4 列栅格(旧实现同批全叠一处),逻辑落 `src/gallery-sync.js`,app.js 只装配;上一条 `v3.26.60+cf0e9a0` —— **浮层字号上调一档**:「模型设置」「图像设置」选择项 11→13px、高 22→28、左右内距 6→10、间距 4→6、标题 12→14、面板 328→360,改动全落在 `.iwb-pop` 的 6 个 token(两面板共用一套);上一条 `v3.26.59+e966b34` —— 备份新增 `plugin-files/` 通道,提示词封面换机不再丢;再上一条 2026-11-23 **节点正文文本区修复**:提示词/文本节点正文透明继承卡片底色(白卡片消失)、编辑态三层框(控件 border / 聚焦光晕 / D8 焦点环)全去掉,规范补表面角色三分法与 `node-scope-test` 第 5 条守卫,8 张基线重录;上一条 `v3.26.51+21554b0` —— **M6 延展验证**:插件面板两段六次叠加样式合并重写、133 行新增零裸值;补 `--iwb-font-base`(14px) 第 8 档与亮色状态色调深(对浅页面 2.13 → ≥4.6),对比度守卫 114→138 对;新增 ⑦⑧ 组件夹具基线共 16 张;`batch-export` 1.2.2 状态色走宿主 token、去掉纯蓝主按钮;棘轮基线首次下调。M1–M6 全部完成;上一条 `v3.26.50+cab473c` —— **M5 闸门**:新增 `scripts/token-lint.js`(只查 diff 新增行,CSS 与 JS 内联样式两套判据、四类白名单)+ `tests/design-token-ratchet-test.js`(13 项计数只降不升)+ `tests/theme-contrast-test.js`(亮/暗 × 文字 × 表面 114 对),三条各做一次打红验证后接进 `verify:ci`;顺手把首启动「选择资料目录」弹窗 token 化(全仓最后一个完全未 token 化的界面);上一条 `v3.26.49+1743453` —— **M4-B6 收尾**:`style.css` 剩余 16 处半像素字号全清零(守卫收紧为全文件断言)、`--iwb-control-h` 裁定不扩到全局控件(并排表单 vs 成组紧凑控件);插件主题契约重写,`ALLOW_FILES` 文件级豁免 **6 → 0** —— 改为「私有皮肤 manifest 自声明 `skin` + chroma 强调色判据 + 内容色行内标记」,声明私有皮肤的插件不得引用宿主颜色 token;同步 4 个插件版本,插件侧中性色写死归零;视觉基线 8 张因字号栅格化变化更新,A/B 回退确认非环境噪声;上一条 `v3.26.48+cb9cb9c` —— **M4-B5 节点**:节点卡内部表面统一 `--iwb-field` —— 端口底色从 `#161616`(暗色对卡片差 39 级,一颗黑洞)改 `#494949`(差 12 级),同病灶另 6 处(ref-img/ref-single/upload-link/refmini-empty/task-result-img/node-head:hover)一并改;浮条与任务卡 hover 改 `color-mix(text 10%)`(原来 panel 与 layer2 深色同色,hover 无反馈);字号 12/15/11/13 全归档位、圆角 8/6/5/14 归并、间距 52 处等值 + 13 处 1px 级微调;删 6 个死类名;新增 `tests/node-scope-test.js` 钉「节点内禁用面板表面色」;上一条 `v3.26.47+f5c8174` —— **M4-B4 设置/外观**:新增 `--iwb-control-h`(30px) 修「同行输入框 33px / 按钮 24px」的 9px 落差;设置页正文 14→13、标题 16→15,范围内半像素字号清零;删 21 条死规则(setcell/setgrid/set-row/appear-val 等);新增 `tests/settings-scope-test.js` 钉「控件等高 / 死类名不复现 / 引用的 token 必须存在」;上一条 `v3.26.46+9f29996` —— 2026-11-23 **M4-B3 首页/库**:删 30 条零生产者规则(25 个类名在产物里 0 次)+ 4 条被 specificity 覆盖的死声明,`style.css` 2391→2339 行;首页/库 106 条规则换 token,间距写死 91→5(只剩版心与导航让位的布局值)、字号写死清零,新增 `--iwb-font-display:24px` 第 7 档;验收改为「计算样式逐元素 diff + 12 张基线只首页 2 张变化」;上一条 `v3.26.45+968ff46` —— **M4-B2 浮层层级表 + 阴影四档**:14 档 `--iwb-z-*`(裸 z-index 取值种类 42→31)、`--iwb-elevation-1..4`(浮层 8 种阴影写法→4 档)、`.iwb-pop` 圆角 18→`radius-popover(14)`;修「弹窗里点保存看不到提示」—— 根因不是层级数字而是 `.iwb-overlay` 本身就是堆叠上下文,toast 改为 portal 到 `body`;新增 `tests/overlay-layer-test.js` 钉 9 条顺序约束;上一条 `v3.26.44+846a59b` —— **设计 token 体系重建**:D1–D9 色彩模型改为真正的深色(#121Line truncated
|
||||
<!-- 2026-10-28 P1 拆分批 1:新增 src/generation-task-graph.js(5 个任务图纯函数自 app.js 迁出)
|
||||
⇒ 模块数 60→61、耦合面 51→52、sourceModules 60→61。耦合面只**新增** IWBWTaskGraph,无删除。
|
||||
2026-10-28 P1 拆分批 2:新增 src/storage-config-shape.js(9 个配置形状纯函数自 app.js 迁出)
|
||||
@@ -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,183 行**(**双层预算**:绝对上限 9,183 / 占总源码 ≤ 40%,现 **29.6%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **3,043 行**(上限 **3,046**,余量 3;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **112** 个模块 / 21,803 行,`sourceModules` 112 项;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,183 行**(**双层预算**:绝对上限 9,183 / 占总源码 ≤ 40%,现 **29.6%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **3,043 行**(上限 **3,046**,余量 3;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **112** 个模块 / 21,823 行,`sourceModules` 112 项;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`。
|
||||
|
||||
## 2. 门禁与环境现状
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.26.85",
|
||||
"version": "3.26.89",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
@@ -10,7 +10,7 @@
|
||||
"app:build": "tauri build",
|
||||
"lint": "eslint src app.js",
|
||||
"test": "node tests/relay-task-graph-fixture-test.js && node tests/plugin-style-node-test.js && node tests/inherit-text-test.js",
|
||||
"test:unit": "node tests/gallery-audit-test.js && node tests/plugin-files-policy-test.js && node tests/theme-plugin-tokens-test.js && node tests/design-tokens-component-doc-test.js && node tests/theme-static-snapshot-test.js && node tests/overlay-layer-test.js && node tests/settings-scope-test.js && node tests/node-scope-test.js && node tests/appearance-v2-test.js && node tests/image-prompt-cover-test.js && node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/album-task-graph-test.js && node tests/generation-endpoint-test.js && node tests/storage-config-shape-test.js && node tests/generation-default-model-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-gc-canvas-refs-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/gallery-sync-test.js && node tests/image-blob-store-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/clipboard-native-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/desktop-csp-loopback-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/plugin-data-test.js && node tests/plugin-loader-test.js && node tests/plugin-bundle-test.js && node tests/plugin-install-test.js && node tests/plugin-gallery-render-test.js && node tests/plugin-gallery-recovery-test.js && node tests/plugin-gallery-ux-test.js && node tests/plugin-grouplib-render-test.js && node tests/plugin-promptlib-render-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/plugin-theme-contract-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/native-overlay-park-test.js && node tests/ui-dock-sanitize-test.js && node tests/ui-minimap-fit-test.js && node tests/ui-workbench-hooks-test.js && node tests/plugin-scale-contract-test.js && node tests/design-token-ratchet-test.js && node testsLine truncated
|
||||
"test:unit": "node tests/result-img-doubleclick-test.js && node tests/gallery-audit-test.js && node tests/plugin-files-policy-test.js && node tests/theme-plugin-tokens-test.js && node tests/design-tokens-component-doc-test.js && node tests/theme-static-snapshot-test.js && node tests/overlay-layer-test.js && node tests/settings-scope-test.js && node tests/node-scope-test.js && node tests/appearance-v2-test.js && node tests/image-prompt-cover-test.js && node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/album-task-graph-test.js && node tests/generation-endpoint-test.js && node tests/storage-config-shape-test.js && node tests/generation-default-model-test.js && node tests/storage-zip-test.js && node tests/canvas-node-factory-test.js && node tests/runtime-error-test.js && node tests/runtime-lifecycle-test.js && node tests/runtime-fetch-test.js && node tests/runtime-channel-test.js && node tests/runtime-boundary-test.js && node tests/runtime-record-test.js && node tests/runtime-recovery-test.js && node tests/runtime-diagnostic-record-test.js && node tests/runtime-metrics-test.js && node tests/runtime-run-context-test.js && node tests/runtime-execution-context-test.js && node tests/storage-gc-canvas-refs-test.js && node tests/storage-health-test.js && node tests/generation-state-test.js && node tests/canvas-store-test.js && node tests/storage-result-test.js && node tests/storage-local-test.js && node tests/storage-domain-test.js && node tests/storage-runtime-test.js && node tests/storage-indexeddb-test.js && node tests/generation-scheduler-test.js && node tests/gallery-query-test.js && node tests/gallery-hydration-test.js && node tests/gallery-sync-test.js && node tests/image-blob-store-test.js && node tests/image-format-test.js && node tests/clipboard-graph-test.js && node tests/clipboard-graph-fallback-test.js && node tests/image-admit-test.js && node tests/image-dedupe-test.js && node tests/clipboard-kind-test.js && node tests/clipboard-paste-test.js && node tests/clipboard-copy-test.js && node tests/clipboard-native-test.js && node tests/paste-once-test.js && node tests/list-e2e-specs-test.js && node tests/desktop-csp-loopback-test.js && node tests/architecture-boundary-guard-test.js && node tests/plugin-host-test.js && node tests/plugin-data-test.js && node tests/plugin-loader-test.js && node tests/plugin-bundle-test.js && node tests/plugin-install-test.js && node tests/plugin-gallery-render-test.js && node tests/plugin-gallery-recovery-test.js && node tests/plugin-gallery-ux-test.js && node tests/plugin-grouplib-render-test.js && node tests/plugin-promptlib-render-test.js && node tests/image-compress-test.js && node tests/storage-fallback-indexeddb-test.js && node tests/canvas-normalize-test.js && node tests/canvas-geometry-test.js && node tests/canvas-history-test.js && node tests/canvas-ops-test.js && node tests/canvas-text-test.js && node tests/history-store-test.js && node tests/plugin-integrity-test.js && node tests/workspace-sessions-store-test.js && node tests/workspace-list-test.js && node tests/workspace-purge-test.js && node tests/provider-ping-test.js && node tests/runtime-diagnostics-hotpath-test.js && node tests/storage-log-failure-test.js && node tests/storage-convergence-test.js && node tests/swallow-wiring-test.js && node tests/workbench-logic-test.js && node tests/storage-autobackup-test.js && node tests/storage-outputs-mutate-test.js && node tests/sync-facts-guard-test.js && node tests/e2e-fixed-waits-ratchet-test.js && node tests/shell-render-behavior-test.js && node tests/canvas-meta-notice-behavior-test.js && node tests/source-text-ratchet-test.js && node tests/plugin-theme-contract-test.js && node tests/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/native-overlay-park-test.js && node tests/ui-dock-sanitize-test.js && node tests/ui-minimap-fit-test.js && node tests/ui-workbench-hooks-test.js && node tests/plugin-scale-contract-test.js && node tesLine truncated
|
||||
"test:diagnostics": "node tests/runtime-diagnostics-hotpath-test.js",
|
||||
"test:facts": "node tests/architecture-facts-guard-test.js && node tests/release-records-test.js",
|
||||
"plugins:gc": "node scripts/plugins-publish.mjs --gc",
|
||||
|
||||
+31
-2
@@ -116,6 +116,13 @@
|
||||
var failEl = el('span', { class: 'iwb-gal-fail', text: '' })
|
||||
failEl.style.display = 'none'
|
||||
failEl.addEventListener('click', function () { retryAll() })
|
||||
// v1.7.4:「仅缩略图」统计 —— 原图没落盘时点一下批量补存(宿主把远程字节写回 images/gallery)
|
||||
var origEl = el('span', { class: 'iwb-gal-orig', text: '' })
|
||||
origEl.style.display = 'none'
|
||||
origEl.addEventListener('click', function () {
|
||||
var names = items.filter(function (x) { return x.orig && x.orig !== 'ok' }).map(function (x) { return x.name })
|
||||
if (names.length) doBackfill(names)
|
||||
})
|
||||
var refreshBtn = iconBtn('刷新', function (svg) {
|
||||
svgPath(svg, 'M13.2 6.4A5.4 5.4 0 1 0 13.4 9.4')
|
||||
svgPath(svg, 'M13.2 2.6v3.8H9.4')
|
||||
@@ -157,7 +164,7 @@
|
||||
// v1.4.2:刷新与设置同放右侧工具组(此前刷新在左侧信息区,空间不足时会向右溢出、压住设置图标)
|
||||
var tools = el('div', { class: 'iwb-gal-tools' }, refreshBtn, folderBtn, setBtn)
|
||||
var foot = el('div', { class: 'iwb-gal-foot' },
|
||||
el('div', { class: 'iwb-gal-foot-left' }, countEl, pickedEl, failEl, statusEl), tools)
|
||||
el('div', { class: 'iwb-gal-foot-left' }, countEl, pickedEl, failEl, origEl, statusEl), tools)
|
||||
var wrap = el('div', { class: 'iwb-history-embedded' }, [head, grid, more, empty, foot, settings])
|
||||
|
||||
function setOpen (open) {
|
||||
@@ -202,6 +209,7 @@
|
||||
.then(function () { setStatus('已插入:' + it.name) })
|
||||
.catch(function () { setStatus('插入失败') })
|
||||
})
|
||||
if (it.orig && it.orig !== 'ok') item('补存原图', function () { doBackfill([it.name]) })
|
||||
item('下载', function () { doDownload([it.name]) })
|
||||
item('预览大图', function () { try { ctx.gallery.preview(it.name) } catch (err) { /* ignore */ } })
|
||||
item('复制文件名', function () {
|
||||
@@ -271,6 +279,9 @@
|
||||
clear(actions)
|
||||
countEl.textContent = items.length + ' / ' + total + ' 张'
|
||||
pickedEl.textContent = count() ? ('已选 ' + count()) : ''
|
||||
var missing = items.filter(function (x) { return x.orig && x.orig !== 'ok' }).length
|
||||
if (missing) { origEl.style.display = ''; origEl.textContent = missing + ' 张仅缩略图 · 补存'; origEl.title = '这些图的原图没有写进本地(只有 320px 缩略图)。点一下把远程原图补存到 images/gallery' }
|
||||
else { origEl.style.display = 'none'; origEl.textContent = '' }
|
||||
var n = count()
|
||||
function btn (label, title0, fn, need, danger) {
|
||||
var b = el('button', { class: 'iwb-btn iwb-btn-sm' + (danger ? ' iwb-btn-danger' : '') + (need && !n ? ' iwb-gal-off' : ''), text: label, title: need && !n ? '先选中图片' : title0 })
|
||||
@@ -372,6 +383,11 @@
|
||||
// 缩略图是**异步**的(ctx.gallery.thumb 返回 Promise):先占位,拿到地址再挂 img。
|
||||
// v1.2.0:加载失败自动重试 2 次(图片还没落盘/临时不可读),仍失败才显示可点击重试的占位。
|
||||
box.title = it.name + '(单击单选 · Shift+单击多选 · 双击放大 · 拖到画布=参考图节点)'
|
||||
var origBadge = null
|
||||
if (it.orig && it.orig !== 'ok') {
|
||||
origBadge = el('span', { class: 'iwb-gal-origbadge', text: it.orig === 'off' ? '未备份' : '仅缩略图' })
|
||||
origBadge.title = it.orig === 'off' ? '原图入库已关闭:这张只有缩略图' : '原图没有写进本地:右键可「补存原图」'
|
||||
}
|
||||
var holder = el('div', { class: 'iwb-history-missing', text: '加载中…' })
|
||||
box.appendChild(holder)
|
||||
var tries = 0
|
||||
@@ -459,6 +475,8 @@
|
||||
// v1.7.2:图片卡片上只留「下载」;插入仍可从顶部工具栏或右键菜单进入。
|
||||
acts.appendChild(act('下载', '下载到本地', function () { doDownload([it.name]) }))
|
||||
box.appendChild(acts)
|
||||
// 角标最后挂:不要 z-index(插件层级闸门禁止裸值),靠 DOM 顺序盖在图片上
|
||||
if (origBadge) box.appendChild(origBadge)
|
||||
return box
|
||||
}
|
||||
|
||||
@@ -468,6 +486,17 @@
|
||||
clearTimeout(statusTimer)
|
||||
if (text) statusTimer = setTimeout(function () { statusEl.textContent = '' }, 4000)
|
||||
}
|
||||
function doBackfill (names) {
|
||||
if (!ctx.gallery || typeof ctx.gallery.backfill !== 'function') { setStatus('当前宿主不支持补存原图'); return }
|
||||
setStatus('补存中…(' + names.length + ' 张)')
|
||||
Promise.resolve(ctx.gallery.backfill(names)).then(function (r) {
|
||||
var ok = (r && (r.ok || r.count)) || 0
|
||||
var failed = (r && r.failed) || []
|
||||
if (failed.length) setStatus('补存完成 ' + ok + ' 张,' + failed.length + ' 张失败(远程链接取不到)')
|
||||
else setStatus('已补存 ' + ok + ' 张原图')
|
||||
return load()
|
||||
}).catch(function () { setStatus('补存失败,可稍后重试') })
|
||||
}
|
||||
function doDownload (names) {
|
||||
setStatus('下载中…')
|
||||
return Promise.resolve(ctx.gallery.download(names)).then(function (r) {
|
||||
@@ -590,7 +619,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'gallery',
|
||||
name: '图库',
|
||||
version: '1.7.3',
|
||||
version: '1.7.4',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'gallery'],
|
||||
data: { schemaVersion: 1, maxBytes: 65536 },
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "gallery",
|
||||
"name": "图库",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.4",
|
||||
"apiVersion": 1,
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
@@ -13,7 +13,7 @@
|
||||
"图库"
|
||||
],
|
||||
"files": {
|
||||
"main.js": "b497528aa9cd616b5caa28b940bd70c64c36b22ed35f3dad8a2052f31687be73",
|
||||
"styles.css": "f4cc8ff0d8c1cfc7d90a2988ebfd33473986da81228187385f3483e7eff62b8b"
|
||||
"main.js": "30b804a02aa15bdb54cfc6520c9ce5e0e58db08dd658ff262770cb08108383c1",
|
||||
"styles.css": "14d374b5d0e1461cb1ca2b125865e9c27df7c3bd79c11caa0afc52152c7d0aef"
|
||||
}
|
||||
}
|
||||
@@ -113,3 +113,15 @@
|
||||
}
|
||||
.iwb-gal-fail:hover { color: var(--iwb-err); opacity: .85; }
|
||||
.iwb-gal-menu .iwb-ctx-title { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
/* ---- v1.7.4:原图未落盘(仅缩略图)可见化 ---- */
|
||||
.iwb-gal-orig {
|
||||
font-size: 11px; color: var(--iwb-warn); cursor: pointer; white-space: nowrap;
|
||||
text-decoration: underline dotted; text-underline-offset: 2px; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis;
|
||||
}
|
||||
.iwb-gal-orig:hover { color: var(--iwb-warn); opacity: .85; }
|
||||
.iwb-gal-origbadge {
|
||||
position: absolute; left: var(--iwb-space-4, 4px); top: var(--iwb-space-4, 4px);
|
||||
padding: 0 var(--iwb-space-4, 4px); border-radius: var(--iwb-radius-full, 999px);
|
||||
background: var(--iwb-panel); color: var(--iwb-warn); border: 1px solid var(--iwb-border);
|
||||
font-size: var(--iwb-font-2xs, 10px); line-height: 1.5; pointer-events: none;
|
||||
}
|
||||
+3
-3
@@ -33,10 +33,10 @@
|
||||
"dir": "gallery",
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.4",
|
||||
"files": {
|
||||
"main.js": "b497528aa9cd616b5caa28b940bd70c64c36b22ed35f3dad8a2052f31687be73",
|
||||
"styles.css": "f4cc8ff0d8c1cfc7d90a2988ebfd33473986da81228187385f3483e7eff62b8b"
|
||||
"main.js": "30b804a02aa15bdb54cfc6520c9ce5e0e58db08dd658ff262770cb08108383c1",
|
||||
"styles.css": "14d374b5d0e1461cb1ca2b125865e9c27df7c3bd79c11caa0afc52152c7d0aef"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
<title>插件开发规范 · Image Workbench</title>
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="apple-touch-icon" href="/assets/logo.png">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.85-mww8kswi">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.89-mww95c9t">
|
||||
<style>
|
||||
.devdoc{max-width:860px;margin:0 auto;padding:40px 0 72px;color:var(--ink,#1b1f24);font-size:15px;line-height:1.75}
|
||||
.devdoc h1{font-size:38px;line-height:1.2;margin:8px 0 18px}
|
||||
@@ -33,7 +33,7 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.85</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.89</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
|
||||
@@ -57,13 +57,13 @@
|
||||
<h2>下载</h2>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Apple Silicon<div class="hint">M1 / M2 / M3 / M4</div></div>
|
||||
<div class="meta">版本 3.26.85 · 8.4 MB · .dmg<div class="hash">sha256 5442c774270ec9e1…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.85_aarch64.dmg?h=5442c774270e">下载</a>
|
||||
<div class="meta">版本 3.26.89 · 8.4 MB · .dmg<div class="hash">sha256 de362b936310a0de…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.89_aarch64.dmg?h=de362b936310">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
|
||||
<div class="meta">版本 3.26.85 · 8.8 MB · .dmg<div class="hash">sha256 6dfb2eecda121c01…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.85_x64.dmg?h=6dfb2eecda12">下载</a>
|
||||
<div class="meta">版本 3.26.89 · 8.8 MB · .dmg<div class="hash">sha256 7706bff50455046c…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.89_x64.dmg?h=7706bff50455">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
|
||||
@@ -97,6 +97,22 @@
|
||||
</ol>
|
||||
|
||||
<h2>历史版本</h2>
|
||||
<div class="row">
|
||||
<div class="name">3.26.89</div>
|
||||
<div class="meta">2026-11-25<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.88</div>
|
||||
<div class="meta">2026-11-25<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.87</div>
|
||||
<div class="meta">2026-11-25<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.86</div>
|
||||
<div class="meta">2026-11-25<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.85</div>
|
||||
<div class="meta">2026-11-25<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
|
||||
+8
-8
@@ -4,7 +4,7 @@
|
||||
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="apple-touch-icon" href="/assets/logo.png">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.85-mww8kswi">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.89-mww95c9t">
|
||||
</head><body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><img class="logo" src="/assets/logo.png" alt="" width="26" height="26">Image Workbench</a>
|
||||
@@ -17,19 +17,19 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.85</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.89</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
<section class="hero hero-art">
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.85-mww8kswi" alt=""></div>
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.89-mww95c9t" alt=""></div>
|
||||
<div class="hero-veil"></div>
|
||||
<div class="wrap">
|
||||
<span class="kicker">v3.26.85 · macOS / Windows · 数据在本地</span>
|
||||
<span class="kicker">v3.26.89 · macOS / Windows · 数据在本地</span>
|
||||
<h1>本地优先的<br>AI 生图无限画布</h1>
|
||||
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
|
||||
<div class="cta">
|
||||
<a class="btn primary lg" href="/download/">下载 v3.26.85</a>
|
||||
<a class="btn primary lg" href="/download/">下载 v3.26.89</a>
|
||||
<a class="btn lg" href="/plugins/">浏览 13 个插件</a>
|
||||
</div>
|
||||
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
|
||||
@@ -79,7 +79,7 @@
|
||||
</div>
|
||||
<div class="pcard" data-name="图库 gallery 右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供) 资源 图库" data-tags="资源,图库">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
|
||||
<div><div class="nm">图库</div><div class="ver">v1.7.3 · 官方</div></div></div>
|
||||
<div><div class="nm">图库</div><div class="ver">v1.7.4 · 官方</div></div></div>
|
||||
<div class="desc">右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)</div>
|
||||
<div class="tags"><span class="tag">资源</span><span class="tag">图库</span></div>
|
||||
</div>
|
||||
@@ -96,8 +96,8 @@
|
||||
<section class="section"><div class="wrap">
|
||||
<h2>下载 Image Workbench</h2>
|
||||
<p class="lead">选你的平台。装过一次之后,以后在应用内「设置 → 通用 → 版本与更新」就能一键升级。</p>
|
||||
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.26.85_aarch64.dmg?h=5442c774270e"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 8.4 MB · .dmg</div></a>
|
||||
<a href="/updates/darwin-x86_64/image-workbench_3.26.85_x64.dmg?h=6dfb2eecda12"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
|
||||
<div class="dl"><a href="/updates/darwin-aarch64/image-workbench_3.26.89_aarch64.dmg?h=de362b936310"><div class="n">macOS · Apple Silicon</div><div class="s">M1 / M2 / M3 / M4 · 8.4 MB · .dmg</div></a>
|
||||
<a href="/updates/darwin-x86_64/image-workbench_3.26.89_x64.dmg?h=7706bff50455"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
|
||||
<div class="none"><div class="n">Windows · x64</div><div class="s">暂未提供</div></div></div>
|
||||
<div style="margin-top:20px;color:#9ca3af;font-size:12.5px">安装包未做 Apple 公证 / Windows 代码签名,首次打开需手动放行一次,细节见 <a href="/download/" style="text-decoration:underline">下载页</a>。</div>
|
||||
</div></section>
|
||||
|
||||
+10
-10
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"updatedAt": "2026-11-25T14:41:29.249Z",
|
||||
"updatedAt": "2026-11-25T14:57:23.381Z",
|
||||
"plugins": [
|
||||
{
|
||||
"id": "album",
|
||||
@@ -147,26 +147,26 @@
|
||||
"资源",
|
||||
"图库"
|
||||
],
|
||||
"version": "1.7.3",
|
||||
"version": "1.7.4",
|
||||
"apiVersion": 1,
|
||||
"bundle": "plugins/gallery-1.7.3.zip",
|
||||
"bundleSize": 40996,
|
||||
"bundleSha256": "b5f01d3b933c48f37230b876dbcb3e585b199271db7716cf1b9480bfdac948fa",
|
||||
"bundle": "plugins/gallery-1.7.4.zip",
|
||||
"bundleSize": 43859,
|
||||
"bundleSha256": "9e836e841a87055b21083a9d0fe8e001ce11b7e32d83654cc3bab5732774eee3",
|
||||
"files": [
|
||||
{
|
||||
"path": "manifest.json",
|
||||
"sha256": "f4c9ff92011963b2774e5f7786e74b20da48d04c5a0797baafe4b6b84f462b1a",
|
||||
"sha256": "2985568cc3fe69a6a1c14bdc1bda047665ec4ea0fc3fd4ca1b8d981a6ea007f0",
|
||||
"size": 526
|
||||
},
|
||||
{
|
||||
"path": "main.js",
|
||||
"sha256": "b497528aa9cd616b5caa28b940bd70c64c36b22ed35f3dad8a2052f31687be73",
|
||||
"size": 32287
|
||||
"sha256": "30b804a02aa15bdb54cfc6520c9ce5e0e58db08dd658ff262770cb08108383c1",
|
||||
"size": 34434
|
||||
},
|
||||
{
|
||||
"path": "styles.css",
|
||||
"sha256": "f4cc8ff0d8c1cfc7d90a2988ebfd33473986da81228187385f3483e7eff62b8b",
|
||||
"size": 7873
|
||||
"sha256": "14d374b5d0e1461cb1ca2b125865e9c27df7c3bd79c11caa0afc52152c7d0aef",
|
||||
"size": 8589
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<title>插件市场 · Image Workbench</title>
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<link rel="apple-touch-icon" href="/assets/logo.png">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.85-mww8kswi">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.89-mww95c9t">
|
||||
</head><body>
|
||||
<nav><div class="wrap inner">
|
||||
<a class="brand" href="/"><img class="logo" src="/assets/logo.png" alt="" width="26" height="26">Image Workbench</a>
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<a class="btn" href="/plugins/">插件市场</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.85</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.89</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
<div class="pcard" data-name="图库 gallery 右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供) 资源 图库" data-tags="资源,图库">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
|
||||
<div><div class="nm">图库</div><div class="ver">v1.7.3 · 官方</div></div></div>
|
||||
<div><div class="nm">图库</div><div class="ver">v1.7.4 · 官方</div></div></div>
|
||||
<div class="desc">右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)</div>
|
||||
<div class="tags"><span class="tag">资源</span><span class="tag">图库</span></div>
|
||||
</div>
|
||||
|
||||
+85
-1
@@ -1,8 +1,92 @@
|
||||
{
|
||||
"app": "Image Workbench",
|
||||
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
|
||||
"updatedAt": "2026-11-25T14:46:09.915Z",
|
||||
"updatedAt": "2026-11-25T15:02:08.125Z",
|
||||
"releases": [
|
||||
{
|
||||
"version": "3.26.89",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.89_aarch64.dmg",
|
||||
"size": 8809590,
|
||||
"sha256": "de362b936310a0dec8e9b089f6320d0ff327b5eccea336d80dcd933d2b701485",
|
||||
"h": "de362b936310",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.89_x64.dmg",
|
||||
"size": 9224311,
|
||||
"sha256": "7706bff50455046c3d6cc2ac889627e54126c67e65e08466401056ec512acd69",
|
||||
"h": "7706bff50455",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.88",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.88_aarch64.dmg",
|
||||
"size": 8804615,
|
||||
"sha256": "02ffec8451bb26775b6fdaff2102c231ec26c8f6b50285317429aab04918d278",
|
||||
"h": "02ffec8451bb",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.88_x64.dmg",
|
||||
"size": 9915369,
|
||||
"sha256": "d8a4baefdf2e7fc55564bffde0c5d63c937c28f5ad294435ca81dd09ed5fee92",
|
||||
"h": "d8a4baefdf2e",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.87",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.87_aarch64.dmg",
|
||||
"size": 8807173,
|
||||
"sha256": "eaa37b812da780c5d06e2b029efef4364e2eeebd7ca9ce7046b1c8a1175fe22e",
|
||||
"h": "eaa37b812da7",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.87_x64.dmg",
|
||||
"size": 9228093,
|
||||
"sha256": "64934f36e6a0759964b5de3aabe4810fed56249ef2931f9b80fb17a8d6cd77b3",
|
||||
"h": "64934f36e6a0",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.86",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.86_aarch64.dmg",
|
||||
"size": 8806650,
|
||||
"sha256": "fd566d5e5682b14e73f2d3e5da906b533e1ab4441491ee60984df10404f1104c",
|
||||
"h": "fd566d5e5682",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.86_x64.dmg",
|
||||
"size": 9225115,
|
||||
"sha256": "7a90ef45d15b173bdfd0663c8367ef2a16bd9977791a18964b5e5ddb77d83e67",
|
||||
"h": "7a90ef45d15b",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.85",
|
||||
"date": "2026-11-25",
|
||||
|
||||
Generated
+1
-1
@@ -1983,7 +1983,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.26.85"
|
||||
version = "3.26.89"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.26.85"
|
||||
version = "3.26.89"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.26.85",
|
||||
"version": "3.26.89",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
download: call('download'),
|
||||
insert: call('insert'),
|
||||
remove: call('remove'),
|
||||
backfill: call('backfill'),
|
||||
openFolder: call('openFolder'),
|
||||
onChanged: function (fn) {
|
||||
if (typeof fn !== 'function') return function () {}
|
||||
@@ -63,7 +64,7 @@
|
||||
? Q.queryOutputs(list, { query: o.query || '', range: o.range || '', limit, width: 320, tile: 130 })
|
||||
: { filtered: list, visible: list.slice(0, limit), total: list.length }
|
||||
const items = (res.visible || []).map(function (f) {
|
||||
return { name: f.name, label: f.label || '', w: f.w || 0, h: f.h || 0, mtime: f.mtime || 0 }
|
||||
return { name: f.name, label: f.label || '', w: f.w || 0, h: f.h || 0, mtime: f.mtime || 0, orig: f.orig || (f.origIdb ? 'ok' : 'missing') }
|
||||
})
|
||||
return { items: items, total: res.total || items.length }
|
||||
}
|
||||
|
||||
@@ -1063,7 +1063,10 @@
|
||||
// 图库图片拖入 → 创建参考图节点;带 iwb-gallery-orig 标识 → 取清晰原图,失败回退稳定显示源
|
||||
const localRefPayload = e.dataTransfer && e.dataTransfer.getData('application/x-iwb-localref')
|
||||
const origName = e.dataTransfer && e.dataTransfer.getData('application/x-iwb-gallery-orig')
|
||||
if (localRefPayload || origName) {
|
||||
// 输出节点结果图拖入(v3.26.87):载荷是结果 URL;优先按 URL 在图库索引里找条目,
|
||||
// 命中就走「本地字节日录」(与图库拖入同一条链),没命中也不阻断 —— 直接用 URL 建参考图。
|
||||
const outputRefPayload = e.dataTransfer && e.dataTransfer.getData('application/x-iwb-output-ref')
|
||||
if (localRefPayload || origName || outputRefPayload) {
|
||||
const insertRef = (url) => {
|
||||
if (!url) { setNotice({ type: 'err', text: '无法取得该图片,拖入失败' }); return }
|
||||
const name = typeof url === 'string' ? (url.indexOf('http') === 0 ? (url.split('/').pop() || 'image') : (url.indexOf('data:') === 0 ? '参考图' : url)) : '参考图'
|
||||
@@ -1072,8 +1075,22 @@
|
||||
pushHistory() // 拖拽入画布新增节点:入撤销历史(鼠标落点保留)
|
||||
commitCanvas(refs.nodes.concat([node]), undefined, undefined)
|
||||
setSel([id])
|
||||
// 原生拖放期间 pointerup 不落到画布,节点手势可能残留(之后再点节点被当成收尾):
|
||||
// 插入后统一清一次,与提示词拖入的 settleDrop 同一理由。
|
||||
try { refs.bodyDown = null; refs.groupDown = null; refs.drag = null; refs.box = null; refs.pan = null } catch (e) { /* ignore */ }
|
||||
setNotice({ type: 'ok', text: '已插入图库参考节点' })
|
||||
}
|
||||
if (outputRefPayload) {
|
||||
const list = refs.outputs || outputs || []
|
||||
const item = list.find((x) => x && (x.url === outputRefPayload || x.name === outputRefPayload))
|
||||
const pickSrc = () => (item && typeof localSrcOfOutput === 'function' ? localSrcOfOutput(item) : Promise.resolve(outputRefPayload))
|
||||
Promise.resolve(pickSrc()).then(async (src) => {
|
||||
const raw = await refSrcOf(src || outputRefPayload, (msg) => setNotice({ type: 'err', text: msg }))
|
||||
const ref = (typeof raw === 'string' && raw.indexOf('data:') === 0) ? await wImgRefWrite(raw) : null
|
||||
insertRef(ref || raw || outputRefPayload)
|
||||
}).catch(() => insertRef(outputRefPayload))
|
||||
return
|
||||
}
|
||||
if (origName) {
|
||||
const item = (refs.outputs || outputs || []).find((x) => x && x.name === origName)
|
||||
// v3.26.61:拖入也走「本地字节目录」(含按需抓远程再落副本),与「插入」按钮同一条路,
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
onMouseEnter: () => setHover(true),
|
||||
onMouseLeave: () => setHover(false),
|
||||
},
|
||||
el('img', { className: props.cls || 'iwb-result-thumb', src: item.url, alt: 'img', loading: 'lazy', title: '点击放大', onClick: () => props.onPreview && props.onPreview(item.url) }),
|
||||
// 单击只让节点选中(不弹预览),双击才开大图:与输出节点结果图同一手势。
|
||||
el('img', { className: props.cls || 'iwb-result-thumb', src: item.url, alt: 'img', loading: 'lazy', title: '双击放大', onClick: (e) => { try { e.stopPropagation() } catch (err) { /* ignore */ } }, onDoubleClick: (e) => { try { e.stopPropagation() } catch (err) { /* ignore */ } if (props.onPreview) props.onPreview(item.url) } }),
|
||||
hover ? el('div', { className: 'iwb-rimg-actions' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '复制为参考图节点', onClick: doCopyRef }, props.copyIcon || '⧉', ' 复制到画布'),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '复制图片链接', onClick: doCopyLink }, '🔗 链接'),
|
||||
|
||||
@@ -829,7 +829,7 @@
|
||||
downloadUrl(src, 'image.png')
|
||||
}
|
||||
const doCopy = () => props.onCopyRef && props.onCopyRef(r.url)
|
||||
const imgEl = el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', src: wPreviewUrlOf((typeof wImgSrcForNode === 'function' ? wImgSrcForNode : wDisplayThumbOf)(thumbOf(r), Math.max(120, Math.min(360, (node && node.w ? node.w - 40 : 240))))), draggable: false, style: { aspectRatio: (r.width && r.height) ? String(r.width) + ' / ' + String(r.height) : undefined }, title: r.idb && r.data ? '缩略图 · 单击选中 / 双击查看原图' : '单击选中 / 双击放大(可左右切换)', onError: (e) => { if (e.currentTarget && e.currentTarget.src !== r.url) e.currentTarget.src = r.url }, onDoubleClick: (e) => { e.stopPropagation(); openPreviewAt(cur) } })
|
||||
const imgEl = el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', src: wPreviewUrlOf((typeof wImgSrcForNode === 'function' ? wImgSrcForNode : wDisplayThumbOf)(thumbOf(r), Math.max(120, Math.min(360, (node && node.w ? node.w - 40 : 240))))), draggable: true, style: { aspectRatio: (r.width && r.height) ? String(r.width) + ' / ' + String(r.height) : undefined }, title: r.idb && r.data ? '单击选中 · 双击查看原图 · 拖到画布作参考图' : '单击选中 · 双击放大(可左右切换)· 拖到画布作参考图', onError: (e) => { if (e.currentTarget && e.currentTarget.src !== r.url) e.currentTarget.src = r.url }, onPointerDown: (e) => { e.stopPropagation(); props.onSelect && props.onSelect(node.id) }, onDragStart: (e) => { try { const u = r.url || ''; e.dataTransfer.setData('application/x-iwb-output-ref', u); e.dataTransfer.setData('text/plain', u); e.dataTransfer.effectAllowed = 'copy' } catch (err) { /* 浏览器拒写自定义 MIME 时仍保留 text/plain */ } }, onDoubleClick: (e) => { e.stopPropagation(); openPreviewAt(cur) } })
|
||||
// 下载浮层:与图库共用同一组 hover token;组件缺失时退回旧的双小按钮(单文件/旧加载顺序)
|
||||
const DlOv = (typeof global !== 'undefined' && global.IWBResultDownloadOverlay) || null
|
||||
const actions = DlOv ? null : el('div', { className: 'iwb-out-cell-actions' },
|
||||
|
||||
@@ -108,12 +108,13 @@ function makeImageLibSection (draft, setDraft, backfillOutputOriginals) {
|
||||
el('div', { className: 'iwb-gset-row-label' }, '原图'),
|
||||
el('div', { className: 'iwb-gset-row-ctl' },
|
||||
el('label', { className: 'iwb-check' },
|
||||
el('input', { type: 'checkbox', checked: draft.canvas.backupOriginals === true, onChange: (e) => setDraft((d) => ({ ...d, canvas: { ...d.canvas, backupOriginals: e.target.checked } })) }, null),
|
||||
' 入库时同时保留原图',
|
||||
el('input', { type: 'checkbox', checked: isDesk() || draft.canvas.backupOriginals === true, disabled: isDesk(), onChange: (e) => setDraft((d) => ({ ...d, canvas: { ...d.canvas, backupOriginals: e.target.checked } })) }, null),
|
||||
' 入库时同时保留原图' + (isDesk() ? '(桌面端强制开启)' : ''),
|
||||
),
|
||||
),
|
||||
),
|
||||
el('div', { className: 'iwb-gset-hint' }, '不保留则只存缩略图,导出时可能只剩远程链接;桌面端取原图走原生 HTTP,不受图床跨域限制。'),
|
||||
el('div', { className: 'iwb-gset-hint' }, isDesk() ? '桌面端固定把原图写进资料目录 images/gallery(图床链接会过期,只有本地文件可靠);缩略图单独存 images/thumbs,用于列表快速显示。' : '不保留则只存缩略图,导出时可能只剩远程链接;桌面端取原图走原生 HTTP,不受图床跨域限制。'),
|
||||
(!isDesk() && draft.canvas.backupOriginals !== true) ? el('div', { className: 'iwb-hint iwb-err' }, '已关闭原图入库:新生成的图片只保存 320px 缩略图,图床链接失效后原图无法恢复。建议开启。') : null,
|
||||
el('div', { className: 'iwb-gset-row' },
|
||||
el('div', { className: 'iwb-gset-row-label' }, '补存'),
|
||||
el('div', { className: 'iwb-gset-row-ctl' },
|
||||
@@ -469,7 +470,7 @@ function SettingsModal(props) {
|
||||
const targets = files.filter((f) => f && f.idb && !f.origIdb)
|
||||
if (!targets.length) { setFolderMsg('没有需要补存的图片(原图都已备份)'); return }
|
||||
let ok = 0
|
||||
for (const f of targets) { const key = await storeOutputThumb(f); if (key) ok++ }
|
||||
for (const f of targets) { const key = await storeOutputThumb(f, true); if (key) ok++ }
|
||||
setFolderMsg('补存完成:' + ok + ' / ' + targets.length + ' 张;重新打开图库查看原图')
|
||||
try { props.onRefreshOutputs && props.onRefreshOutputs() } catch (e) { /* ignore */ }
|
||||
} catch (e) { setFolderMsg('补存失败:' + String((e && e.message) || e)) }
|
||||
|
||||
@@ -29,7 +29,7 @@ async function boot (opts) {
|
||||
style.textContent = css
|
||||
window.document.head.appendChild(style)
|
||||
|
||||
const calls = { list: [], insert: [], remove: [], preview: [] }
|
||||
const calls = { list: [], insert: [], remove: [], preview: [], backfill: [] }
|
||||
const items = opts.items
|
||||
const ctx = {
|
||||
ui: { registerPanel (p) { boot.panel = p } },
|
||||
@@ -41,6 +41,7 @@ async function boot (opts) {
|
||||
insert: async (names, o) => { calls.insert.push([names.slice(), o]); return { ok: true } },
|
||||
download: async () => ({ ok: true }),
|
||||
remove: async (names) => { calls.remove.push(names.slice()); return { ok: true } },
|
||||
backfill: async (names) => { calls.backfill.push(names.slice()); return { ok: names.length, failed: [] } },
|
||||
},
|
||||
}
|
||||
reg.f(ctx)
|
||||
@@ -76,6 +77,31 @@ async function boot (opts) {
|
||||
assert.strictEqual(env.host.querySelectorAll('.iwb-history-item img').length, 2, '两张都应重新挂上 img')
|
||||
}
|
||||
|
||||
// ---------- ②b 仅缩略图:角标 + 底栏统计 + 批量补存(v1.7.4)----------
|
||||
{
|
||||
const env = await boot({
|
||||
items: [{ name: 'lost.png', w: 200, h: 300, orig: 'missing' }, { name: 'ok.png', w: 200, h: 300, orig: 'ok' }],
|
||||
thumb: () => GOOD,
|
||||
})
|
||||
const badge = env.host.querySelector('.iwb-gal-origbadge')
|
||||
assert.ok(badge, '原图缺失的格子应有「仅缩略图」角标')
|
||||
assert.strictEqual(badge.textContent, '仅缩略图')
|
||||
const stat = env.host.querySelector('.iwb-gal-orig')
|
||||
assert.notStrictEqual(stat.style.display, 'none', '底栏应显示仅缩略图统计')
|
||||
assert.ok(/1 张仅缩略图/.test(stat.textContent), '统计文案不符:' + stat.textContent)
|
||||
stat.dispatchEvent(new env.window.MouseEvent('click', { bubbles: true }))
|
||||
await wait(60)
|
||||
assert.deepStrictEqual(env.calls.backfill[0], ['lost.png'], '点统计应只补存缺失的那张')
|
||||
// 右键:只在缺失条目上多出「补存原图」(补存后会重拉,等它渲染完再开菜单)
|
||||
await wait(140)
|
||||
const boxes = env.host.querySelectorAll('.iwb-history-item')
|
||||
boxes[0].dispatchEvent(new env.window.MouseEvent('contextmenu', { bubbles: true, clientX: 20, clientY: 20 }))
|
||||
await wait(30)
|
||||
const labels = Array.from(env.document.querySelectorAll('.iwb-gal-menu .iwb-ctx-item')).map((b) => b.textContent)
|
||||
assert.ok(labels.indexOf('补存原图') >= 0, '缺失条目菜单应含补存原图:' + labels.join('|'))
|
||||
env.document.dispatchEvent(new env.window.KeyboardEvent('keydown', { key: 'Escape', bubbles: true }))
|
||||
}
|
||||
|
||||
// ---------- ③ 右键菜单 ----------
|
||||
{
|
||||
const env = await boot({ items: [{ name: 'a.png', w: 200, h: 300 }], thumb: () => GOOD })
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
'use strict'
|
||||
// 结果图手势契约(2026-11-26):单击只选中、双击才预览。
|
||||
// 用假 React 记录 createElement 的树,直接调用组件函数——不需要 jsdom/React 运行时,
|
||||
// 断言的是「实际渲染出来的 props」,不是源码文本。
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const vm = require('vm')
|
||||
|
||||
const root = path.resolve(__dirname, '..')
|
||||
const React = {
|
||||
createElement(type, props) {
|
||||
const children = Array.prototype.slice.call(arguments, 2)
|
||||
return { type, props: Object.assign({}, props || {}, { children }) }
|
||||
},
|
||||
useState(init) { return [init, function () {}] },
|
||||
}
|
||||
const sandbox = { React }
|
||||
vm.runInNewContext(fs.readFileSync(path.join(root, 'src', 'ui-components.js'), 'utf8'), sandbox)
|
||||
|
||||
const findImg = (tree) => {
|
||||
if (!tree || typeof tree !== 'object') return null
|
||||
if (tree.type === 'img') return tree
|
||||
for (const c of (tree.props && tree.props.children) || []) {
|
||||
const hit = findImg(c)
|
||||
if (hit) return hit
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
// 1) ResultImg:单击不预览,双击预览
|
||||
let previewed = ''
|
||||
const img = findImg(sandbox.IWBResultImg({ item: { url: 'https://x/a.png' }, onPreview: (u) => { previewed = u } }))
|
||||
assert.ok(img, 'ResultImg 必须渲染出 img')
|
||||
assert.strictEqual(typeof img.props.onDoubleClick, 'function', '双击必须绑定预览')
|
||||
assert.strictEqual(typeof img.props.onClick, 'function', '单击仍需有处理器(阻止冒泡)')
|
||||
img.props.onClick({ stopPropagation() {} })
|
||||
assert.strictEqual(previewed, '', '单击不得触发预览')
|
||||
img.props.onDoubleClick({ stopPropagation() {} })
|
||||
assert.strictEqual(previewed, 'https://x/a.png', '双击必须带上图片 URL')
|
||||
|
||||
// 2) 共享下载浮层:按钮存在、点击回调正确、pointerdown 不冒泡到节点拖动
|
||||
let downloaded = 0
|
||||
let copied = 0
|
||||
let stopped = 0
|
||||
const ov = sandbox.IWBResultDownloadOverlay({
|
||||
onDownload: () => { downloaded++ },
|
||||
onCopyRef: () => { copied++ },
|
||||
children: { type: 'img', props: {} },
|
||||
})
|
||||
const bar = ov.props.children.find((c) => c && c.props && c.props.className === 'iwb-dl-bar')
|
||||
assert.ok(bar, '浮层必须渲染底部条')
|
||||
const btns = bar.props.children.filter(Boolean)
|
||||
assert.strictEqual(btns.length, 2, '浮层应有复制 + 下载两个按钮')
|
||||
btns[0].props.onClick({ stopPropagation() {} })
|
||||
btns[1].props.onClick({ stopPropagation() {} })
|
||||
btns[1].props.onPointerDown({ stopPropagation() { stopped++ } })
|
||||
assert.strictEqual(copied, 1)
|
||||
assert.strictEqual(downloaded, 1)
|
||||
assert.strictEqual(stopped, 1, 'pointerdown 必须阻止冒泡(否则会拖动节点)')
|
||||
|
||||
console.log('result-img gestures: 全部通过')
|
||||
Reference in new issue
Block a user