Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1a7ec8f76 | ||
|
|
1961f415ca | ||
|
|
7b43002f6b | ||
|
|
ebc6ce1251 | ||
|
|
55408acca1 | ||
|
|
0ae9c6091c | ||
|
|
e63f3eea48 | ||
|
|
40607a48be | ||
|
|
43d6a63f9f | ||
|
|
e482ce502d | ||
|
|
d9d293e6b1 | ||
|
|
a4c5ccad0e | ||
|
|
5bf9ed4932 | ||
|
|
2cab369c53 | ||
|
|
7f262da430 | ||
|
|
a7f33e5256 | ||
|
|
20bb89b5b6 | ||
|
|
3bdb0ad882 | ||
|
|
46c797880a | ||
|
|
3eb001a8f2 | ||
|
|
37f9a965a4 | ||
|
|
affd8ab354 | ||
|
|
772e668195 | ||
|
|
ed1f50f2ad | ||
|
|
6fcaf0f86f | ||
|
|
08887e448e | ||
|
|
6ce95c0d94 | ||
|
|
52ba7c5efc | ||
|
|
da7ba1bfd1 |
No files matched your search
@@ -16,6 +16,69 @@
|
||||
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
|
||||
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
|
||||
|
||||
## 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 棘轮零增长。
|
||||
- **输出节点结果图**:底部渐变下载浮层(新共享组件 `ResultDownloadOverlay`),hover 抬 2px + 1.02 缩放 + 投影 + 品牌描边;**单击选中、双击开预览**(不再单击即弹预览)。下载/复制按钮只在悬停或键盘聚焦时出现。
|
||||
- **图库插件 1.7.3**(已上架插件市场):卡片 hover 上浮 + 阴影 + 品牌描边,原本在卡片下方的「下载」移到**底部渐变浮层**;与输出节点共用宿主 token(插件侧带 fallback,旧客户端不崩)。
|
||||
- 两处都支持 `prefers-reduced-motion: reduce`(只保留颜色/阴影,不做位移与缩放)。
|
||||
|
||||
## v3.26.84(2026-11-26)图库落盘自检:先在诊断页看清「图在哪一层」
|
||||
|
||||
- 设置 → 诊断 →「存储体检」新增**图库落盘自检**:逐条判定 **原图 OK / 仅缩略图 / 全丢**。桌面端会真的去 `images/gallery` 查文件是否存在(只查存在性,不读字节,避免诊断本身把堆顶撑高)。
|
||||
- 报告包含:资料目录、索引条数、**未被任何条目引用的原图**、本次会话原图写入成功/失败与失败原因;可一键复制,不含 Key 与图片内容。
|
||||
- 写入侧只在存储层加会话计数(`out_orig_` 成功/失败),**不改生成与归档流程**;浏览器路径按 IDB 键集合判定。
|
||||
- 新增 `src/gallery-audit.js`(纯函数 + 可注入事实)与 `tests/gallery-audit-test.js`;app.js 只多 1 行装配(棘轮 9182 → 9183,已在代码内记账)。
|
||||
|
||||
> 这是只读诊断,先拿到「你机器上属于哪一类」再动落盘逻辑;修复批次在后续版本。
|
||||
|
||||
## v3.26.83(2026-11-26)相册格子 hover 动效 + 输出节点双击预览
|
||||
|
||||
- 相册节点:格子 hover 只做 1.06 缩放 + 阴影 + 品牌描边(网格内不位移,避免相邻格子抖动),尊重 reduced-motion。
|
||||
- 输出节点:结果图**双击**打开预览,单击只选中(此前单击即预览,容易误触)。
|
||||
|
||||
> 说明:图库落盘诊断、下载浮层、结果图拖拽到画布、生成即落盘等批次仍在排队(见 BACKLOG/本轮计划)。
|
||||
|
||||
## v3.26.82(2026-11-26)插件图标规范统一:一处声明,四处生效
|
||||
|
||||
**单一来源**:`resolvePluginIcon(pluginId, variantIcon)`,解析顺序
|
||||
`variant.icon → manifest.icon → 宿主 PLUGIN_ICONS → puzzle`,且只接受宿主图标白名单里的名字。
|
||||
|
||||
**四处统一**:画布节点标题 / 底栏「插件节点」列表 / 右键菜单「插件节点」组 / 设置页插件分区,全部调用同一个解析器。
|
||||
此前右键菜单用「播放三角」、设置页用星标/独立映射表,同一插件在不同位置图标不一致。
|
||||
|
||||
## v3.26.81(2026-11-26)插件节点图标/入口:补上丢失的一跳
|
||||
|
||||
v3.26.80 里插件注册的 `icon` / `toolbar` 在「传给底栏组件」的映射中被丢掉(只透传了 id/title/defaults/run),
|
||||
所以底栏仍显示统一拼图、隐藏项仍出现。本次把两个字段一起透传,图标与入口范围才真正生效。
|
||||
|
||||
## v3.26.80(2026-11-26)插件节点图标与入口范围
|
||||
|
||||
- 底栏「插件节点」列表:每项使用插件自己的图标(相册=拼图、网页=地球、便利贴=标签、提示词模板=书、样式节点=调色板),不再统一拼图。
|
||||
- 图标解析改为四级:插件声明 variant.icon → 宿主映射 → 拼图兜底,且只接受宿主图标白名单里的名字。
|
||||
- 入口范围:支持插件声明 toolbar:"hide" 自隐藏;本轮先由宿主强制隐藏「提示词模板」「样式节点」(它们有专属入口,插件下次发版可自助声明)。
|
||||
|
||||
## v3.26.79(2026-11-26)设置页:每个插件配上对应图标
|
||||
|
||||
- 设置 → 左侧「插件」分区不再一律星标:相册=拼图、空白画布=面板、浏览器=地球、图库=图片、节点组=编组、
|
||||
|
||||
+2
-2
@@ -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 129 个单测文件(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)
|
||||
@@ -102,7 +102,7 @@ IWB_WRITE_BOUNDARY_SNAPSHOT=1 node tests/architecture-boundary-guard-test.js #
|
||||
|
||||
| 守卫 | 位置 | 现在的上限 |
|
||||
|---|---|---|
|
||||
| `app.js` 总行数 | `tests/source-text-ratchet-test.js` `MAX_APP_JS_LINES` | **9,173**(另守「占总源码 ≤ 40%」,见 `MAX_APP_JS_SHARE`) |
|
||||
| `app.js` 总行数 | `tests/source-text-ratchet-test.js` `MAX_APP_JS_LINES` | **9,183**(另守「占总源码 ≤ 40%」,见 `MAX_APP_JS_SHARE`) |
|
||||
| `Workbench()` 行数 | 同上 `MAX_WORKBENCH_LINES` | **3,046** |
|
||||
| 单组件行数(不含 Workbench)| 同上 `MAX_APP_COMPONENT_LINES` | **423** |
|
||||
|
||||
|
||||
@@ -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 || !!(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)
|
||||
@@ -2863,6 +2863,7 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
const outputs = lsGet(OUT_KEY, [])
|
||||
const res = StorageHealth.audit({ idbKeys, outputsIndex: Array.isArray(outputs) ? outputs : [], prefixes: { blob: IMG_BLOB_PREFIX, ref: IDB_REF_PREFIX, out: IDB_OUT_PREFIX, orig: IDB_ORIG_PREFIX } })
|
||||
try { const PD = window.IWBPluginData; if (PD && PD.totalSize) { const t = await PD.totalSize(); res.pluginDataBytes = t.bytes; res.pluginDataCount = t.count } } catch (e) { /* M2:插件数据纳入体检 */ }
|
||||
res.gallery = await (window.IWBGalleryAudit ? window.IWBGalleryAudit.run({ index: outputs, storageFile: window.IWBStorageFile, idbKeys }) : null) // 图库落盘三态(src/gallery-audit.js)
|
||||
return res
|
||||
}
|
||||
// 一键安全回收:复用保存路径的 wCleanIdb(带活引用 keep-set),绕过 30s 节流手动触发一次。
|
||||
@@ -3385,8 +3386,15 @@ try { if (window.IWBMiniMapFit && typeof window.IWBMiniMapFit.install === 'funct
|
||||
// P2-11b-1a:节点类型注册表(NODE_TYPES)。内置类型从四表 seed;插件/动态类型运行时经 registerNodeType 注册。
|
||||
// 四张字面表保持不动(守门第 6 组按字面文本校验),注册表在其上叠加;读取点逐步改走注册表(1b)。
|
||||
// 插件图标(按插件 id 指定,统一视觉;manifest 自带 icon 时优先用 manifest 的)
|
||||
const PLUGIN_ICONS = { 'image-annotate': 'pencil-ruler', 'xianyi-cutout': 'scissors', 'white-bg-800': 'vector-square', 'image-vectorize': 'pen-tool' }
|
||||
const PLUGIN_ICONS = { album: 'puzzle', browser: 'globe', sticky: 'tag', gallery: 'ref', grouplib: 'group', promptlib: 'book', 'style-source': 'palette', 'white-bg-800': 'layout', 'image-annotate': 'edit', 'image-vectorize': 'tool', 'xianyi-cutout': 'scissors', 'batch-export': 'archive', 'blank-canvas': 'panel' }
|
||||
// 插件图标解析(2026-11-26):插件声明 → 宿主映射 → 拼图兜底;只接受 ICONS 白名单里的名字。
|
||||
const pluginIconOf = (id) => PLUGIN_ICONS[String(id || '')] || undefined
|
||||
const PLUGIN_TOOLBAR_HIDE = { promptlib: true, 'style-source': true }
|
||||
const wPluginDeclaredIcons = {} // pluginId → manifest.icon(插件清单级声明)
|
||||
const resolvePluginIcon = (pluginId, declared) => {
|
||||
const ok = (n) => (typeof n === 'string' && Object.prototype.hasOwnProperty.call(ICONS, n)) ? n : ''
|
||||
return ok(declared) || ok(wPluginDeclaredIcons[pluginId]) || ok(pluginIconOf(pluginId)) || 'puzzle'
|
||||
}
|
||||
const NODE_TYPES = new Map()
|
||||
// 注册表版本号(2026-11-14):插件节点体(render)是**异步**注册的 —— 冷启动时画布先按存档把节点画出来,
|
||||
// 那一刻插件脚本还在下载,`NODE_TYPES.get(type).render` 是 null ⇒ 走通用兜底体(hint + textarea),
|
||||
@@ -8203,7 +8211,9 @@ const tbCenterSeed = (type, refs) => {
|
||||
// Key/服务状态:仅异常时显示(逻辑在 src/runtime-workbench-logic.js.keyAnomalyOf)
|
||||
const keyAnomaly = IWWorkbenchLogic.keyAnomalyOf(config)
|
||||
|
||||
const pluginNodeVariants = React.useMemo(() => wPluginNodeVariants.map((v) => ({ id: v.id, title: v.title, defaults: v.defaults, run: v.run })), [pluginRev])
|
||||
// 传到底栏/菜单时**必须带上 icon / toolbar**(2026-11-26):此前只透传 id/title/defaults/run,
|
||||
// 插件注册的图标与入口范围在这一步被丢掉 ⇒ 底栏仍全是拼图、隐藏项仍出现。
|
||||
const pluginNodeVariants = React.useMemo(() => wPluginNodeVariants.map((v) => ({ id: v.id, title: v.title, defaults: v.defaults, run: v.run, icon: v.icon, toolbar: v.toolbar })), [pluginRev])
|
||||
const pluginNodeActionItems = React.useMemo(() => wPluginNodeActions.map((a) => ({ id: a.id, title: a.title, icon: a.icon, appliesTo: a.appliesTo, run: a.run })), [pluginRev])
|
||||
// 左侧综合工具栏(v3.3:顶部「无限画布」标题 / 工作台分区 / 底部 文件·设置·帮助)
|
||||
// S12/S13:统一常驻标签栏(首页+画布视图都显示,对齐 Figma 式浏览器标签)
|
||||
@@ -8344,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) {
|
||||
@@ -8685,6 +8695,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
defaults: { left: { open: true, w: 318, list: ['groups', 'browser', 'styles'], active: 'browser' }, right: { open: true, w: 330, list: ['prompts', 'gallery'], active: 'gallery' } },
|
||||
onReject: (msg) => showToast(msg, 'err') }) : null,
|
||||
settingOpen ? ReactDOM.createPortal(el(SettingsModal, {
|
||||
pluginIcon: (pid) => resolvePluginIcon(pid),
|
||||
initialTab: settingTabReq,
|
||||
BackupModal: BackupModal,
|
||||
onSaveNow: saveNow,
|
||||
@@ -8721,7 +8732,7 @@ const tbCenterSeed = (type, refs) => {
|
||||
[['prompt', '提示词', I('file-text')], ['ref', '图片', I('ref')], ['textout', '文本', I('textout')], ['combine', '组合', I('server-plus')], ['batch', '连接', I('batch')], ['relay', '中继', I('circle-dot')], ['gen', '配置', I('gen')], ...(wPrivateToolsOn ? [['llm', '润色', I('llm')], ['layer', '分层', I('layer')]] : []), ['out', '输出', I('presentation')]].map(([t, label, ic]) => el('button', { key: t, className: 'iwb-ctx-item', onClick: () => { addNode(t, Math.round(ctxMenu.wx - NODE_W / 2), Math.round(ctxMenu.wy - 20)); setCtxMenu(null) } }, ic, el('span', { className: 'iwb-btn-text' }, label))),
|
||||
// 插件节点单独成组(2026-11-19 用户要求):与内置节点之间加分割线 + 组标题,
|
||||
// 不再挤在「输出」后面让用户以为也是内置类型。插件停用/未装时整组(含分隔线)不渲染。
|
||||
...(pluginNodeVariants.length ? [el('div', { key: 'plug-sep', className: 'iwb-ctx-sep' }, null), el('div', { key: 'plug-title', className: 'iwb-ctx-title' }, '插件节点'), ...pluginNodeVariants.map((v) => el('button', { key: 'plugin-node-' + v.id, className: 'iwb-ctx-item', onClick: () => { addPluginNode(v.id, Math.round(ctxMenu.wx - NODE_W / 2), Math.round(ctxMenu.wy - 20)); setCtxMenu(null) } }, I('run'), el('span', { className: 'iwb-btn-text' }, String(v.title || v.id))))] : []),
|
||||
...(pluginNodeVariants.length ? [el('div', { key: 'plug-sep', className: 'iwb-ctx-sep' }, null), el('div', { key: 'plug-title', className: 'iwb-ctx-title' }, '插件节点'), ...pluginNodeVariants.map((v) => el('button', { key: 'plugin-node-' + v.id, className: 'iwb-ctx-item', onClick: () => { addPluginNode(v.id, Math.round(ctxMenu.wx - NODE_W / 2), Math.round(ctxMenu.wy - 20)); setCtxMenu(null) } }, I(v.icon || 'puzzle'), el('span', { className: 'iwb-btn-text' }, String(v.title || v.id))))] : []),
|
||||
el('div', { className: 'iwb-ctx-sep' }, null),
|
||||
// 两组收进二级菜单(2026-11-19 用户要求:一级 18 项太长)。入口是普通 button:
|
||||
// hover / 键盘 Tab / 点击获得焦点都会用 :focus-within 展开,条目与原来完全一致。
|
||||
@@ -9003,11 +9014,11 @@ items.push(el('button', { key: 'bgc', className: 'iwb-ctx-item', onClick: (e) =>
|
||||
: { in: true, out: true }
|
||||
const height = Number.isFinite(variant.height) ? variant.height : 200
|
||||
const color = (typeof variant.color === 'string' && variant.color) ? variant.color : '#969696'
|
||||
const entry = { id: String(variant.id), title: String(variant.title), defaults: variant.defaults || {}, run: typeof variant.run === 'function' ? variant.run : null, pluginId: ctx.id, w: Number.isFinite(variant.width) ? variant.width : undefined }
|
||||
const entry = { id: String(variant.id), title: String(variant.title), defaults: variant.defaults || {}, run: typeof variant.run === 'function' ? variant.run : null, pluginId: ctx.id, icon: resolvePluginIcon(ctx.id, variant.icon), toolbar: (variant.toolbar === 'hide' || PLUGIN_TOOLBAR_HIDE[ctx.id]) ? 'hide' : 'show', w: Number.isFinite(variant.width) ? variant.width : undefined }
|
||||
wPluginNodeVariants.push(entry)
|
||||
owned.push(entry)
|
||||
wPluginVariantMeta.set(entry.id, { id: entry.id, title: entry.title, defaults: entry.defaults, pluginId: ctx.id, ports: ports, height: height })
|
||||
registerNodeType({ id: pluginTypeId(ctx.id, entry.id), title: entry.title, defaults: entry.defaults, height: height, color: color, hasTitle: true, producer: false, ports: ports, icon: pluginIconOf(ctx.id) || entry.icon, run: entry.run, render: typeof variant.render === 'function' ? variant.render : null })
|
||||
registerNodeType({ id: pluginTypeId(ctx.id, entry.id), title: entry.title, defaults: entry.defaults, height: height, color: color, hasTitle: true, producer: false, ports: ports, icon: entry.icon, run: entry.run, render: typeof variant.render === 'function' ? variant.render : null })
|
||||
try {
|
||||
const meta = ctx.storage && typeof ctx.storage.namespace === 'function' ? ctx.storage.namespace('__nodeTypes') : null
|
||||
if (meta) meta.set(entry.id, { id: entry.id, title: entry.title, defaults: entry.defaults, ports: ports, height: height })
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 现状架构与性能事实基线(桌面版)
|
||||
|
||||
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
|
||||
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = eca66de`(线上 `v3.26.79+eca66de` —— 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 = 7b43002`(线上 `v3.26.88+7b43002` —— 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,172 行**(**双层预算**:绝对上限 9,173 / 占总源码 ≤ 40%,现 **29.9%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **3,040 行**(上限 **3,046**,余量 6;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **111** 个模块 / 21,520 行,`sourceModules` 111 项;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. 门禁与环境现状
|
||||
@@ -167,7 +167,7 @@
|
||||
- 同一张图被 3 个节点引用、hydrate 成 3 个不同 objectURL 时,preview/display 缓存各自 miss → 重复解码(与 F2 相邻)。
|
||||
- **F10|`refs.genScheduler` 是桩** (A) → 未接线,暂无运行时影响(P3)。
|
||||
- **F11|已建但未接线的模块层(2026-10-17 接线审计;2026-10-18 复核更正)** (A)
|
||||
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**111 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
|
||||
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**112 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
|
||||
- **仅被测试引用(9 模块 + 2 导出)**:`canvas-domain`、`generation-retry`、`generation-service`、`runtime-recovery-runner`、`runtime-state-bridge`、`runtime-store`、`storage-reconcile`、`storage-result`、`workspace-service`;导出 `IWBStorageHealthFactory`、`IWBPluginHostFactory`。(`storage-result` 是**存储层共享结果类型**,被 6 个存储模块读取,**非死代码**;`runtime-store` 为状态模型 epic 地基。)
|
||||
- **app.js 零引用(1 模块 + 3 导出)**:模块 `generation-controller`;导出 `IWBRuntimeMetricsFactory`、`IWBStorageRuntimeFactory`、`IWBUIComponents`。`canvas-relations` 已随 `06cf211` 删除(本文档早前把它列为"唯一可删者",实际已删)。零引用证据 = `grep -rn "<名字>" .`(排除 `node_modules|dist|vendor|test-results`)**只命中其自身赋值行**。
|
||||
- **半接线 / 未接线**:`IWBRuntimeStateBridge` **无 app.js 引用(仅测试)**;`IWBRuntimeRunContext` **已接线**(`runNode` 读取运行上下文);`IWBGenerationController` 是完整但**从未被调用**的工厂;`ModularWorkspaceStore`(`app.js` 内)是 `storage-workspace` 的**预留接线 seam**(当前无下游使用,保留);`window.IWBImageFolder` 自注册后读回(装载路径)。
|
||||
@@ -183,7 +183,7 @@
|
||||
| `storage-reconcile` | 存储对账(`createReconciler`/`check`) | 内联对账 | 存储层收口 |
|
||||
| `runtime-recovery-runner` | 执行恢复候选(`candidate`/`valid`/`run`) | 内联恢复 | 断点恢复 |
|
||||
| `canvas-domain` | 画布域模型(`commit`/`updateNode`/`deleteNodes`…) | `CanvasStore` 那一套 | Workbench 解耦(P2-9) |
|
||||
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**92** 项)与 `sourceModules` 顺序(**111** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
|
||||
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**93** 项)与 `sourceModules` 顺序(**112** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
|
||||
|
||||
## 12. 易踩的坑
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
|
||||
**信任模型(必须明示)**:形态 A 的插件是**可信代码**(与核心同权限、无沙箱);启停与设置是 UX 与可维护性手段,**不是安全边界**(同 §13.27 教训:前端开关一定可被绕过)。
|
||||
|
||||
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**92** 项)与 `sourceModules` 顺序(**111** 项);新增模块、新增耦合、新增 dev 探针都**必须有意重生成对应快照**(`IWB_WRITE_BOUNDARY_SNAPSHOT=1`)。契约与行为的可执行验证在 `tests/plugin-host-test.js`(宿主单测)与 `tests/_plugin-host-probe.spec.js`(真实浏览器探针,`_` 前缀 + `iwb-dev-probe`,不进 34 门禁)。
|
||||
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**93** 项)与 `sourceModules` 顺序(**112** 项);新增模块、新增耦合、新增 dev 探针都**必须有意重生成对应快照**(`IWB_WRITE_BOUNDARY_SNAPSHOT=1`)。契约与行为的可执行验证在 `tests/plugin-host-test.js`(宿主单测)与 `tests/_plugin-host-probe.spec.js`(真实浏览器探针,`_` 前缀 + `iwb-dev-probe`,不进 34 门禁)。
|
||||
|
||||
**关键陷阱**:`normalizeNodes`(现位于 `src/canvas-normalize.js`)会**静默丢弃**不在 `NODE_H` 里的节点类型 ⇒ 新增节点类型必须先登记 `NODE_H`,否则节点一刷新就消失(§13.27 规则三的同一失败模式)。
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.26.79",
|
||||
"version": "3.26.88",
|
||||
"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/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 tests/theme-contrast-test.js && node testLine 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",
|
||||
|
||||
@@ -812,7 +812,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'album',
|
||||
name: '相册',
|
||||
version: '1.1.2',
|
||||
version: '1.1.3',
|
||||
apiVersion: 1,
|
||||
capabilities: ['nodeTypes', 'images', 'files'],
|
||||
settings: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "album",
|
||||
"name": "相册",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"apiVersion": 1,
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
@@ -14,7 +14,7 @@
|
||||
"出图"
|
||||
],
|
||||
"files": {
|
||||
"main.js": "347256e31ed53389646664de35e3285a74e917c1629034bc0a8ba6b287f7eaf0",
|
||||
"main.js": "bc5f999f65db73cff167c140b49f8fb7bfc1233d7ec59f1280fa464c17a0df82",
|
||||
"styles.css": "b61e806abee9dd8889aa1a12c8791d428feacab93fac64f89c18c589de390706"
|
||||
}
|
||||
}
|
||||
+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.2',
|
||||
version: '1.7.4',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'gallery'],
|
||||
data: { schemaVersion: 1, maxBytes: 65536 },
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "gallery",
|
||||
"name": "图库",
|
||||
"version": "1.7.2",
|
||||
"version": "1.7.4",
|
||||
"apiVersion": 1,
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
@@ -13,7 +13,7 @@
|
||||
"图库"
|
||||
],
|
||||
"files": {
|
||||
"main.js": "6f29e9ba66e358769d9b8c07b35c0f0a9ec76c244cf74139a61ba5ca74ddb41e",
|
||||
"styles.css": "1dfd72b60bcaea9c43e103ba9758113efec02b6241d08fa0ab9c75d7848afb55"
|
||||
"main.js": "30b804a02aa15bdb54cfc6520c9ce5e0e58db08dd658ff262770cb08108383c1",
|
||||
"styles.css": "14d374b5d0e1461cb1ca2b125865e9c27df7c3bd79c11caa0afc52152c7d0aef"
|
||||
}
|
||||
}
|
||||
@@ -69,14 +69,39 @@
|
||||
.iwb-history-embedded .iwb-history-item img {
|
||||
width: 100%; height: auto; display: block; object-fit: contain; margin: 0 auto;
|
||||
border-radius: 6px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); cursor: pointer;
|
||||
transition: transform var(--iwb-motion-hover, .15s) var(--iwb-ease-hover, ease-out),
|
||||
border-color var(--iwb-motion-hover, .15s) var(--iwb-ease-hover, ease-out),
|
||||
box-shadow var(--iwb-motion-hover, .15s) var(--iwb-ease-hover, ease-out);
|
||||
}
|
||||
/* v1.7.3:卡片悬停上浮 + 阴影 + 品牌描边(与输出节点共用宿主 L2 token)。
|
||||
用 item:hover 而不是 img:hover:指针移到下载浮层按钮上时卡片仍保持浮起,不抖。 */
|
||||
.iwb-history-embedded .iwb-history-item:hover img {
|
||||
transform: translateY(var(--iwb-hover-lift, -2px)) scale(var(--iwb-hover-scale, 1.02));
|
||||
border-color: var(--iwb-hover-border, var(--iwb-brand));
|
||||
box-shadow: var(--iwb-hover-shadow, 0 5px 16px rgba(0, 0, 0, .22));
|
||||
}
|
||||
.iwb-history-missing {
|
||||
display: flex; align-items: center; justify-content: center; text-align: center;
|
||||
min-height: 84px; padding: 8px; border-radius: 6px; border: 1px dashed var(--iwb-border);
|
||||
font-size: 11px; color: var(--iwb-text2); background: var(--iwb-layer2); word-break: break-all;
|
||||
}
|
||||
.iwb-history-actions { display: flex; gap: 4px; padding: 4px 2px 0; }
|
||||
.iwb-history-actions .iwb-btn-sm { padding: 2px 6px; font-size: 11px; }
|
||||
/* v1.7.3:把「下载」做成卡片底部渐变的下载浮层(与输出节点同一套语义)。
|
||||
条本身 pointer-events:none,只有悬停后按钮可点,避免挡住卡片点击/双击预览。 */
|
||||
.iwb-history-actions {
|
||||
position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px;
|
||||
padding: var(--iwb-space-16) var(--iwb-space-4) var(--iwb-space-4); border-radius: 0 0 6px 6px;
|
||||
background-image: linear-gradient(to top, rgba(0, 0, 0, .62), transparent);
|
||||
opacity: 0; transition: opacity var(--iwb-motion-hover, .15s) var(--iwb-ease-hover, ease-out);
|
||||
pointer-events: none;
|
||||
}
|
||||
.iwb-history-embedded .iwb-history-item:hover .iwb-history-actions,
|
||||
.iwb-history-embedded .iwb-history-item:focus-within .iwb-history-actions { opacity: 1; pointer-events: auto; }
|
||||
.iwb-history-actions .iwb-btn-sm { padding: 2px 8px; font-size: 11px; border: none; background: var(--iwb-panel); color: var(--iwb-text); }
|
||||
.iwb-history-actions .iwb-btn-sm:hover { background: var(--iwb-panel); color: var(--iwb-brand); }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.iwb-history-embedded .iwb-history-item img { transition: none; }
|
||||
.iwb-history-embedded .iwb-history-item:hover img { transform: none; }
|
||||
}
|
||||
.iwb-history-more { display: flex; justify-content: center; padding: 4px 0 2px; }
|
||||
/* 只作用于图库自己的空态提示:不加前缀会泄漏到设置页等使用 .iwb-hint 的地方(文字被居中) */
|
||||
.iwb-history-embedded .iwb-hint { font-size: 11px; color: var(--iwb-text2); text-align: center; padding: 12px 6px; }
|
||||
@@ -88,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;
|
||||
}
|
||||
+5
-5
@@ -4,9 +4,9 @@
|
||||
"dir": "album",
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"files": {
|
||||
"main.js": "347256e31ed53389646664de35e3285a74e917c1629034bc0a8ba6b287f7eaf0",
|
||||
"main.js": "bc5f999f65db73cff167c140b49f8fb7bfc1233d7ec59f1280fa464c17a0df82",
|
||||
"styles.css": "b61e806abee9dd8889aa1a12c8791d428feacab93fac64f89c18c589de390706"
|
||||
}
|
||||
},
|
||||
@@ -33,10 +33,10 @@
|
||||
"dir": "gallery",
|
||||
"main": "main.js",
|
||||
"style": "styles.css",
|
||||
"version": "1.7.2",
|
||||
"version": "1.7.4",
|
||||
"files": {
|
||||
"main.js": "6f29e9ba66e358769d9b8c07b35c0f0a9ec76c244cf74139a61ba5ca74ddb41e",
|
||||
"styles.css": "1dfd72b60bcaea9c43e103ba9758113efec02b6241d08fa0ab9c75d7848afb55"
|
||||
"main.js": "30b804a02aa15bdb54cfc6520c9ce5e0e58db08dd658ff262770cb08108383c1",
|
||||
"styles.css": "14d374b5d0e1461cb1ca2b125865e9c27df7c3bd79c11caa0afc52152c7d0aef"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -63,6 +63,7 @@ const sourceModules = [
|
||||
'image-blob-store.js',
|
||||
'runtime-crash-log.js',
|
||||
'storage-health.js',
|
||||
'gallery-audit.js',
|
||||
'storage-config-shape.js',
|
||||
'generation-default-model.js',
|
||||
'storage-indexeddb.js',
|
||||
|
||||
@@ -145,6 +145,18 @@ const SCALE = [
|
||||
['--iwb-motion-base', '0.15s', 'M6 动效:面板展开/尺寸变化'],
|
||||
['--iwb-motion-slow', '0.3s', 'M6 动效:整屏过渡/抽屉'],
|
||||
|
||||
/* ── L2 悬停动效(2026-11-26)───────────────────────────────────────
|
||||
* 图库卡片 / 输出节点结果图共用同一组值:改一档就两处一起变。
|
||||
* scale 只给 1.02(卡片够大,再大就压到相邻列);相册格子是固定正方形网格,
|
||||
* 单独用 --iwb-hover-scale 之外的 1.08,且**不位移**(位移会让相邻格抖动,见 album 插件)。 */
|
||||
['--iwb-motion-hover', '0.15s', 'L2 悬停:卡片/结果图浮层统一时长'],
|
||||
['--iwb-ease-hover', 'cubic-bezier(0.16, 1, 0.3, 1)', 'L2 悬停:快出慢停'],
|
||||
['--iwb-hover-lift', '-2px', 'L2 悬停:上浮位移'],
|
||||
['--iwb-hover-scale', '1.02', 'L2 悬停:缩放(相册格子单独用 1.08)'],
|
||||
['--iwb-hover-shadow', '0 6px 16px rgba(0, 0, 0, 0.35)', 'L2 悬停:投影(单值,供 filter: drop-shadow 用;box-shadow 会多一种写法)'],
|
||||
['--iwb-hover-border', 'var(--iwb-brand)', 'L2 悬停:描边色'],
|
||||
['--iwb-scrim', 'rgba(0, 0, 0, 0.62)', '图片上的遮罩渐变底:下载浮层/预览条(两套主题都用深色,保证白字可读)'],
|
||||
|
||||
/* ── 层级表(M4-B2)───────────────────────────────────────────────
|
||||
* 迁移前 z-index 有 42 种取值,其中「谁盖谁」全靠散落在各处的数字对撞,出过两次真 bug:
|
||||
* ① toast(200) 低于弹窗(300) → 弹窗里点保存看不到提示;
|
||||
|
||||
+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.79-mww5k8ig">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.88-mww919v0">
|
||||
<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.79</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.88</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.79 · 8.4 MB · .dmg<div class="hash">sha256 6a846f517a2f5332…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.79_aarch64.dmg?h=6a846f517a2f">下载</a>
|
||||
<div class="meta">版本 3.26.88 · 8.4 MB · .dmg<div class="hash">sha256 02ffec8451bb2677…</div></div>
|
||||
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.26.88_aarch64.dmg?h=02ffec8451bb">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
|
||||
<div class="meta">版本 3.26.79 · 8.8 MB · .dmg<div class="hash">sha256 bd8989dabe532cce…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.79_x64.dmg?h=bd8989dabe53">下载</a>
|
||||
<div class="meta">版本 3.26.88 · 9.5 MB · .dmg<div class="hash">sha256 d8a4baefdf2e7fc5…</div></div>
|
||||
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.26.88_x64.dmg?h=d8a4baefdf2e">下载</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
|
||||
@@ -97,6 +97,42 @@
|
||||
</ol>
|
||||
|
||||
<h2>历史版本</h2>
|
||||
<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>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="name">3.26.84</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.83</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.82</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.81</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.80</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.79</div>
|
||||
<div class="meta">2026-11-25<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
|
||||
|
||||
+9
-9
@@ -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.79-mww5k8ig">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.88-mww919v0">
|
||||
</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.79</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.88</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
<section class="hero hero-art">
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.79-mww5k8ig" alt=""></div>
|
||||
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.26.88-mww919v0" alt=""></div>
|
||||
<div class="hero-veil"></div>
|
||||
<div class="wrap">
|
||||
<span class="kicker">v3.26.79 · macOS / Windows · 数据在本地</span>
|
||||
<span class="kicker">v3.26.88 · macOS / Windows · 数据在本地</span>
|
||||
<h1>本地优先的<br>AI 生图无限画布</h1>
|
||||
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
|
||||
<div class="cta">
|
||||
<a class="btn primary lg" href="/download/">下载 v3.26.79</a>
|
||||
<a class="btn primary lg" href="/download/">下载 v3.26.88</a>
|
||||
<a class="btn lg" href="/plugins/">浏览 13 个插件</a>
|
||||
</div>
|
||||
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="grid c3">
|
||||
<div class="pcard" data-name="相册 album 一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点 图片 批量 出图" data-tags="图片,批量,出图">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
|
||||
<div><div class="nm">相册</div><div class="ver">v1.1.2 · 官方</div></div></div>
|
||||
<div><div class="nm">相册</div><div class="ver">v1.1.3 · 官方</div></div></div>
|
||||
<div class="desc">一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点</div>
|
||||
<div class="tags"><span class="tag">图片</span><span class="tag">批量</span><span class="tag">出图</span></div>
|
||||
</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.2 · 官方</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.79_aarch64.dmg?h=6a846f517a2f"><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.79_x64.dmg?h=bd8989dabe53"><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.88_aarch64.dmg?h=02ffec8451bb"><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.88_x64.dmg?h=d8a4baefdf2e"><div class="n">macOS · Intel</div><div class="s">x86_64 · 9.5 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>
|
||||
|
||||
+15
-15
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"updatedAt": "2026-11-25T10:46:04.791Z",
|
||||
"updatedAt": "2026-11-25T14:57:23.381Z",
|
||||
"plugins": [
|
||||
{
|
||||
"id": "album",
|
||||
@@ -14,20 +14,20 @@
|
||||
"批量",
|
||||
"出图"
|
||||
],
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"apiVersion": 1,
|
||||
"bundle": "plugins/album-1.1.2.zip",
|
||||
"bundle": "plugins/album-1.1.3.zip",
|
||||
"bundleSize": 58375,
|
||||
"bundleSha256": "7369b5401ab1992f14a112e091a8596b798fa1395c2906985b6a0a2ff6f61d21",
|
||||
"bundleSha256": "1f8e2c2b23fbb336c407a567a5dbdc76f1f108892885a65cecbb5b66a5ef3eed",
|
||||
"files": [
|
||||
{
|
||||
"path": "manifest.json",
|
||||
"sha256": "cb8a342d55c6a326d6f5f4f4ee77d76cace8f83e80d9e9253e8be3cb8c830456",
|
||||
"sha256": "aaadf8e0227a6f39799730a36852ce9cb7bbe26770e9af526ee9d1da264511bc",
|
||||
"size": 593
|
||||
},
|
||||
{
|
||||
"path": "main.js",
|
||||
"sha256": "347256e31ed53389646664de35e3285a74e917c1629034bc0a8ba6b287f7eaf0",
|
||||
"sha256": "bc5f999f65db73cff167c140b49f8fb7bfc1233d7ec59f1280fa464c17a0df82",
|
||||
"size": 46716
|
||||
},
|
||||
{
|
||||
@@ -147,26 +147,26 @@
|
||||
"资源",
|
||||
"图库"
|
||||
],
|
||||
"version": "1.7.2",
|
||||
"version": "1.7.4",
|
||||
"apiVersion": 1,
|
||||
"bundle": "plugins/gallery-1.7.2.zip",
|
||||
"bundleSize": 39145,
|
||||
"bundleSha256": "20a66d75ca4d4395cd2c2cb0d9e60fbb8caeea20b9431a3cc4849a4869f6127d",
|
||||
"bundle": "plugins/gallery-1.7.4.zip",
|
||||
"bundleSize": 43859,
|
||||
"bundleSha256": "9e836e841a87055b21083a9d0fe8e001ce11b7e32d83654cc3bab5732774eee3",
|
||||
"files": [
|
||||
{
|
||||
"path": "manifest.json",
|
||||
"sha256": "f6791f662ba280cb497056fc9a919c32af2714add7c956ca400f9e8cb4fb85c1",
|
||||
"sha256": "2985568cc3fe69a6a1c14bdc1bda047665ec4ea0fc3fd4ca1b8d981a6ea007f0",
|
||||
"size": 526
|
||||
},
|
||||
{
|
||||
"path": "main.js",
|
||||
"sha256": "6f29e9ba66e358769d9b8c07b35c0f0a9ec76c244cf74139a61ba5ca74ddb41e",
|
||||
"size": 32287
|
||||
"sha256": "30b804a02aa15bdb54cfc6520c9ce5e0e58db08dd658ff262770cb08108383c1",
|
||||
"size": 34434
|
||||
},
|
||||
{
|
||||
"path": "styles.css",
|
||||
"sha256": "1dfd72b60bcaea9c43e103ba9758113efec02b6241d08fa0ab9c75d7848afb55",
|
||||
"size": 6022
|
||||
"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.79-mww5k8ig">
|
||||
<link rel="stylesheet" href="/assets/style.css?v=3.26.88-mww919v0">
|
||||
</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.79</a>
|
||||
<a class="btn primary" href="/download/">下载 v3.26.88</a>
|
||||
</div>
|
||||
</div></nav>
|
||||
<main>
|
||||
@@ -52,7 +52,7 @@
|
||||
<div class="grid c3" id="list">
|
||||
<div class="pcard" data-name="相册 album 一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点 图片 批量 出图" data-tags="图片,批量,出图">
|
||||
<div class="head"><span class="av" style="background:#eef2f6">🖼️</span>
|
||||
<div><div class="nm">相册</div><div class="ver">v1.1.2 · 官方</div></div></div>
|
||||
<div><div class="nm">相册</div><div class="ver">v1.1.3 · 官方</div></div></div>
|
||||
<div class="desc">一个节点装多张本地图片:宫格随节点尺寸自适应分页,一图一任务 / 批量两种模式,批量生图不用再摆一堆图片节点</div>
|
||||
<div class="tags"><span class="tag">图片</span><span class="tag">批量</span><span class="tag">出图</span></div>
|
||||
</div>
|
||||
@@ -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.2 · 官方</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>
|
||||
|
||||
+190
-1
@@ -1,8 +1,197 @@
|
||||
{
|
||||
"app": "Image Workbench",
|
||||
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
|
||||
"updatedAt": "2026-11-25T13:21:44.630Z",
|
||||
"updatedAt": "2026-11-25T14:58:58.381Z",
|
||||
"releases": [
|
||||
{
|
||||
"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",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.85_aarch64.dmg",
|
||||
"size": 8810088,
|
||||
"sha256": "5442c774270ec9e13c4431b805bdeca5717bf9fb6a176a8bb56b94c68402a31a",
|
||||
"h": "5442c774270e",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.85_x64.dmg",
|
||||
"size": 9225212,
|
||||
"sha256": "6dfb2eecda121c0142f512c500f2918d98f299a7ced23591a1e0c0e9587bb074",
|
||||
"h": "6dfb2eecda12",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.84",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.84_aarch64.dmg",
|
||||
"size": 8807209,
|
||||
"sha256": "d0d59c6ffa46e53bb88e53a39c7f34625ebff3dca1fe7bfb24171471bce7bfda",
|
||||
"h": "d0d59c6ffa46",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.84_x64.dmg",
|
||||
"size": 9220051,
|
||||
"sha256": "93c11f9905fd6826d4abe91fd423ef4d1174b22ebe62a6cefcdd74b4c7710375",
|
||||
"h": "93c11f9905fd",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.83",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.83_aarch64.dmg",
|
||||
"size": 8802265,
|
||||
"sha256": "bd087bade5ef2939918e25aec1d3c58bf748938fc25e3cec89bdab6487450b1d",
|
||||
"h": "bd087bade5ef",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.83_x64.dmg",
|
||||
"size": 9219384,
|
||||
"sha256": "c3ae3e86fe90e5a3198de6389df92b90f5020389d5960a8aa6ce1649fe5c232b",
|
||||
"h": "c3ae3e86fe90",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.82",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.82_aarch64.dmg",
|
||||
"size": 8802804,
|
||||
"sha256": "632a15ff660465b3d1b1d806f4b0a62ea2cb66dcabfa953aee52ac3f0cb8e18f",
|
||||
"h": "632a15ff6604",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.82_x64.dmg",
|
||||
"size": 9221021,
|
||||
"sha256": "cab4ec0d1557bfbf332a08dbe8c8d713476edcbd1b7ccd7555edc22afc4ff44d",
|
||||
"h": "cab4ec0d1557",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.81",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.81_aarch64.dmg",
|
||||
"size": 9081334,
|
||||
"sha256": "cc98b0f9274da044e3c10399d0c467cb8d23e303679de8c6340261c961270e71",
|
||||
"h": "cc98b0f9274d",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.81_x64.dmg",
|
||||
"size": 9222539,
|
||||
"sha256": "e9535741bbc9e16f50300977e8c62320ad5e5eb369af715449c189ab8534ddf6",
|
||||
"h": "e9535741bbc9",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.80",
|
||||
"date": "2026-11-25",
|
||||
"notes": "",
|
||||
"platforms": {
|
||||
"darwin-aarch64": {
|
||||
"file": "updates/darwin-aarch64/image-workbench_3.26.80_aarch64.dmg",
|
||||
"size": 8803202,
|
||||
"sha256": "706dcf050ffc185d5b5db484bfaa1b1e1bf6c17c50fff556f6d57bc1ed798924",
|
||||
"h": "706dcf050ffc",
|
||||
"kind": "dmg"
|
||||
},
|
||||
"darwin-x86_64": {
|
||||
"file": "updates/darwin-x86_64/image-workbench_3.26.80_x64.dmg",
|
||||
"size": 9223661,
|
||||
"sha256": "2faff3c2b25c7d6ada2c4dc7aeabb8b51993d77e6bd63cfe57044d159374e9d3",
|
||||
"h": "2faff3c2b25c",
|
||||
"kind": "dmg"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"version": "3.26.79",
|
||||
"date": "2026-11-25",
|
||||
|
||||
Generated
+1
-1
@@ -1983,7 +1983,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.26.79"
|
||||
version = "3.26.88"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.26.79"
|
||||
version = "3.26.88"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.26.79",
|
||||
"version": "3.26.88",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -140,6 +140,13 @@
|
||||
--iwb-motion-fast: 0.12s; /* M6 动效:悬停/开关/小位移 */
|
||||
--iwb-motion-base: 0.15s; /* M6 动效:面板展开/尺寸变化 */
|
||||
--iwb-motion-slow: 0.3s; /* M6 动效:整屏过渡/抽屉 */
|
||||
--iwb-motion-hover: 0.15s; /* L2 悬停:卡片/结果图浮层统一时长 */
|
||||
--iwb-ease-hover: cubic-bezier(0.16, 1, 0.3, 1); /* L2 悬停:快出慢停 */
|
||||
--iwb-hover-lift: -2px; /* L2 悬停:上浮位移 */
|
||||
--iwb-hover-scale: 1.02; /* L2 悬停:缩放(相册格子单独用 1.08) */
|
||||
--iwb-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); /* L2 悬停:投影(单值,供 filter: drop-shadow 用;box-shadow 会多一种写法) */
|
||||
--iwb-hover-border: var(--iwb-brand); /* L2 悬停:描边色 */
|
||||
--iwb-scrim: rgba(0, 0, 0, 0.62); /* 图片上的遮罩渐变底:下载浮层/预览条(两套主题都用深色,保证白字可读) */
|
||||
--iwb-z-ctx: 90; /* 右键遮罩 */
|
||||
--iwb-z-ctx-menu: 91; /* 右键菜单 */
|
||||
--iwb-z-curtain: 100; /* 应用遮罩 / 图片预览底 */
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
/* gallery-audit.js —— 图库落盘自检(2026-11-26,只读)
|
||||
*
|
||||
* 为什么单独成模块:用户报障「图库面板有图,但资料目录 images/gallery 里找不到」。
|
||||
* 这句话可能对应三种完全不同的状态,靠猜会修错地方:
|
||||
* ① 原图已落盘(out_orig_ 有键、磁盘有文件)
|
||||
* ② 仅缩略图(只有 out_ 的 320px 副本;原图从未写,或写了但文件被删)
|
||||
* ③ 全丢(索引条目在,缩略图与原图都没有,只剩远程 URL)
|
||||
* 这里只做判定与报告,不改任何存储;写入侧用 noteWrite() 记本次会话的成功/失败。
|
||||
*
|
||||
* 判定输入刻意是可注入的事实(磁盘登记 + IDB 键集合),便于单测:
|
||||
* run({ index, storageFile, idbKeys })
|
||||
* · storageFile = IWBStorageFile.galleryAudit(index) 的结果(桌面端才有真实磁盘文件)
|
||||
* · idbKeys = IDB.keys()(浏览器/兜底路径只有键集合)
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
|
||||
const STATES = { orig: 'orig', thumb: 'thumb', lost: 'lost' }
|
||||
const LABELS = { orig: '原图 OK', thumb: '仅缩略图', lost: '全丢' }
|
||||
|
||||
const origKeyOf = (item) => String((item && item.origIdb) || ('out_orig_' + String((item && item.name) || '')))
|
||||
const thumbKeyOf = (item) => String((item && item.idb) || ('out_' + String((item && item.name) || '')))
|
||||
|
||||
// 单条判定。fact 由 storageFile.galleryAudit 或键集合归一而来:
|
||||
// { orig: bool, thumb: bool, origPath: string, thumbPath: string, origKeyKnown: bool }
|
||||
function classify (item, fact) {
|
||||
const f = fact || {}
|
||||
const hasOrig = !!f.orig
|
||||
const hasThumb = !!f.thumb
|
||||
let state = STATES.lost
|
||||
let reason = '原图和缩略图都不在本地(只剩远程 URL)'
|
||||
if (hasOrig) {
|
||||
state = STATES.orig
|
||||
reason = '原图已落盘'
|
||||
} else if (hasThumb) {
|
||||
state = STATES.thumb
|
||||
if (f.origPath) reason = '原图文件缺失(登记还在,磁盘没有)'
|
||||
else if (f.origKeyKnown === false) reason = '原图键未登记(生成后没有写入 out_orig_)'
|
||||
else reason = '原图未落盘(只有 320px 缩略图)'
|
||||
}
|
||||
return {
|
||||
name: String((item && item.name) || ''),
|
||||
url: String((item && item.url) || ''),
|
||||
state,
|
||||
label: LABELS[state],
|
||||
reason,
|
||||
origKey: origKeyOf(item),
|
||||
thumbKey: thumbKeyOf(item),
|
||||
origPath: String(f.origPath || ''),
|
||||
thumbPath: String(f.thumbPath || ''),
|
||||
}
|
||||
}
|
||||
|
||||
function summarize (rows) {
|
||||
const list = Array.isArray(rows) ? rows : []
|
||||
const out = { total: list.length, orig: 0, thumb: 0, lost: 0, pending: 0 }
|
||||
for (const r of list) {
|
||||
if (!r) continue
|
||||
if (r.state === STATES.orig) out.orig++
|
||||
else if (r.state === STATES.thumb) out.thumb++
|
||||
else out.lost++
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
function deduceFactsFromKeys (item, keySet) {
|
||||
const keys = keySet || new Set()
|
||||
const ok = origKeyOf(item)
|
||||
const tk = thumbKeyOf(item)
|
||||
return {
|
||||
orig: keys.has(ok),
|
||||
thumb: keys.has(tk),
|
||||
origPath: '',
|
||||
thumbPath: '',
|
||||
origKeyKnown: !!(item && item.origIdb),
|
||||
}
|
||||
}
|
||||
|
||||
function fileFacts (item, fileRows) {
|
||||
const name = String((item && item.name) || '')
|
||||
const f = fileRows && fileRows[name]
|
||||
if (!f) return deduceFactsFromKeys(item, new Set())
|
||||
return {
|
||||
orig: !!f.orig,
|
||||
thumb: !!f.thumb,
|
||||
origPath: String(f.origPath || ''),
|
||||
thumbPath: String(f.thumbPath || ''),
|
||||
origKeyKnown: !!f.origKey,
|
||||
}
|
||||
}
|
||||
|
||||
async function run (opts) {
|
||||
const o = opts || {}
|
||||
const index = Array.isArray(o.index) ? o.index : []
|
||||
let facts = null
|
||||
let dir = ''
|
||||
let galleryFiles = []
|
||||
let deskError = ''
|
||||
const sf = o.storageFile
|
||||
if (sf && typeof sf.galleryAudit === 'function') {
|
||||
try {
|
||||
const r = await sf.galleryAudit(index)
|
||||
if (r && r.ok) {
|
||||
facts = {}
|
||||
for (const row of (r.rows || [])) if (row && row.name) facts[String(row.name)] = row
|
||||
dir = String(r.dir || '')
|
||||
galleryFiles = Array.isArray(r.galleryFiles) ? r.galleryFiles.slice() : []
|
||||
} else if (r && r.error) deskError = String(r.error)
|
||||
} catch (e) { deskError = String((e && e.message) || e) }
|
||||
}
|
||||
const keySet = new Set(Array.isArray(o.idbKeys) ? o.idbKeys.map(String) : [])
|
||||
const rows = index.map((it) => classify(it, facts ? fileFacts(it, facts) : deduceFactsFromKeys(it, keySet)))
|
||||
// 磁盘上有、但没有任何索引条目引用的原图:删图只清了索引时留下的孤儿
|
||||
let orphans = []
|
||||
if (facts && galleryFiles.length) {
|
||||
const used = new Set()
|
||||
for (const r of rows) if (r.origPath) used.add(String(r.origPath).split('/').pop())
|
||||
orphans = galleryFiles.filter((n) => !used.has(String(n)))
|
||||
}
|
||||
return {
|
||||
at: Date.now(),
|
||||
dir,
|
||||
desktop: !!facts,
|
||||
error: deskError,
|
||||
summary: summarize(rows),
|
||||
rows,
|
||||
orphans,
|
||||
session: stats(),
|
||||
}
|
||||
}
|
||||
|
||||
// 本次会话写入计数:挂在存储层(storage-file / storage-runtime),不改生成流程。
|
||||
const session = { origOk: 0, origFail: 0, reasons: {} }
|
||||
function noteWrite (key, ok, error) {
|
||||
const k = String(key || '')
|
||||
if (k.indexOf('out_orig_') !== 0) return
|
||||
if (ok) { session.origOk++; return }
|
||||
session.origFail++
|
||||
const why = String((error && (error.message || error.error)) || error || '未知原因').slice(0, 120)
|
||||
session.reasons[why] = (session.reasons[why] || 0) + 1
|
||||
}
|
||||
function stats () {
|
||||
const reasons = Object.keys(session.reasons).map((k) => ({ reason: k, count: session.reasons[k] })).sort((a, b) => b.count - a.count)
|
||||
return { origOk: session.origOk, origFail: session.origFail, reasons }
|
||||
}
|
||||
function resetSession () {
|
||||
session.origOk = 0; session.origFail = 0; session.reasons = {}
|
||||
}
|
||||
|
||||
function report (result) {
|
||||
const r = result || {}
|
||||
const s = r.summary || summarize(r.rows)
|
||||
const lines = []
|
||||
lines.push('图库落盘自检' + (r.at ? ' · ' + new Date(r.at).toISOString() : ''))
|
||||
if (r.dir) lines.push('资料目录:' + r.dir)
|
||||
lines.push('索引 ' + s.total + ' 条:原图 OK ' + s.orig + ' / 仅缩略图 ' + s.thumb + ' / 全丢 ' + s.lost)
|
||||
if (r.desktop) lines.push('磁盘上未被索引引用的原图:' + (r.orphans ? r.orphans.length : 0) + ' 个')
|
||||
if (!r.desktop) lines.push('未读取磁盘文件(浏览器环境或资料目录未就绪),判定依据仅为 IDB 键集合' + (r.error ? ':' + r.error : ''))
|
||||
lines.push('本次会话原图写入:成功 ' + ((r.session && r.session.origOk) || 0) + ' / 失败 ' + ((r.session && r.session.origFail) || 0))
|
||||
for (const why of ((r.session && r.session.reasons) || []).slice(0, 5)) lines.push(' · 失败原因 ×' + why.count + ':' + why.reason)
|
||||
lines.push('')
|
||||
lines.push('明细(前 20 条):')
|
||||
for (const row of (Array.isArray(r.rows) ? r.rows : []).slice(0, 20)) {
|
||||
lines.push(' [' + row.label + '] ' + row.name + ' — ' + row.reason + (row.origPath ? ' · ' + row.origPath : ''))
|
||||
}
|
||||
if (!Array.isArray(r.rows) || !r.rows.length) lines.push(' (图库索引为空)')
|
||||
return lines.join('\n')
|
||||
}
|
||||
|
||||
global.IWBGalleryAudit = {
|
||||
STATES: STATES,
|
||||
LABELS: LABELS,
|
||||
classify: classify,
|
||||
summarize: summarize,
|
||||
run: run,
|
||||
report: report,
|
||||
noteWrite: noteWrite,
|
||||
stats: stats,
|
||||
resetSession: resetSession,
|
||||
}
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
@@ -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:拖入也走「本地字节目录」(含按需抓远程再落副本),与「插入」按钮同一条路,
|
||||
|
||||
+46
-1
@@ -196,6 +196,7 @@
|
||||
// 立即落盘:登记表只存在 data.json 里,晚 800ms 就可能被强杀丢掉,
|
||||
// 而画布文件是即时写的 ⇒ 引用还在、登记没了,GC 会把在用图片当孤儿。
|
||||
await flush()
|
||||
try { global.IWBGalleryAudit && global.IWBGalleryAudit.noteWrite(key, true) } catch (e) { /* 计数失败不影响写入 */ }
|
||||
return true
|
||||
}
|
||||
const s = String(value)
|
||||
@@ -211,6 +212,7 @@
|
||||
assets[String(key)] = { f: rel, k: 'dataurl', m: dec.mime }
|
||||
schedule()
|
||||
await flush()
|
||||
try { global.IWBGalleryAudit && global.IWBGalleryAudit.noteWrite(key, true) } catch (e) { /* 计数失败不影响写入 */ }
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -219,6 +221,7 @@
|
||||
return true
|
||||
} catch (e) {
|
||||
try { global.IWBMetricsSwallow && global.IWBMetricsSwallow('file-kv-put', e) } catch (e2) { /* ignore */ }
|
||||
try { global.IWBGalleryAudit && global.IWBGalleryAudit.noteWrite(key, false, e) } catch (e2) { /* ignore */ }
|
||||
return { ok: false, error: String((e && e.message) || e) }
|
||||
}
|
||||
},
|
||||
@@ -1332,6 +1335,48 @@
|
||||
} catch (e) { return { ok: false, error: String((e && e.message) || e) } }
|
||||
}
|
||||
|
||||
// 图库落盘自检(2026-11-26):只读。按索引条目查 assets 登记 + 磁盘文件是否真的存在,
|
||||
// 并顺带列出 images/gallery 里没被任何条目引用的文件(删图只清索引时的孤儿)。
|
||||
// 只做 exists,不读字节 —— 几百张原图读回 base64 会把堆顶撑高(诊断页点一下不该更卡)。
|
||||
async function galleryAudit (index) {
|
||||
if (!enabled() || !dir) return { ok: false, error: '资料目录未就绪(浏览器环境)' }
|
||||
const list = Array.isArray(index) ? index : []
|
||||
const rows = new Array(list.length)
|
||||
let cursor = 0
|
||||
const existsAt = async (rel) => {
|
||||
if (!rel) return false
|
||||
try { return !!(await fs().exists(await join(dir, rel))) } catch (e) { return false }
|
||||
}
|
||||
const worker = async () => {
|
||||
while (true) {
|
||||
const i = cursor++
|
||||
if (i >= list.length) return
|
||||
const it = list[i] || {}
|
||||
const name = String(it.name || '')
|
||||
const origKey = String(it.origIdb || ('out_orig_' + name))
|
||||
const thumbKey = String(it.idb || ('out_' + name))
|
||||
const oa = assets[origKey]
|
||||
const ta = assets[thumbKey]
|
||||
const origPath = (oa && oa.f) || ''
|
||||
const thumbPath = (ta && ta.f) || ''
|
||||
rows[i] = {
|
||||
name, origKey: !!oa, thumbKey: !!ta,
|
||||
origPath, thumbPath,
|
||||
orig: await existsAt(origPath),
|
||||
thumb: await existsAt(thumbPath),
|
||||
}
|
||||
}
|
||||
}
|
||||
// 并发 4:几十条是常态,串行会让诊断页点一下等好几秒;再高会把 IPC 打满。
|
||||
await Promise.all([worker(), worker(), worker(), worker()])
|
||||
let galleryFiles = []
|
||||
try {
|
||||
const ents = await fs().readDir(await join(dir, IMG_DIR, IMG_CAT.gallery))
|
||||
galleryFiles = (ents || []).filter((e) => e && !e.isDirectory).map((e) => String(e.name || '')).filter(Boolean)
|
||||
} catch (e) { galleryFiles = [] }
|
||||
return { ok: true, dir: dir, rows: rows, galleryFiles: galleryFiles }
|
||||
}
|
||||
|
||||
// 2026-11-24:按图库条目名删字节 —— app.js 只传 names + 索引,逻辑留在这里(app.js 行数棘轮)。
|
||||
async function deleteGalleryBytesFor (names, index) {
|
||||
const wanted = Array.isArray(names) ? names : []
|
||||
@@ -1346,7 +1391,7 @@
|
||||
}
|
||||
|
||||
global.IWBStorageFile = {
|
||||
enabled, ready: init, flush, runtime, pickDir, switchTo, migrateTo, deleteImageBytes, deleteGalleryBytesFor, gcImages, rotateTrash, galleryThumb, readDisplayThumb, readDisplayThumbUrl, writeDisplayThumb, writeDisplayThumbBlob, pruneThumbs, cleanupLegacy, maintain,
|
||||
enabled, ready: init, flush, runtime, pickDir, switchTo, migrateTo, deleteImageBytes, deleteGalleryBytesFor, galleryAudit, gcImages, rotateTrash, galleryThumb, readDisplayThumb, readDisplayThumbUrl, writeDisplayThumb, writeDisplayThumbBlob, pruneThumbs, cleanupLegacy, maintain,
|
||||
plugins: { manifest: pluginManifest, read: pluginRead, write: pluginWrite, remove: pluginRemove, dir: pluginDir, listLocal: pluginListLocal, listDirs: pluginListDirs, readFile: pluginReadFile, writeFile: pluginWriteFile, writeBinary: pluginWriteBinary, mkdir: pluginMkdir, removeDir: pluginRemoveDir, renameDir: pluginRenameDir, existsDir: pluginExistsDir },
|
||||
pluginData: { read: pluginDataRead, write: pluginDataWrite, remove: pluginDataRemove, list: pluginDataList },
|
||||
pluginFiles: { put: pluginFilePut, get: pluginFileGet, list: pluginFileList, remove: pluginFileRemove, stat: pluginFileStat, dir: pluginFilesDir, readBytes: pluginFileReadBytes, listAll: pluginFilesListAll },
|
||||
|
||||
@@ -86,7 +86,12 @@
|
||||
} catch (e) { finish(false) }
|
||||
})
|
||||
})
|
||||
const write = (store, key, value) => request(store, 'readwrite', (objectStore) => objectStore.put(value, key)).then((v) => v === true)
|
||||
const write = (store, key, value) => request(store, 'readwrite', (objectStore) => objectStore.put(value, key)).then((v) => {
|
||||
const ok = v === true
|
||||
// 图库落盘自检的会话计数(只认 out_orig_,其它键会被 noteWrite 自己忽略)
|
||||
try { global.IWBGalleryAudit && global.IWBGalleryAudit.noteWrite(key, ok, ok ? null : 'IndexedDB 写入失败') } catch (e) { /* 计数失败不影响写入 */ }
|
||||
return ok
|
||||
})
|
||||
const remove = (store, key) => request(store, 'readwrite', (objectStore) => objectStore.delete(key)).then((v) => v === true)
|
||||
const read = (store, key) => request(store, 'readonly', (objectStore) => objectStore.get(key))
|
||||
return {
|
||||
|
||||
@@ -118,7 +118,7 @@ function PluginAddButton(props) {
|
||||
document.addEventListener('keydown', onKey)
|
||||
return () => { document.removeEventListener('pointerdown', onDoc, true); document.removeEventListener('keydown', onKey) }
|
||||
}, [open])
|
||||
const list = Array.isArray(props.variants) ? props.variants : []
|
||||
const list = (Array.isArray(props.variants) ? props.variants : []).filter((pv) => pv && pv.toolbar !== 'hide')
|
||||
return el('span', { className: 'iwb-plugin-add-wrap', ref: boxRef },
|
||||
el('button', {
|
||||
className: 'iwb-btn iwb-plugin-add' + (open ? ' iwb-btn-on' : ''),
|
||||
@@ -135,7 +135,7 @@ function PluginAddButton(props) {
|
||||
className: 'iwb-ctx-item',
|
||||
role: 'menuitem',
|
||||
onClick: () => { setOpen(false); if (typeof props.onPick === 'function') props.onPick(pv.id) },
|
||||
}, I('puzzle'), el('span', { className: 'iwb-btn-text' }, pv.title || pv.id))),
|
||||
}, I(pv.icon || 'puzzle'), el('span', { className: 'iwb-btn-text' }, pv.title || pv.id))),
|
||||
) : null,
|
||||
)
|
||||
}
|
||||
|
||||
+27
-1
@@ -17,12 +17,38 @@
|
||||
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 }, '🔗 链接'),
|
||||
) : null,
|
||||
)
|
||||
}
|
||||
// 共享「下载浮层」:底部渐变 + 下载(可选复制),hover/focus 才出现。
|
||||
// 图库插件是原生 DOM,用同一组 token 在插件 CSS 里复刻;宿主这里只需一个 React 组件。
|
||||
// pointer-events:浮层条本身不吃事件(否则会挡住图片点击/双击),只有悬停后按钮才可点。
|
||||
function ResultDownloadOverlay (props) {
|
||||
const p = props || {}
|
||||
const stopDown = (e) => { try { e.stopPropagation() } catch (err) { /* ignore */ } }
|
||||
return el('div', { className: 'iwb-dl-ov' },
|
||||
p.children,
|
||||
el('div', { className: 'iwb-dl-bar' },
|
||||
p.onCopyRef ? el('button', {
|
||||
className: 'iwb-dl-btn iwb-dl-btn-ghost',
|
||||
title: p.copyTitle || '插入为参考图节点',
|
||||
onPointerDown: stopDown,
|
||||
onClick: (e) => { e.stopPropagation(); p.onCopyRef() },
|
||||
}, p.copyIcon || null, el('span', { className: 'iwb-dl-txt' }, p.copyLabel || '复制')) : null,
|
||||
el('button', {
|
||||
className: 'iwb-dl-btn',
|
||||
title: p.downloadTitle || '下载原图',
|
||||
onPointerDown: stopDown,
|
||||
onClick: (e) => { e.stopPropagation(); if (p.onDownload) p.onDownload() },
|
||||
}, p.icon || null, el('span', { className: 'iwb-dl-txt' }, p.label || '下载')),
|
||||
),
|
||||
)
|
||||
}
|
||||
global.IWBResultImg = ResultImg
|
||||
global.IWBResultDownloadOverlay = ResultDownloadOverlay
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
+16
-15
@@ -822,23 +822,24 @@
|
||||
// key 用「url + 组内序号」而不是下标(2026-11-03):下标作 key 时,条目集合一变(旧图被新图替换)
|
||||
// React 会按下标复用同一个 DOM 节点,先显示上一张、再等新图解码 ⇒ 肉眼看到「闪一下旧图/空图」。
|
||||
// url 稳定 ⇒ 节点复用(不重建、不重新解码);url 变了才新建,内容永远对得上。
|
||||
const doDownload = async () => {
|
||||
let src = r.url
|
||||
// v3.25.18:从资料目录的本地归档取图(原图优先),远端 URL 只作兜底
|
||||
try { if (wResolveOutSrc) src = (await wResolveOutSrc(r, true)) || r.url } catch (e) { /* 回退远端 */ }
|
||||
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: 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' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '插入为参考图节点', onClick: doCopy, onPointerDown: stop }, I('copy')),
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '下载', onClick: doDownload, onPointerDown: stop }, I('download')),
|
||||
)
|
||||
return el('div', { key: String(r.url || '') + '|' + ri, className: 'iwb-out-cell' },
|
||||
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 }, onClick: () => openPreviewAt(cur) }),
|
||||
DlOv ? el(DlOv, { key: 'ov', onDownload: doDownload, onCopyRef: doCopy, icon: I('download'), copyIcon: I('copy') }, imgEl) : imgEl,
|
||||
el('div', { className: 'iwb-out-cell-meta' }, (r.width || '?') + '×' + (r.height || '?')),
|
||||
el('div', { className: 'iwb-out-cell-actions' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', title: '插入为参考图节点', onClick: () => props.onCopyRef && props.onCopyRef(r.url), onPointerDown: stop }, I('copy')),
|
||||
el('button', {
|
||||
className: 'iwb-btn iwb-btn-sm',
|
||||
title: '下载',
|
||||
// v3.25.18:从资料目录的本地归档取图(原图优先),远端 URL 只作兜底
|
||||
onClick: async () => {
|
||||
let src = r.url
|
||||
try { if (wResolveOutSrc) src = (await wResolveOutSrc(r, true)) || r.url } catch (e) { /* 回退远端 */ }
|
||||
downloadUrl(src, 'image.png')
|
||||
},
|
||||
onPointerDown: stop,
|
||||
}, I('download')),
|
||||
),
|
||||
actions,
|
||||
)
|
||||
}
|
||||
const groupCards = []
|
||||
|
||||
@@ -114,6 +114,7 @@ function makeImageLibSection (draft, setDraft, backfillOutputOriginals) {
|
||||
),
|
||||
),
|
||||
el('div', { className: 'iwb-gset-hint' }, '不保留则只存缩略图,导出时可能只剩远程链接;桌面端取原图走原生 HTTP,不受图床跨域限制。'),
|
||||
(draft.canvas.backupOriginals === true) ? null : el('div', { className: 'iwb-hint iwb-err' }, '已关闭原图入库:新生成的图片只保存 320px 缩略图,图床链接失效后原图无法恢复。建议开启(桌面端会写进资料目录 images/gallery)。'),
|
||||
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)) }
|
||||
@@ -637,7 +638,7 @@ const SET_NAV_ICONS = { gen: 'settings', llm: 'llm', img: 'upload', saveImg: 'do
|
||||
}, I(SET_NAV_ICONS[t[0]] || 'settings'), el('span', null, t[1]))),
|
||||
el('div', { className: 'iwb-set-nav-group' }, '插件'),
|
||||
el('button', { key: 'nav-plugins', className: 'iwb-tab iwb-set-nav-item' + (tab === 'plugins' ? ' iwb-tab-active' : ''), onClick: () => setTab('plugins') }, I('panel'), el('span', null, '插件管理')),
|
||||
pluginItems.filter((p) => p && p.enabled).map((p) => el('button', { key: 'nav-plugin:' + p.id, className: 'iwb-tab iwb-set-nav-item' + (tab === 'plugin:' + p.id ? ' iwb-tab-active' : ''), onClick: () => setTab('plugin:' + p.id) }, I(PLUGIN_NAV_ICON[p.id] || 'box'), el('span', null, p.name))),
|
||||
pluginItems.filter((p) => p && p.enabled).map((p) => el('button', { key: 'nav-plugin:' + p.id, className: 'iwb-tab iwb-set-nav-item' + (tab === 'plugin:' + p.id ? ' iwb-tab-active' : ''), onClick: () => setTab('plugin:' + p.id) }, I(props.pluginIcon ? props.pluginIcon(p.id) : 'box'), el('span', null, p.name))),
|
||||
),
|
||||
el('div', { className: 'iwb-modal-body' },
|
||||
tab === 'appearance' ? appearanceTab : tab === 'gen' ? genTab : tab === 'llm' ? llmTab : tab === 'img' ? imgTab : tab === 'backup' ? backupTab : tab === 'hotkeys' ? hotkeyTab : tab === 'sizes' ? sizePresetTab : tab === 'plugins' ? pluginsTab : (typeof tab === 'string' && tab.indexOf('plugin:') === 0) ? pluginSettingsPage : tab === 'diag' ? diagTab : generalTab,
|
||||
|
||||
@@ -28,6 +28,15 @@
|
||||
const fmtKB = (n) => (Number(n) || 0) >= 1024 ? (Math.round((Number(n) / 1024) * 10) / 10) + 'MB' : Math.round(Number(n) || 0) + 'KB'
|
||||
// v3.24.67:旧实现在 writeText() 之后**不 await 也不 catch**,下一行无条件提示「已复制」——
|
||||
// 权限被拒 / 非 https / 浏览器不给写剪贴板时是**假成功**,用户以为拿到了其实没有。
|
||||
const copyGallery = async () => {
|
||||
const g = storageAudit && storageAudit.gallery
|
||||
if (!g) { setMsg({ type: 'err', text: '请先点「存储体检」' }); return }
|
||||
const text = (typeof window !== 'undefined' && window.IWBGalleryAudit && window.IWBGalleryAudit.report) ? window.IWBGalleryAudit.report(g) : JSON.stringify(g, null, 2)
|
||||
const C = (typeof window !== 'undefined') ? window.IWBClipboardCopy : null
|
||||
if (!C || typeof C.copyText !== 'function') { setMsg({ type: 'err', text: '当前环境不支持复制,请用「导出 JSON」' }); return }
|
||||
const ok = await C.copyText(text)
|
||||
setMsg(ok ? { type: 'ok', text: '图库落盘报告已复制' } : { type: 'err', text: '复制失败(权限被拒或非安全上下文)' })
|
||||
}
|
||||
const copyDiag = async () => {
|
||||
let text = ''
|
||||
try {
|
||||
@@ -118,6 +127,22 @@
|
||||
el('div', { className: 'iwb-diag-extra' }, '存放于资料目录 plugin-data/(与插件代码分离,卸载插件默认保留)'),
|
||||
) : null,
|
||||
) : el('div', { className: 'iwb-hint' }, '点「存储体检」查看一致性;发现悬空 / 孤儿再决定是否回收。'),
|
||||
el('div', { className: 'iwb-section-sub' }, '图库落盘自检(随存储体检一起读取)'),
|
||||
el('div', { className: 'iwb-hint' }, '逐条判断:原图已落盘 / 仅缩略图 / 全丢。桌面端会真的去 images/gallery 查文件是否存在(只查存在性,不读字节);报告不含 Key 与图片内容。'),
|
||||
(storageAudit && storageAudit.gallery) ? el('div', null,
|
||||
el('div', { className: 'iwb-diag-list' },
|
||||
el('div', { className: 'iwb-diag-item' },
|
||||
el('div', { className: 'iwb-diag-head' }, '索引 ' + storageAudit.gallery.summary.total + ' 条:原图 OK ' + storageAudit.gallery.summary.orig + ' / 仅缩略图 ' + storageAudit.gallery.summary.thumb + ' / 全丢 ' + storageAudit.gallery.summary.lost),
|
||||
el('div', { className: 'iwb-diag-extra' }, (storageAudit.gallery.desktop ? ('资料目录:' + (storageAudit.gallery.dir || '未知') + ' · 未被索引引用的原图 ' + (storageAudit.gallery.orphans || []).length + ' 个') : ('未读到磁盘文件' + (storageAudit.gallery.error ? ':' + storageAudit.gallery.error : ',仅按 IDB 键判定')))
|
||||
+ ' · 本次会话原图写入 成功 ' + ((storageAudit.gallery.session && storageAudit.gallery.session.origOk) || 0) + ' / 失败 ' + ((storageAudit.gallery.session && storageAudit.gallery.session.origFail) || 0)),
|
||||
),
|
||||
(storageAudit.gallery.rows || []).slice(0, 20).map((row, i) => el('div', { key: 'g' + i, className: 'iwb-diag-item' },
|
||||
el('div', { className: 'iwb-diag-head' }, '[' + row.label + '] ' + row.name),
|
||||
el('div', { className: 'iwb-diag-extra' }, row.reason + (row.origPath ? ' · ' + row.origPath : '') + (row.url ? ' · 远程 URL 作兜底' : '')),
|
||||
)),
|
||||
),
|
||||
el('div', { className: 'iwb-row' }, el('button', { className: 'iwb-btn iwb-btn-sm', onClick: copyGallery }, '复制落盘报告')),
|
||||
) : el('div', { className: 'iwb-hint' }, '点上面的「存储体检」后在这里看结果。'),
|
||||
el('div', { className: 'iwb-section-sub' }, '画板找回(索引里没有、但本体还在 · ' + orphanRows.length + ' 个)'),
|
||||
orphanRows.length ? el('div', { className: 'iwb-diag-list' }, orphanRows.map((row, i) => el('div', { key: 'or' + i, className: 'iwb-diag-item' },
|
||||
el('div', { className: 'iwb-diag-head' }, row.name + ' · ' + row.nodes + ' 个节点 · ' + row.id),
|
||||
|
||||
@@ -902,8 +902,21 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-out-head .iwb-label { flex: 0 0 auto; }
|
||||
.iwb-out-tools { flex: 1 1 auto; display: flex; gap: 4px; justify-content: flex-end; }
|
||||
.iwb-out-tools .iwb-btn { padding: 2px 8px; font-size: 11px; }
|
||||
.iwb-out-cell-img { width: 100%; height: auto; display: block; border-radius: var(--iwb-radius-control); border: 1px solid var(--iwb-border); cursor: zoom-in; background: var(--iwb-layer2); transition: border-color .12s; }
|
||||
.iwb-out-cell-img:hover { border-color: var(--iwb-brand); }
|
||||
.iwb-out-cell-img { width: 100%; height: auto; display: block; border-radius: var(--iwb-radius-control); border: 1px solid var(--iwb-border); cursor: zoom-in; background: var(--iwb-layer2); transition: border-color var(--iwb-motion-hover) var(--iwb-ease-hover), box-shadow var(--iwb-motion-hover) var(--iwb-ease-hover), transform var(--iwb-motion-hover) var(--iwb-ease-hover); }
|
||||
/* 悬停:卡片级的浮起(图本身轻微抬 2px + 放大 1.02)。用 cell:hover 而不是 img:hover:
|
||||
指针压到浮层按钮上时图片仍是「悬停中」,不会出现按钮还在、图先弹回去的抖动。 */
|
||||
.iwb-out-cell:hover .iwb-out-cell-img { border-color: var(--iwb-hover-border); filter: drop-shadow(var(--iwb-hover-shadow)); transform: translateY(var(--iwb-hover-lift)) scale(var(--iwb-hover-scale)); }
|
||||
/* 下载浮层(2026-11-26):底部渐变 + 主按钮,hover/focus 才出现;条本身不吃事件,只有按钮吃。 */
|
||||
.iwb-dl-ov { position: relative; display: block; border-radius: var(--iwb-radius-control); overflow: hidden; }
|
||||
.iwb-dl-ov > img { display: block; width: 100%; height: auto; }
|
||||
.iwb-dl-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: var(--iwb-space-6); padding: var(--iwb-space-16) var(--iwb-space-8) var(--iwb-space-6); background-image: linear-gradient(to top, var(--iwb-scrim), transparent); opacity: 0; transition: opacity var(--iwb-motion-hover) var(--iwb-ease-hover); pointer-events: none; }
|
||||
.iwb-dl-ov:hover .iwb-dl-bar, .iwb-dl-ov:focus-within .iwb-dl-bar { opacity: 1; pointer-events: auto; }
|
||||
.iwb-dl-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--iwb-space-4); height: 24px; padding: 0 var(--iwb-space-10); border: 1px solid color-mix(in srgb, var(--iwb-on-brand) 30%, transparent); border-radius: var(--iwb-radius-full); background: var(--iwb-brand); color: var(--iwb-on-brand); font-size: var(--iwb-font-2xs); line-height: 1; cursor: pointer; box-shadow: none; }
|
||||
.iwb-dl-btn:hover { filter: drop-shadow(var(--iwb-hover-shadow)) brightness(1.05); }
|
||||
.iwb-dl-btn-ghost { background: color-mix(in srgb, var(--iwb-panel) 18%, transparent); color: var(--iwb-on-brand); border-color: color-mix(in srgb, var(--iwb-on-brand) 26%, transparent); }
|
||||
.iwb-dl-btn .iwb-ic { width: var(--iwb-icon-sm); height: var(--iwb-icon-sm); }
|
||||
.iwb-dl-txt { white-space: nowrap; }
|
||||
@media (prefers-reduced-motion: reduce) { .iwb-out-cell-img, .iwb-dl-bar { transition: none; } .iwb-out-cell:hover .iwb-out-cell-img { transform: none; } }
|
||||
.iwb-out-cell-meta { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); text-align: center; margin-top: var(--iwb-space-2); }
|
||||
.iwb-out-cell-actions { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: flex; align-items: center; justify-content: center; gap: var(--iwb-space-10); opacity: 0; transition: opacity .15s; border-radius: 0 0 8px 8px; background: rgba(0,0,0,0.45); } /*iwb:raw-until=3.28.0*/
|
||||
.iwb-out-cell:hover .iwb-out-cell-actions { opacity: 1; }
|
||||
|
||||
+1
@@ -13,6 +13,7 @@
|
||||
"IWBDesktop",
|
||||
"IWBDesktopHelpers",
|
||||
"IWBDockArea",
|
||||
"IWBGalleryAudit",
|
||||
"IWBGalleryHydration",
|
||||
"IWBGallerySync",
|
||||
"IWBGenerationEndpoint",
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"image-blob-store.js",
|
||||
"runtime-crash-log.js",
|
||||
"storage-health.js",
|
||||
"gallery-audit.js",
|
||||
"storage-config-shape.js",
|
||||
"generation-default-model.js",
|
||||
"storage-indexeddb.js",
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
'use strict'
|
||||
|
||||
const assert = require('assert')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const vm = require('vm')
|
||||
|
||||
const root = path.resolve(__dirname, '..')
|
||||
const sandbox = {}
|
||||
vm.runInNewContext(fs.readFileSync(path.join(root, 'src', 'gallery-audit.js'), 'utf8'), sandbox)
|
||||
const A = sandbox.IWBGalleryAudit
|
||||
|
||||
// 1) 三态判定:原图 / 仅缩略图 / 全丢
|
||||
const orig = A.classify({ name: 'a.png', url: 'http://x/a.png', origIdb: 'out_orig_a.png', idb: 'out_a.png' }, { orig: true, thumb: true, origPath: 'images/gallery/aaa.png' })
|
||||
assert.strictEqual(orig.state, 'orig')
|
||||
assert.strictEqual(orig.label, '原图 OK')
|
||||
const thumb = A.classify({ name: 'b.png', url: 'http://x/b.png' }, { orig: false, thumb: true, origPath: '', origKeyKnown: true })
|
||||
assert.strictEqual(thumb.state, 'thumb')
|
||||
assert.ok(/原图未落盘/.test(thumb.reason))
|
||||
assert.strictEqual(thumb.origKey, 'out_orig_b.png')
|
||||
const lost = A.classify({ name: 'c.png', url: 'http://x/c.png' }, { orig: false, thumb: false })
|
||||
assert.strictEqual(lost.state, 'lost')
|
||||
assert.ok(/只剩远程 URL/.test(lost.reason))
|
||||
// 登记了但磁盘没有:原因必须与「从未写」区分开
|
||||
const missingFile = A.classify({ name: 'd.png' }, { orig: false, thumb: true, origPath: 'images/gallery/ddd.png', origKeyKnown: true })
|
||||
assert.ok(/文件缺失/.test(missingFile.reason))
|
||||
// 只在磁盘有原图、没有缩略图:仍算已落盘
|
||||
const origOnly = A.classify({ name: 'e.png' }, { orig: true, thumb: false })
|
||||
assert.strictEqual(origOnly.state, 'orig')
|
||||
|
||||
const sum = A.summarize([orig, thumb, lost, missingFile, origOnly])
|
||||
assert.deepStrictEqual({ total: sum.total, orig: sum.orig, thumb: sum.thumb, lost: sum.lost }, { total: 5, orig: 2, thumb: 2, lost: 1 })
|
||||
|
||||
// 2) run:桌面端以磁盘事实为准,并找出未被索引引用的原图
|
||||
const index = [
|
||||
{ name: 'x.png', url: 'https://cdn/x.png', origIdb: 'out_orig_x.png', idb: 'out_x.png' },
|
||||
{ name: 'y.png', url: 'https://cdn/y.png', idb: 'out_y.png' },
|
||||
]
|
||||
const fakeFile = {
|
||||
async galleryAudit () {
|
||||
return {
|
||||
ok: true,
|
||||
dir: '/tmp/iwb',
|
||||
rows: [
|
||||
{ name: 'x.png', orig: true, thumb: true, origPath: 'images/gallery/x.png', thumbPath: 'images/thumbs/x.jpg', origKey: true },
|
||||
{ name: 'y.png', orig: false, thumb: true, origPath: '', thumbPath: 'images/thumbs/y.jpg', origKey: false },
|
||||
],
|
||||
galleryFiles: ['x.png', 'orphan.png'],
|
||||
}
|
||||
},
|
||||
}
|
||||
;(async () => {
|
||||
const r = await A.run({ index, storageFile: fakeFile, idbKeys: [] })
|
||||
assert.strictEqual(r.desktop, true)
|
||||
assert.strictEqual(r.dir, '/tmp/iwb')
|
||||
assert.strictEqual(r.summary.orig, 1)
|
||||
assert.strictEqual(r.summary.thumb, 1)
|
||||
assert.strictEqual(r.rows[1].reason.indexOf('未登记') >= 0, true)
|
||||
assert.deepStrictEqual(r.orphans, ['orphan.png'])
|
||||
|
||||
// 3) 浏览器路径:只看键集合
|
||||
const web = await A.run({ index, storageFile: null, idbKeys: ['out_orig_x.png', 'out_x.png', 'out_y.png'] })
|
||||
assert.strictEqual(web.desktop, false)
|
||||
assert.strictEqual(web.summary.orig, 1)
|
||||
assert.strictEqual(web.summary.thumb, 1)
|
||||
|
||||
// 4) 会话计数:只认 out_orig_,失败原因聚合
|
||||
A.resetSession()
|
||||
A.noteWrite('out_orig_a.png', true)
|
||||
A.noteWrite('out_orig_b.png', false, 'quota exceeded')
|
||||
A.noteWrite('out_c.png', false, '忽略:不是原图')
|
||||
const st = A.stats()
|
||||
assert.strictEqual(st.origOk, 1)
|
||||
assert.strictEqual(st.origFail, 1)
|
||||
assert.strictEqual(st.reasons[0].reason, 'quota exceeded')
|
||||
const text = A.report(Object.assign({}, r, { session: A.stats() }))
|
||||
assert.ok(/图库落盘自检/.test(text))
|
||||
assert.ok(/原图 OK 1/.test(text))
|
||||
assert.ok(/仅缩略图 1/.test(text))
|
||||
assert.ok(/失败 1/.test(text))
|
||||
assert.ok(!/https:\/\//.test(text), '报告不得包含远程 URL')
|
||||
|
||||
console.log('gallery-audit: 全部通过')
|
||||
})().catch((e) => { console.error(e); process.exit(1) })
|
||||
@@ -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: 全部通过')
|
||||
@@ -165,9 +165,12 @@ const MAX_SRC_COMPONENT_LINES = 531
|
||||
// · 本地文件模块惰性取用 wFileRefMod(避免跨文件引用脆弱,8 行) +8
|
||||
// · 底栏「插件节点」下拉接线(回调 + 传参,2 行) +2
|
||||
// · 底栏换拼图图标入口(puzzle 图标 + 组件接线,2 行) +2
|
||||
// · 插件图标解析 + toolbar 隐藏(2026-11-26,5 行) +5
|
||||
// · 变体透传 icon/toolbar 到底栏(2 行) +2
|
||||
// · 图标解析统一(右键菜单 + 设置页走同一解析器,2 行) +2
|
||||
// 通用件(pick/grant/stat/readDataUrl/readBlob/参数校验)全部在 src/image-file-ref.js
|
||||
// 与 src/plugin-api-images.js,app.js 只做装配。
|
||||
const MAX_APP_JS_LINES = 9173
|
||||
const MAX_APP_JS_LINES = 9183 // +1(2026-11-26 图库落盘自检装配:诊断页需要把 storage-file 的磁盘事实接进 wStorageAudit;逻辑在 src/gallery-audit.js)
|
||||
const MAX_APP_JS_SHARE = 0.40
|
||||
|
||||
// ── 历史记账(供回溯,逐条保留)──────────────────────────────────────────────
|
||||
|
||||
Vendored
+1
@@ -18,6 +18,7 @@ interface Window {
|
||||
IWBStorageContract?: any
|
||||
IWBStorageResult?: any
|
||||
IWBStorageHealth?: any
|
||||
IWBGalleryAudit?: any
|
||||
IWBStorageBackup?: any
|
||||
IWBStorageGroups?: any
|
||||
IWBStorageWorkspace?: any
|
||||
|
||||
Reference in new issue
Block a user