Compare commits

...
7 Commits
Author SHA1 Message Date
qiqi 78519b56d8 fix(dock): 停靠栏仅画布渲染 + 插件重启用恢复默认面板 + 保存设置按钮(v3.25.86)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 28s
2026-11-21 09:21:06 +08:00
qiqi 19c95ef6b1 style(theme): P3 收尾 + P4 插件主题契约(v3.25.85)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 29s
2026-11-21 09:01:22 +08:00
qiqi bbb763c2cf fix(ui): 取色板自动确认 + 停靠栏图标按可用面板过滤(v3.25.84)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 27s
2026-11-21 08:39:35 +08:00
qiqi 611cd8f1b9 style(theme): 语义色收口到 token + on-brand(v3.25.83,P3 第一批)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 30s
2026-11-21 08:24:56 +08:00
qiqi 73a7126e30 fix(ui): 删底栏资源库按钮 + 停靠栏按插件过滤 + 修右侧栏串面板(v3.25.82)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 25s
2026-11-21 08:19:37 +08:00
qiqi 34269f9770 feat(theme): 配色自动适配 P1+P2(4 种子派生 + 外观面板开关,v3.25.81)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 30s
2026-11-21 08:10:09 +08:00
qiqi 7a4204d0a9 perf(images): 合并预览/远程图本地缓存/legacy 清理/图库缩略图回收(v3.25.80)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 31s
2026-11-21 07:55:12 +08:00
33 changed files with 853 additions and 160 deletions

No files matched your search

+73
View File
@@ -14,6 +14,79 @@
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
## v3.25.86(2026-11-21)停靠栏作用域 / 插件重启用 / 保存按钮
### 修复
- **浏览器插进插件页**:停靠栏改为只在 `shellView === 'canvas'` 时渲染(插件整页/首页不再带左右栏)。
- **重新启用提词库/节点组后左栏不显示**:之前关插件时把面板列表清空了,重新启用只恢复面板对象、列表还是空的。现在列表为空时回落到默认面板列表(`props.defaults`)。
### 新增
- 插件设置页增加「保存设置」按钮:调用 `PluginHost.persist()` 显式落盘并提示(`setSetting` 本身已即时保存,这里是用户要的明确出口)。
## v3.25.85(2026-11-21)P3 收尾 + P4 插件主题契约
### P3 收尾(表面色/语义色全部走 token)
- `#b91c1c` → `var(--iwb-err)`;设置面板的紫色开关(`#6b5ce7`)→ `var(--iwb-brand)`;`#d9dbde`/`#d5d9e0` → `--iwb-canvas-bg`/`--iwb-border`。
- 品牌/深色底上的白字统一 `var(--iwb-on-brand)`(自动配色按对比度选黑/白)。
- `background: #fff/#ffffff` 批量收口到 `var(--iwb-panel)`。
- style.css 硬编码 hex:165 → 117(剩余为 token 定义、暗色 ramp、节点自定义色卡、阴影/蒙版纯黑)。
### P4 插件主题契约
- 新增别名 `--iwb-plugin-{bg,panel,layer,border,text,text2,brand,on-brand,err,ok,warn}`(`:root` 里全部指向 `--iwb-*`),插件跟随主题/自动配色只需用别名。
- 新增 `tests/plugin-theme-contract-test.js`:扫描 `plugins/**`,样式里写死颜色即失败;5 个历史插件(浏览器/批量导出/风格库/位图转矢量/白底画布)以白名单 + 原因暂留,待插件源码仓库改造。
## v3.25.84(2026-11-21)取色板自动确认 + 停靠栏图标残留
### 调整
- **取色板不再需要点「完成」**:在色板/色相条上松手后 120ms 自动收起并生效;点面板外部也会关闭;正在输入 hex/RGB 时不自动关。
### 修复
- **插件关闭后停靠栏仍有图标残留**:头部图标列表改为只画「当前可用面板」(`panels[id]` 存在);同时新增状态清洗 —— 插件启停后自动剔除已不存在的 id,active 失效回退到第一个可用面板。
## v3.25.83(2026-11-21)P3 第一批:语义色收口到 token
### 改动
- 语义色错误/成功/警告 收口:`#ef4444`/`#dc2626` → `var(--iwb-err)`;`#22c55e` → `var(--iwb-ok)`;`#d97706`/`#b45309` → `var(--iwb-warn)`;`#6b7280` → `var(--iwb-text2)`(共 30 处)。
- 新增 `--iwb-on-brand`:自动配色按对比度选黑/白,替换品牌底上的写死 `#fff`。
- theme-tokens 同步派生 err/ok/warn(暗色自动提亮一档)+ onBrand。
### 结果
- style.css 硬编码 hex 165 → 132(剩余为 token 定义、暗色 ramp、节点自定义底色、阴影/蒙版用黑)。
## v3.25.82(2026-11-21)底栏/停靠栏与插件开关联动
### 调整
- 底栏「资源库」按钮(archive 图标)删除:右侧栏/提示词库面板已覆盖该入口(用户裁定)。
- 停靠栏面板清单抽到 `src/ui-dock-panels.js` 并按**插件启用状态**过滤:插件关掉后左右栏不再出现该面板;某侧一个可用面板都没有时**整侧不渲染**(连折叠窄条也不画)。
- 插件宿主未就绪(空列表,jsdom/首次启动)时不做过滤,避免误藏全部面板。
### 修复
- 右侧栏「图库旁边偶尔冒出提示词库」:之前宿主用 `drawerTab` 强行指定 active(`history→gallery` 否则 `prompts`)。现在改为:右侧栏自己记住 active,仅在显式切换 tab 时派发 `iwb:dock-activate` 事件。
## v3.25.81(2026-11-21)配色自动适配 P1+P2
### 新增
- 新增 src/theme-tokens.js:只定 4 个种子(中性基调 / 画布深浅 / 强调色 / 模式),派生 18 个语义色并写入现有 --iwb-* 变量;文本对表面自动做 4.5:1 对比度夹紧。
- 外观面板新增「自动配色」(默认开启):改中性基调或画布深浅,整机配色实时跟着变;关闭后才显示原来的逐项手动调节(老配置自动视为手动)。
### 待办
- P3:把 style.css 里 165 个 hex + 84 个 rgba 收口到 token;P4:插件只允许用 --iwb-*。
## v3.25.80(2026-11-21)图片链路收口 1-4
### 1 合并两套预览
- 删除 1024 派生预览(`IWBImagePreviewDerive` 链路),统一用 768 显示缩略图;`wPreviewUrlOf` 改为直通(调用点不变)。
### 2 远程参考图本地缓存
- 新增 `src/image-remote-cache.js`:空闲时下载远程参考图一次,写入本地引用存储,节点只加 `data.localRef`(仅显示)。
- **`data.url` 原样保留**:提交生成仍然用链接(用户约束)。
### 3 legacy 目录清理
- `cleanupLegacy(keep)`:只删除「未被任何画布引用 + 超过 7 天」的 `images/legacy/*`,引用中的永不删。
### 4 图库缩略图纳入回收
- `pruneThumbs(300MB)` 的匹配范围扩到 `images/thumbs/<hash>.jpg`(图库缩略图),超限删最老 20%。
## v3.25.79(2026-11-21)修缩略图 MIME 错配导致的黑块
### 根因
+1 -1
View File
@@ -41,7 +41,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 108 个单测文件(jsdom 契约测试;2026-11-07 新增 sync-facts-guard(事实一致性)/ _helpers/source(统一源文本);2026-11-12 新增 provider-ping(测速 no-cors 兜底))
test:unit 109 个单测文件(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)
+31 -64
View File
@@ -1208,6 +1208,19 @@
// 保证可见;只在**首次**失败时提示一次,不打扰日常。
try { wLogNotice('诊断日志暂时无法写入(浏览器存储不可用),本次操作记录不会保存。', 'err') } catch (e) { /* ignore */ }
}
// v3.25.80:收集所有画布引用到的图片文件名(给 legacy 清理用;放在 Workbench 外,避免组件行数上涨)
function wCollectRefImageNames (workspaces) {
const keep = []
try {
for (const ws of (workspaces || [])) {
const txt = JSON.stringify(ws && ws.nodes ? ws.nodes : [])
const m = txt.match(/[0-9a-f]{8,32}\.(?:png|jpe?g|webp|gif)/g)
if (m) for (const x of m) keep.push(x)
}
} catch (e) { /* ignore */ }
return keep
}
function wLog(kind, msg, detail) {
try {
const now = Date.now()
@@ -4742,54 +4755,10 @@ const tbCenterSeed = (type, refs) => {
function wPrimeDisplayThumbForRef (ref, dataUrl) { return ThumbPick ? ThumbPick.prime(ref, dataUrl) : false }
// ==== v3.87.54(丙方案 C2 · 第 1 步):画布小预览 URL 解析器 ====
// 设计(详见 docs/archive/plans/opentu-parity-image-memory.md §8):复用 wDisplayThumbOf 已验证的模式
// —— 同步返回原值(首帧不闪空)→ 异步用 IWBImagePreviewDerive **解码即缩放**(≤1024)→ wThumbBump 触发一次重渲染换小图。
// 本步**只新增、不接入渲染**(零行为变更),下一步再逐个接入 4 个渲染点。
const previewUrls = new Map()
const previewPending = new Set()
const PREVIEW_MAX_EDGE = 1024
const PREVIEW_CACHE_MAX = 200
function wPreviewRevoke(url) { try { if (typeof url === 'string' && url.indexOf('blob:') === 0) URL.revokeObjectURL(url) } catch (e) { /* ignore */ } }
function wPreviewPick(key, val) {
if (previewUrls.size >= PREVIEW_CACHE_MAX) {
const first = previewUrls.keys().next().value
if (first !== undefined) { wPreviewRevoke(previewUrls.get(first)); previewUrls.delete(first) }
}
previewUrls.set(key, val)
}
function wPreviewUrlOf(v) {
// v3.24.64:SVG 不做光栅化派生 —— 浏览器 <img> 原生渲染矢量,且原图通常只有几十 KB,
// 光栅化反而把矢量变成 ≤1024 的位图(放大糊),还要多一次跨域代理请求。
if (ImageFormat && ImageFormat.isSvg && ImageFormat.isSvg(v)) return v
const key = wDisplayThumbKey(v)
if (!key) return v
const hit = previewUrls.get(key)
if (hit) return hit
if (previewPending.has(key)) return v
const Derive = (typeof window !== 'undefined') ? window.IWBImagePreviewDerive : null
if (!Derive || typeof Derive.create !== 'function' || typeof document === 'undefined') return v
previewPending.add(key)
// 桌面客户端没有同源代理(旧的 functions/api/img.js 已随网页版删除)⇒ 派生器直连;
// 跨域失败即负缓存并回退原图,不影响显示。
const viaUrl = undefined
let inst = null
try { inst = Derive.create({ maxEdge: PREVIEW_MAX_EDGE, quality: 0.82 }) } catch (e) { inst = null }
if (!inst || typeof inst.deriveUrl !== 'function') { previewPending.delete(key); wPreviewPick(key, v); return v }
try {
inst.deriveUrl(v, { viaUrl: viaUrl }).then((r) => {
previewPending.delete(key)
if (!r || !r.ok || !r.url) { wPreviewPick(key, v); return } // 负缓存:失败不再重试
wPreviewPick(key, r.url)
if (typeof wThumbBump === 'function') { try { wThumbBump() } catch (e) { /* ignore */ } }
}).catch(() => { previewPending.delete(key); wPreviewPick(key, v) })
} catch (e) { previewPending.delete(key); wPreviewPick(key, v) }
return v // 首帧:原值
}
function wPreviewRevokeAll() {
try { for (const u of previewUrls.values()) wPreviewRevoke(u) } catch (e) { /* ignore */ }
previewUrls.clear(); previewPending.clear()
}
// v3.25.80:旧的「1024 预览派生」已并入 768 显示缩略图(两套解码=两份内存)。
// 保留同名入口做直通,调用点不改;真正的缩略由 image-display-thumb + ThumbPick 负责。
function wPreviewUrlOf (v) { return v }
function wPreviewRevokeAll () { /* 直通后没有独立 objectURL 需要回收 */ }
// 显示缩略图落盘(768px):下次启动直接读文件,不用再解码原图
const DISPLAY_THUMB_HASH_MAX = 512
@@ -5710,7 +5679,7 @@ const tbCenterSeed = (type, refs) => {
return () => { clearTimeout(t1); clearTimeout(t2) }
}, [])
const [drawerOpen, setDrawerOpenRaw] = useState(() => { try { return lsRawGet('iwb_drawer_open', null) !== '0' } catch (e) { return true } }); const setDrawerOpen = (v) => { setDrawerOpenRaw(v); try { lsRawSet('iwb_drawer_open', v ? '1' : '0') } catch (e) { /* ignore */ } } // 库面板开合状态持久化:刷新后保持上次开关(2026-11-03);读写失败回退「关闭」,不阻断启动
const [drawerTab, setDrawerTabRaw] = useState(() => { try { return lsRawGet('iwb_drawer_tab', '') || 'history' } catch (e) { return 'prompts' } }); const setDrawerTab = (v) => { setDrawerTabRaw(v); try { lsRawSet('iwb_drawer_tab', String(v)) } catch (e) { /* ignore */ } } // 库面板当前标签持久化:刷新后停在上次的 tab(2026-11-03)
const [drawerTab, setDrawerTabRaw] = useState(() => { try { return lsRawGet('iwb_drawer_tab', '') || 'history' } catch (e) { return 'prompts' } }); const setDrawerTab = (v) => { setDrawerTabRaw(v); try { lsRawSet('iwb_drawer_tab', String(v)) } catch (e) { /* ignore */ } ; try { window.dispatchEvent(new CustomEvent('iwb:dock-activate', { detail: { side: 'right', id: v === 'history' ? 'gallery' : 'prompts' } })) } catch (e) { /* ignore */ } } // 库面板当前标签持久化:刷新后停在上次的 tab(2026-11-03)
const [enteringWs, setEnteringWs] = useState(false) // 进入画布编辑器的加载动画
const [outputs, setOutputs] = useState([])
const [outputsInfo, setOutputsInfo] = useState(null)
@@ -5850,15 +5819,16 @@ const tbCenterSeed = (type, refs) => {
}, [])
const [thumbRev, setThumbRev] = React.useState(0) // v3.87.7:显示缩略图就绪后触发一次 re-render(必须在 Workbench 内)
useEffect(() => { wThumbBump = () => setThumbRev((v) => v + 1); return () => { wThumbBump = null } }, [])
// 缩略图回收(v3.25.78):启动 8 秒后按 300MB 上限清理最老的缩略图,不抢首帧
// 启动维护(v3.25.80):8 秒后做缩略图封顶 + legacy 未引用清理;同时启动远程参考图本地缓存。
useEffect(() => {
const RC = (typeof window !== 'undefined') ? window.IWBImageRemoteCache : null
const stop = (RC && typeof RC.attach === 'function')
? RC.attach({ getState: () => ({ enabled: !!(loaded && shellView === 'canvas'), nodes: (refs && refs.nodes) || [] }), writeRef: (u) => wImgRefWrite(u), updateNode: (id, patch) => updateNode(id, patch) })
: null
const timer = setTimeout(() => {
try {
const F = wStoreMod()
if (F && typeof F.pruneThumbs === 'function') F.pruneThumbs(300).catch(() => { /* ignore */ })
} catch (e) { /* ignore */ }
try { const F = wStoreMod(); if (F && typeof F.maintain === 'function') F.maintain({ maxMB: 300, keep: wCollectRefImageNames(workspaces) }).catch(() => { /* ignore */ }) } catch (e) { /* ignore */ }
}, 8000)
return () => clearTimeout(timer)
return () => { if (timer) clearTimeout(timer); if (typeof stop === 'function') stop() }
}, [])
// 外观实时预览(v3.25.76):设置面板每改一个外观项都会派发该事件,
// 这里只 bump 一次渲染,让网格贴图按新的间距/颜色/样式重新生成。
@@ -8257,13 +8227,10 @@ const tbCenterSeed = (type, refs) => {
notify: (text, type) => { setNotice({ type: type === 'err' ? 'err' : 'ok', text: String(text || '') }); showToast(String(text || ''), type) },
})
}
const dockPanels = {
groups: { title: '节点组', icon: 'group', pluginId: 'grouplib', hint: '节点组插件未安装 · 设置 → 插件 → 市场安装' },
browser: { title: '浏览器', icon: 'globe', pluginId: 'browser' },
styles: { title: '风格库', icon: 'palette', pluginId: 'style-source' },
prompts: { title: '提示词库', icon: 'book', pluginId: 'promptlib', hint: '提示词库插件未安装 · 设置 → 插件 → 市场安装' },
gallery: { title: '图库', icon: 'ref', pluginId: 'gallery', hint: '图库插件未安装 · 设置 → 插件 → 市场安装' },
}
// v3.25.82:停靠栏面板清单(按插件启用过滤)在 src/ui-dock-panels.js
const dockPanels = (typeof window !== 'undefined' && window.IWBUIDockPanels)
? window.IWBUIDockPanels.build(PluginHost)
: {}
return el('div', { className: 'iwb-overlay' + (shellView === 'landing' ? ' iwb-view-landing' : shellView === 'home' ? ' iwb-view-home' : (shellView === 'plugins' ? ' iwb-view-plugins' : ' iwb-view-canvas')) + (drawerOpen ? ' drawer-open' : '') + ((nodes.length && loaded) ? ' has-minimap' : '') },
// 页面加载动画(加载完成后淡出)
!splashDone ? el('div', { className: 'iwb-splash' + (loaded ? ' iwb-splash-fade' : '') },
@@ -8571,9 +8538,9 @@ const tbCenterSeed = (type, refs) => {
measuredT: tick,
onJump: mmOnJump,
}) : null,
DockArea ? el(DockArea, { panels: dockPanels, renderIcon: I, storageKey: 'iwb.dock.v1', PluginHost,
(shellView === 'canvas' && DockArea) ? el(DockArea, { panels: dockPanels, renderIcon: I, storageKey: 'iwb.dock.v1', PluginHost,
pluginMount: (id) => { const p = wPluginPanels.find((x) => x.pluginId === id || x.id === id + '-panel'); return p ? p.mount : null },
rightOpen: drawerOpen, onRightOpen: (v) => setDrawerOpen(v), rightActive: drawerTab === 'history' ? 'gallery' : 'prompts',
rightOpen: drawerOpen, onRightOpen: (v) => setDrawerOpen(v),
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, {
+5 -5
View File
@@ -1,7 +1,7 @@
# 现状架构与性能事实基线(image-workbench-web)
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = f02b3dc`(线上 `v3.25.79+f02b3dc` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--iwb-dock-bg` 进灰阶 ramp + 头部深一档 + `.iwb-pcard` 补白底)+ 修 `Cargo.toml`/`Cargo.lock` 版本漂移,四处统一到 3.25.58)。上一条 3.25.30:线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 19c95ef`(线上 `v3.25.86+19c95ef` —— **未上线**(本地测试中):左右停靠栏配色对齐主色调(新增 `--iwb-dock-bg` 进灰阶 ramp + 头部深一档 + `.iwb-pcard` 补白底)+ 修 `Cargo.toml`/`Cargo.lock` 版本漂移,四处统一到 3.25.58)。上一条 3.25.30:线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
<!-- 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 **8,508 行**(**双层预算**:绝对上限 8,700 / 占总源码 ≤ 40%,现 **36.8%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,998 行**(上限 **3,030**,余量 32;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **99** 个模块 / 14,607 行,`sourceModules` 99 项;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 **8,508 行**(**双层预算**:绝对上限 8,700 / 占总源码 ≤ 40%,现 **36.8%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,998 行**(上限 **3,030**,余量 32;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **102** 个模块 / 14,607 行,`sourceModules` 102 项;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` 不引用模块全局)。**99 个模块中 59 个导出**被 `app.js` 读取;其余为未接线 / 仅测试 / 零引用(见下)。
- **判定法**:`global.X =` / `root.X =` 判「导出」;跨文件裸引用判「读」;排除自合并(`src/runtime-constants.js:9`)。`app.js` 是**唯一生产消费者**(无 HTML 入口;`sw.js` 不引用模块全局)。**102 个模块中 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 耦合面(**83** 项)与 `sourceModules` 顺序(**99** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
- **耦合面已冻结**:`tests/architecture-boundary-guard-test.js`(进 `npm run test:unit` 末环)冻结 app.js↔src 耦合面(**84** 项)与 `sourceModules` 顺序(**102** 项);命名例外由第 5 组冻结,新增非 `IWB` 前缀导出即打红。
## 12. 易踩的坑
@@ -254,7 +254,7 @@
**信任模型(必须明示)**:形态 A 的插件是**可信代码**(与核心同权限、无沙箱);启停与设置是 UX 与可维护性手段,**不是安全边界**(同 §13.27 教训:前端开关一定可被绕过)。
**守门与快照**:`tests/architecture-boundary-guard-test.js` 冻结「app.js ↔ src 耦合面」(**83** 项)与 `sourceModules` 顺序(**99** 项);新增模块、新增耦合、新增 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 耦合面」(**84** 项)与 `sourceModules` 顺序(**102** 项);新增模块、新增耦合、新增 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
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.25.79",
"version": "3.25.86",
"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/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/storage-config-shape-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/image-blob-store-test.js && node tests/image-preview-derive-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/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/prompt-md-roundtrip-test.js && node tests/generation-results-store-test.js && node tests/out-groups-order-test.js && node tests/ui-workbench-hooks-test.js",
"test:unit": "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/storage-config-shape-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/image-blob-store-test.js && node tests/image-preview-derive-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/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/ui-workbench-hooks-test.js",
"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",
+3
View File
@@ -92,8 +92,11 @@ const sourceModules = [
'generation-task-graph.js',
'generation-results-store.js',
'ui-dock.js',
'ui-dock-panels.js',
'theme-tokens.js',
'canvas-grid.js',
'image-display-thumb.js',
'image-remote-cache.js',
'image-thumb-pick.js',
'ui-modal-drag.js',
'ui-nav-rail.js',
+33 -5
View File
@@ -54,13 +54,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.25.79 · 8.4 MB · .dmg<div class="hash">sha256 c812625edf06724a…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.79_aarch64.dmg?h=c812625edf06">下载</a>
<div class="meta">版本 3.25.86 · 8.4 MB · .dmg<div class="hash">sha256 7676260f74c6215d…</div></div>
<a class="btn" href="/updates/darwin-aarch64/image-workbench_3.25.86_aarch64.dmg?h=7676260f74c6">下载</a>
</div>
<div class="row">
<div class="name">macOS · Intel<div class="hint">x86_64</div></div>
<div class="meta">版本 3.25.79 · 8.8 MB · .dmg<div class="hash">sha256 770f63ee92ba992c…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.79_x64.dmg?h=770f63ee92ba">下载</a>
<div class="meta">版本 3.25.86 · 8.8 MB · .dmg<div class="hash">sha256 dd71e38b38939621…</div></div>
<a class="btn" href="/updates/darwin-x86_64/image-workbench_3.25.86_x64.dmg?h=dd71e38b3893">下载</a>
</div>
<div class="row">
<div class="name">Windows · x64<div class="hint">需要 WebView2</div></div>
@@ -94,6 +94,34 @@
</ol>
<h2>历史版本</h2>
<div class="row">
<div class="name">3.25.86<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.85<div class="hint">Intel 版:同一批改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.84<div class="hint">Intel 版:同一批修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.83<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.82<div class="hint">Intel 版:同一批调整</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.81<div class="hint">Intel 版:同一改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.80<div class="hint">Intel 版:同一批改动</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
</div>
<div class="row">
<div class="name">3.25.79<div class="hint">Intel 版:同一修复</div></div>
<div class="meta">2026-11-21<div class="hint">macOS · Apple Silicon / macOS · Intel</div></div>
@@ -296,7 +324,7 @@
</div>
<div class="foot">
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 2026-11-20
本页由 <code>scripts/gen-release-page.js</code> 从 releases.json 生成 · 源码 <a href="https://git.maqiart.eu.org/malongan/image-workbench-desktop">git.maqiart.eu.org</a> · 更新于 2026-11-21
</div>
</div></div>
+7 -7
View File
@@ -2,7 +2,7 @@
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Image Workbench · 本地优先的 AI 生图工作台</title>
<meta name="description" content="本地优先的 AI 生图无限画布:节点式工作流、插件按需安装、数据全部留在本机。">
<link rel="stylesheet" href="/assets/style.css?v=3.25.79-mwpmhqoh">
<link rel="stylesheet" href="/assets/style.css?v=3.25.86-mwpq22dy">
</head><body>
<nav><div class="wrap inner">
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
@@ -14,19 +14,19 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.25.79</a>
<a class="btn primary" href="/download/">下载 v3.25.86</a>
</div>
</div></nav>
<main>
<section class="hero hero-art">
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.79-mwpmhqoh" alt=""></div>
<div class="hero-bg"><img src="/assets/painting.jpg?v=3.25.86-mwpq22dy" alt=""></div>
<div class="hero-veil"></div>
<div class="wrap">
<span class="kicker">v3.25.79 · macOS / Windows · 数据在本地</span>
<span class="kicker">v3.25.86 · macOS / Windows · 数据在本地</span>
<h1>本地优先的<br>AI 生图无限画布</h1>
<p class="sub">用节点把「参考图 → 提示词 → 批量生成 → 图库」串成一条生产线。<br>图片、提示词、模型配置全部留在你自己的电脑里,插件按需安装。</p>
<div class="cta">
<a class="btn primary lg" href="/download/">下载 v3.25.79</a>
<a class="btn primary lg" href="/download/">下载 v3.25.86</a>
<a class="btn lg" href="/plugins/">浏览 11 个插件</a>
</div>
<div class="meta">支持 macOS 12+ 与 Windows 10 1803+ · 安装包约 7 MB · 无需登录</div>
@@ -93,8 +93,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.25.79_aarch64.dmg?h=c812625edf06"><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.25.79_x64.dmg?h=770f63ee92ba"><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.25.86_aarch64.dmg?h=7676260f74c6"><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.25.86_x64.dmg?h=dd71e38b3893"><div class="n">macOS · Intel</div><div class="s">x86_64 · 8.8 MB · .dmg</div></a>
<div class="none"><div class="n">Windows · x64</div><div class="s">暂未提供</div></div></div>
<div style="margin-top:20px;color:#9ca3af;font-size:12.5px">安装包未做 Apple 公证 / Windows 代码签名,首次打开需手动放行一次,细节见 <a href="/download/" style="text-decoration:underline">下载页</a>。</div>
</div></section>
+2 -2
View File
@@ -1,7 +1,7 @@
<!doctype html>
<html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>插件市场 · Image Workbench</title>
<link rel="stylesheet" href="/assets/style.css?v=3.25.79-mwpmhqoh">
<link rel="stylesheet" href="/assets/style.css?v=3.25.86-mwpq22dy">
</head><body>
<nav><div class="wrap inner">
<a class="brand" href="/"><span class="dot">IW</span>Image Workbench</a>
@@ -13,7 +13,7 @@
</div>
<div class="right">
<a class="btn" href="/plugins/">插件市场</a>
<a class="btn primary" href="/download/">下载 v3.25.79</a>
<a class="btn primary" href="/download/">下载 v3.25.86</a>
</div>
</div></nav>
<main>
+148 -1
View File
@@ -1,8 +1,155 @@
{
"app": "Image Workbench",
"subtitle": "本地优先的 AI 生图无限画布 · 桌面版(Tauri v2)",
"updatedAt": "2026-11-20T23:41:18.454Z",
"updatedAt": "2026-11-21T01:21:05.589Z",
"releases": [
{
"version": "3.25.86",
"date": "2026-11-21",
"notes": "Intel 版:同一批修复",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.86_aarch64.dmg",
"size": 8779162,
"sha256": "7676260f74c6215d39fd9fff693c011dc9a7c1d5639f51ead99dc32caf0d4be4",
"h": "7676260f74c6",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.86_x64.dmg",
"size": 9181203,
"sha256": "dd71e38b3893962167faa06641ff12621141c3241a717bd9f4b2415df3976e7d",
"h": "dd71e38b3893",
"kind": "dmg"
}
}
},
{
"version": "3.25.85",
"date": "2026-11-21",
"notes": "Intel 版:同一批改动",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.85_aarch64.dmg",
"size": 8777718,
"sha256": "bb22e3d5e08b4d817a81ff5c282a0b3355dd6e7dc2e6f7adb1c467b1df38e599",
"h": "bb22e3d5e08b",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.85_x64.dmg",
"size": 9177291,
"sha256": "51fc2ca757a7637cf1380279c4a72b02b634562e7d968feff0e9a526deeb36b5",
"h": "51fc2ca757a7",
"kind": "dmg"
}
}
},
{
"version": "3.25.84",
"date": "2026-11-21",
"notes": "Intel 版:同一批修复",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.84_aarch64.dmg",
"size": 8777183,
"sha256": "de10987c03ab0dc821397fee2aaf5a36848e5010bb5691bd6c884768ccdf4e30",
"h": "de10987c03ab",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.84_x64.dmg",
"size": 9182579,
"sha256": "1177a9c43816f422b32923efb355337f86ec11d751155f6b18a92a36ee58adcd",
"h": "1177a9c43816",
"kind": "dmg"
}
}
},
{
"version": "3.25.83",
"date": "2026-11-21",
"notes": "Intel 版:同一改动",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.83_aarch64.dmg",
"size": 8778610,
"sha256": "5b11d2d6a9d1814b82011bedfb44edb5d10d096dac6a68095f61709f2c48eb53",
"h": "5b11d2d6a9d1",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.83_x64.dmg",
"size": 9180517,
"sha256": "71fd4ece02baceff0be2052bd1fb049d6d65042a9ba12a55d7ff28ee40ec8f79",
"h": "71fd4ece02ba",
"kind": "dmg"
}
}
},
{
"version": "3.25.82",
"date": "2026-11-21",
"notes": "Intel 版:同一批调整",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.82_aarch64.dmg",
"size": 8778844,
"sha256": "c7424a1170039506e7d8695125991980e8da8a4df5bb3c45b115571683bb4b2a",
"h": "c7424a117003",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.82_x64.dmg",
"size": 9178078,
"sha256": "7a8273b96ecb2bc8c60b70bad40209347b69e033c0e2d8c77819192d00606597",
"h": "7a8273b96ecb",
"kind": "dmg"
}
}
},
{
"version": "3.25.81",
"date": "2026-11-21",
"notes": "Intel 版:同一改动",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.81_aarch64.dmg",
"size": 8778368,
"sha256": "40d3caf64d557fff89694bbc22bc963371b595fd806804102ec4db9e0ad339f1",
"h": "40d3caf64d55",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.81_x64.dmg",
"size": 9179991,
"sha256": "22a4ee0511f695f999244a67a3c654c7e8cbfd9272c085d2d59be45d85835109",
"h": "22a4ee0511f6",
"kind": "dmg"
}
}
},
{
"version": "3.25.80",
"date": "2026-11-21",
"notes": "Intel 版:同一批改动",
"platforms": {
"darwin-aarch64": {
"file": "updates/darwin-aarch64/image-workbench_3.25.80_aarch64.dmg",
"size": 8779800,
"sha256": "c70868ef9ea1862e4f3d845bad27a60e259597ddec83c1eab0dcf37f9217ee75",
"h": "c70868ef9ea1",
"kind": "dmg"
},
"darwin-x86_64": {
"file": "updates/darwin-x86_64/image-workbench_3.25.80_x64.dmg",
"size": 9175793,
"sha256": "395a23fbde5a36ab1e0319331cc8303020f42a0a3ec3030575991afa5d1bc9f7",
"h": "395a23fbde5a",
"kind": "dmg"
}
}
},
{
"version": "3.25.79",
"date": "2026-11-21",
+1 -1
View File
@@ -1983,7 +1983,7 @@ dependencies = [
[[package]]
name = "image-workbench"
version = "3.25.79"
version = "3.25.86"
dependencies = [
"arboard",
"base64 0.22.1",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "image-workbench"
version = "3.25.79"
version = "3.25.86"
description = "无限画布 · 生图工作台桌面版"
authors = ["malongan"]
license = ""
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.25.79",
"version": "3.25.86",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",
+86
View File
@@ -0,0 +1,86 @@
/* image-remote-cache.js —— 远程参考图本地缓存(v3.25.80)
*
* 目的:远程参考图(如 ibb.co)每次打开画布都重新下载,慢且耗流量。
* 做法:空闲时下载一次,写入本地引用存储,节点上只记 data.localRef(显示用)。
*
* 约束(用户裁定):节点 data.url 保持原样 ⇒ **提交生成时仍然用链接**。
*/
;(function (global) {
'use strict'
const React = global.React || {}
function useRemoteRefCache (opts) {
const o = opts || {}
const tried = React.useRef(new Set())
React.useEffect(() => {
if (!o.enabled) return undefined
const pend = (o.nodes || []).filter((n) => n && n.type === 'ref' && n.data && !n.data.data && !n.data.localRef &&
/^https?:\/\//i.test(String(n.data.url || '')) && !tried.current.has(n.id))
if (!pend.length) return undefined
const timer = setTimeout(() => {
(async () => {
for (const n of pend) {
tried.current.add(n.id)
try {
const url = String((n.data && n.data.url) || '')
if (!url) continue
const resp = await fetch(url, { credentials: 'omit' })
if (!resp || !resp.ok) continue
const blob = await resp.blob()
if (!blob || !blob.size) continue
const dataUrl = await new Promise((res, rej) => {
const rd = new FileReader()
rd.onload = () => res(String(rd.result || ''))
rd.onerror = () => rej(new Error('read-failed'))
rd.readAsDataURL(blob)
})
if (!dataUrl) continue
const ref = await o.writeRef(dataUrl)
if (ref) { o.updateNode(n.id, { localRef: ref }); break }
} catch (e) { /* 跨域/离线:保留 url 显示,不重试 */ }
}
})()
}, 2500)
return () => clearTimeout(timer)
}, [o.enabled, o.activeWsId, o.nodes])
}
// 非 Hook 版本:宿主在自己的 effect 里调用,返回 stop()。
function startRemoteRefCache (opts) {
const o = opts || {}
const tried = new Set()
const timer = setInterval(() => {
let st = null
try { st = typeof o.getState === 'function' ? o.getState() : null } catch (e) { st = null }
if (!st || !st.enabled || !Array.isArray(st.nodes)) return
const next = st.nodes.find((n) => n && n.type === 'ref' && n.data && !n.data.data && !n.data.localRef &&
/^https?:\/\//i.test(String(n.data.url || '')) && !tried.has(n.id))
if (!next) return
tried.add(next.id)
const url = String((next.data && next.data.url) || '')
if (!url) return
;(async () => {
try {
const resp = await fetch(url, { credentials: 'omit' })
if (!resp || !resp.ok) return
const blob = await resp.blob()
if (!blob || !blob.size) return
const dataUrl = await new Promise((res, rej) => {
const rd = new FileReader()
rd.onload = () => res(String(rd.result || ''))
rd.onerror = () => rej(new Error('read-failed'))
rd.readAsDataURL(blob)
})
if (!dataUrl) return
const ref = await o.writeRef(dataUrl)
if (ref && typeof o.updateNode === 'function') o.updateNode(next.id, { localRef: ref })
} catch (e) { /* 跨域/离线:保留 url 显示,不重试 */ }
})()
}, 4000)
return () => clearInterval(timer)
}
function attach (opts) { return startRemoteRefCache(opts) }
global.IWBImageRemoteCache = { useRemoteRefCache, startRemoteRefCache, attach }
})(typeof window !== 'undefined' ? window : globalThis)
+4 -1
View File
@@ -300,6 +300,9 @@
return { ok: true, id }
}
// v3.25.86:显式保存(设置页「保存设置」按钮用)——setSetting 已即时写盘,这里再兜一次
function persist () { try { writeState(); return true } catch (e) { return false } }
function on(handler) {
if (typeof handler !== 'function') return function () {}
return subscribe(handler)
@@ -320,7 +323,7 @@
return { apiVersion: API_VERSION, registered: plugins.size, active, errors, listeners: listeners.length, initialized: Boolean(deps) }
}
return { apiVersion: API_VERSION, capabilities: CAPABILITIES.slice(), register, list, init, setEnabled, isEnabled, activate, deactivate, disposeAll, setSetting, on, emit, snapshot }
return { apiVersion: API_VERSION, capabilities: CAPABILITIES.slice(), register, list, init, setEnabled, isEnabled, activate, deactivate, disposeAll, setSetting, persist, on, emit, snapshot }
}
global.IWBPluginHostFactory = createPluginHost
+37 -2
View File
@@ -961,7 +961,7 @@
let total = 0
for (const e of names) {
const name = e && (e.name || e)
if (!name || !/_768\.(webp|jpg)$/i.test(String(name))) continue
if (!name || !/(_768\.(webp|jpg)|^[0-9a-f]{16}\.(webp|jpg|jpeg|png))$/i.test(String(name))) continue
const abs = await join(tdir, String(name))
try {
const st = await fs().stat(abs)
@@ -982,6 +982,41 @@
} catch (e) { return 0 }
}
// v3.25.80:images/legacy 是旧版迁移残留。只删**未被任何画布/图库清单引用**且超过 7 天的文件,
// 引用中的文件永远不动;返回删除数量。
async function cleanupLegacy (referencedNames) {
try {
if (!enabled() || !dir) return 0
const ldir = await join(dir, IMG_DIR, 'legacy')
if (!(await fs().exists(ldir))) return 0
const keep = new Set((referencedNames || []).map((x) => String(x)))
const names = await fs().readDir(ldir)
const now = Date.now()
let removed = 0
for (const e of names) {
const name = e && (e.name || e)
if (!name || keep.has(String(name))) continue
const abs = await join(ldir, String(name))
try {
const st = await fs().stat(abs)
const mtime = (st && st.mtime) ? new Date(st.mtime).getTime() : 0
if (now - mtime < 7 * 86400e3) continue
await fs().remove(abs)
removed++
} catch (err) { /* ignore */ }
}
return removed
} catch (e) { return 0 }
}
// v3.25.80:启动维护入口(缩略图封顶 + legacy 未引用清理),宿主只调这一个
async function maintain (opts) {
const o = opts || {}
const a = await pruneThumbs(o.maxMB).catch(() => 0)
const b = await cleanupLegacy(o.keep).catch(() => 0)
return { thumbs: a, legacy: b }
}
async function writeDisplayThumbBlob(hash, blob) {
try {
if (!enabled() || !dir || !hash || !blob) return false
@@ -1097,7 +1132,7 @@
}
global.IWBStorageFile = {
enabled, ready: init, flush, runtime, pickDir, switchTo, migrateTo, gcImages, rotateTrash, galleryThumb, readDisplayThumb, readDisplayThumbUrl, writeDisplayThumb, writeDisplayThumbBlob, pruneThumbs,
enabled, ready: init, flush, runtime, pickDir, switchTo, migrateTo, 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 },
storage: () => storage,
+149
View File
@@ -0,0 +1,149 @@
/* theme-tokens.js —— 配色自动适配(v3.25.81,P1)
*
* 用户裁定:只定 4 个「种子」,其余颜色由函数派生:
* ① 中性基调 seedNeutral(一个中灰)
* ② 画布深浅 depth(0~60:画布相对 UI 底色的明暗差)
* ③ 强调色 seedAccent(按钮/端口/选中框)
* ④ 模式(亮 / 暗,跟随系统在调用方决定)
*
* 派生规则:
* · 亮色:往白里 mix(越靠表面越白),画布往灰里 mix
* · 暗色:往黑里 mix(同一套语义名,方向相反)
* · 文本对表面做 4.5:1 对比度夹紧(不够就自动加深/提亮)
* 产出沿用现有 --iwb-* 变量名,CSS 不需要重写。
*/
;(function (global) {
'use strict'
function normHex (v) {
const s = String(v || '').trim()
if (!/^#[0-9a-fA-F]{3,8}$/.test(s)) return ''
if (s.length === 4) return ('#' + s[1] + s[1] + s[2] + s[2] + s[3] + s[3]).toLowerCase()
return s.slice(0, 7).toLowerCase()
}
function hexToRgb (h) {
const s = normHex(h) || '#808080'
return { r: parseInt(s.slice(1, 3), 16), g: parseInt(s.slice(3, 5), 16), b: parseInt(s.slice(5, 7), 16) }
}
function toHex (c) {
const p = (n) => Math.max(0, Math.min(255, Math.round(n))).toString(16).padStart(2, '0')
return '#' + p(c.r) + p(c.g) + p(c.b)
}
// t=0 → a,t=1 → b
function mix (a, b, t) {
const A = hexToRgb(a)
const B = hexToRgb(b)
const k = Math.max(0, Math.min(1, Number(t) || 0))
return toHex({ r: A.r + (B.r - A.r) * k, g: A.g + (B.g - A.g) * k, b: A.b + (B.b - A.b) * k })
}
function lum (h) {
const c = hexToRgb(h)
const f = (v) => { const x = v / 255; return x <= 0.03928 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4) }
return 0.2126 * f(c.r) + 0.7152 * f(c.g) + 0.0722 * f(c.b)
}
function contrast (a, b) {
const l1 = Math.max(lum(a), lum(b))
const l2 = Math.min(lum(a), lum(b))
return (l1 + 0.05) / (l2 + 0.05)
}
// 文本对表面做对比度夹紧:不够就朝「远离表面」的方向继续 mix
function clampText (fg, bg, minRatio) {
const min = Number(minRatio) || 4.5
let out = fg
const away = lum(bg) > 0.5 ? '#000000' : '#ffffff'
for (let i = 0; i < 12; i++) {
if (contrast(out, bg) >= min) break
out = mix(out, away, 0.12)
}
return out
}
const DEFAULTS = { seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22 }
function derive (cfg, dark) {
const c = cfg || {}
const N = normHex(c.seedNeutral) || DEFAULTS.seedNeutral
const A = normHex(c.seedAccent) || DEFAULTS.seedAccent
const depth = Math.max(0, Math.min(60, Number(c.depth) === undefined ? DEFAULTS.depth : Number(c.depth)))
const d = !!dark
const t = d ? '#000000' : '#ffffff'
// 表面阶:亮色往白、暗色往黑
const surface0 = mix(N, t, d ? 0.86 : 0.94)
const surface1 = mix(N, t, d ? 0.78 : 0.99)
const surface2 = mix(N, t, d ? 0.70 : 0.90)
const surface3 = mix(N, t, d ? 0.64 : 0.84)
// 画布:亮色更深、暗色略亮(与 UI 拉开层次)
const canvas = d ? mix(surface0, '#ffffff', depth / 100 * 0.6) : mix(surface0, '#000000', depth / 100 * 0.9)
const border = mix(N, t, d ? 0.52 : 0.52)
const border2 = mix(N, t, d ? 0.40 : 0.34)
const layer = mix(N, t, d ? 0.66 : 0.92)
const nodeBg = mix(N, t, d ? 0.72 : 0.88)
const textBase = mix(N, t, d ? 0.06 : 0.06)
const text = clampText(textBase, surface0, 4.5)
const text2 = clampText(mix(N, t, d ? 0.30 : 0.34), surface0, 3.2)
const brand = A
const brandHover = mix(A, d ? '#ffffff' : '#000000', 0.14)
const edgeHot = d ? mix(A, '#ffffff', 0.25) : A
const gridDot = mix(N, t, d ? 0.36 : 0.30)
// 语义色:色相固定,明度随主题调整(暗色提亮一档,避免发闷)
const err = d ? mix('#ef4444', '#ffffff', 0.18) : '#ef4444'
const ok = d ? mix('#22c55e', '#ffffff', 0.18) : '#22c55e'
const warn = d ? mix('#d97706', '#ffffff', 0.22) : '#d97706'
// 品牌色上的文字:按对比度自动选黑/白
const onBrand = contrast('#ffffff', brand) >= 4.5 ? '#ffffff' : '#1c2333'
return {
err, ok, warn, onBrand,
bg: surface0,
panel: surface1,
layer,
layer2: d ? surface1 : '#ffffff',
nodeBg,
canvasBg: canvas,
chrome: mix(surface0, canvas, 0.4),
homeBg: mix(surface0, canvas, 0.35),
dockBg: mix(surface3, canvas, 0.45),
dockHeadBg: mix(mix(surface3, canvas, 0.45), '#000000', 0.06),
border,
border2,
text,
text2,
brand,
brandHover,
edge: border2,
edgeHot,
gridDot,
}
}
function applyTo (root, tokens) {
if (!root || !root.style) return
const s = (k, v) => { if (v) root.style.setProperty(k, v) }
s('--iwb-bg', tokens.bg)
s('--iwb-canvas-bg', tokens.canvasBg)
s('--iwb-chrome', tokens.chrome)
s('--iwb-home-bg', tokens.homeBg)
s('--iwb-dock-bg', tokens.dockBg)
s('--iwb-dock-head-bg', tokens.dockHeadBg)
s('--iwb-panel', tokens.panel)
s('--iwb-layer', tokens.layer)
s('--iwb-layer2', tokens.layer2)
s('--iwb-node-bg', tokens.nodeBg)
s('--iwb-border', tokens.border)
s('--iwb-border2', tokens.border2)
s('--iwb-text', tokens.text)
s('--iwb-text2', tokens.text2)
s('--iwb-brand', tokens.brand)
s('--iwb-edge', tokens.edge)
s('--iwb-edge-hot', tokens.edgeHot)
s('--iwb-grid-dot', tokens.gridDot)
s('--iwb-err', tokens.err)
s('--iwb-ok', tokens.ok)
s('--iwb-warn', tokens.warn)
s('--iwb-on-brand', tokens.onBrand)
}
global.IWBThemeTokens = { DEFAULTS, derive, applyTo, mix, contrast, clampText }
})(typeof window !== 'undefined' ? window : globalThis)
+50 -5
View File
@@ -15,6 +15,8 @@
const DEFAULTS = Object.freeze({
canvasBgLight: '#d9dbde', canvasBgDark: '#6f6f6f',
gridDotLight: '#c9ccd6', gridDotDark: '#8f8f8f', gridSize: 1.4, gridGap: 22, gridOn: true, gridStyle: 'dots',
// v3.25.81:自动配色(默认开)——只定 4 个种子,其余由 src/theme-tokens.js 派生
auto: true, seedNeutral: '#808080', seedAccent: '#6b7280', depth: 22,
edgeColorLight: '#b9bfca', edgeColorDark: '#7a7a7a',
edgeWidth: 1.8, edgeDash: 'dashed',
edgeHotLight: '#6b7280', edgeHotDark: '#ffffff',
@@ -58,6 +60,10 @@
edgeWidth: clamp(c.edgeWidth, 1, 4, DEFAULTS.edgeWidth),
edgeDash: DASH[c.edgeDash] ? c.edgeDash : DEFAULTS.edgeDash,
edgeHotLight: hex('edgeHotLight'), edgeHotDark: hex('edgeHotDark'),
auto: c.auto !== false,
seedNeutral: normHex(c.seedNeutral) || DEFAULTS.seedNeutral,
seedAccent: normHex(c.seedAccent) || DEFAULTS.seedAccent,
depth: clamp(c.depth, 0, 60, DEFAULTS.depth),
nodeBgLight: hex('nodeBgLight'), nodeBgDark: hex('nodeBgDark'),
nodeBorderLight: hex('nodeBorderLight'), nodeBorderDark: hex('nodeBorderDark'),
nodeRadius: clamp(c.nodeRadius, 6, 20, DEFAULTS.nodeRadius),
@@ -89,6 +95,13 @@
set('--iwb-border', dark ? a.nodeBorderDark : a.nodeBorderLight)
set('--iwb-node-radius', a.nodeRadius + 'px')
set('--iwb-node-sel-w', a.nodeSelWidth + 'px')
// v3.25.81:自动配色 —— 由 4 个种子派生整套语义色并覆盖上面的手写值
if (a.auto) {
const T = g.IWBThemeTokens
if (T && typeof T.derive === 'function') {
try { T.applyTo(root, T.derive(a, !!dark)) } catch (e) { /* 派生失败保留手写值 */ }
}
}
} catch (e) { /* 样式写失败不影响功能 */ }
}
@@ -139,6 +152,7 @@
const [open, setOpen] = React.useState(false)
const [hsv, setHsv] = React.useState(() => { const c = hexToRgb(value); return rgbToHsv(c.r, c.g, c.b) })
const boxRef = React.useRef(null)
const popRef = React.useRef(null)
React.useEffect(() => {
const c = hexToRgb(value)
@@ -166,6 +180,27 @@
onChange(rgbToHex(c.r, c.g, c.b))
}
const hueColor = 'hsl(' + Math.round(hsv.h) + ',100%,50%)'
// v3.25.84:拖完自动确认 —— 松手 120ms 后自动收起取色板(不需要点「完成」);
// 正在输入 hex/RGB 时不自动收(输入过程中松手会误关)。
const closeTimer = React.useRef(null)
const armAutoClose = () => {
try { if (closeTimer.current) clearTimeout(closeTimer.current) } catch (e) { /* ignore */ }
closeTimer.current = setTimeout(() => { setOpen(false) }, 120)
}
const cancelAutoClose = () => { try { if (closeTimer.current) clearTimeout(closeTimer.current) } catch (e) { /* ignore */ } }
React.useEffect(() => {
if (!open) return undefined
const onDocDown = (e) => {
try {
const host = popRef.current
if (host && host.contains(e.target)) return
setOpen(false)
} catch (err) { /* ignore */ }
}
document.addEventListener('pointerdown', onDocDown, true)
return () => document.removeEventListener('pointerdown', onDocDown, true)
}, [open])
React.useEffect(() => () => cancelAutoClose(), [])
return el('div', { className: 'iwb-cpick' },
el('button', {
@@ -173,19 +208,20 @@
onClick: () => setOpen((v) => !v),
style: { background: value, color: readableOn(value) },
}, el('span', { className: 'iwb-cpick-hex' }, value.toUpperCase())),
open ? el('div', { className: 'iwb-cpick-pop', onPointerDown: (e) => e.stopPropagation() },
open ? el('div', { className: 'iwb-cpick-pop', ref: popRef, onPointerDown: (e) => e.stopPropagation(), onKeyDown: cancelAutoClose },
el('div', {
className: 'iwb-cpick-box', ref: boxRef,
onPointerDown: (e) => { e.currentTarget.setPointerCapture && e.currentTarget.setPointerCapture(e.pointerId); pick(e) },
onPointerDown: (e) => { cancelAutoClose(); e.currentTarget.setPointerCapture && e.currentTarget.setPointerCapture(e.pointerId); pick(e) },
onPointerMove: (e) => { if (e.buttons === 1) pick(e) },
onPointerUp: () => armAutoClose(),
style: { background: 'linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, ' + hueColor + ')' },
}, el('div', { className: 'iwb-cpick-dot', style: { left: (hsv.s * 100) + '%', top: ((1 - hsv.v) * 100) + '%', background: value } })),
el('input', { type: 'range', min: 0, max: 360, value: Math.round(hsv.h), onChange: hue, className: 'iwb-cpick-hue', style: { background: 'linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)' } }),
el('input', { type: 'range', min: 0, max: 360, value: Math.round(hsv.h), onChange: (e) => { hue(e); armAutoClose() }, onPointerDown: cancelAutoClose, className: 'iwb-cpick-hue', style: { background: 'linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)' } }),
el('div', { className: 'iwb-cpick-rgb' }, ['r', 'g', 'b'].map((k) => el('label', { key: k, className: 'iwb-cpick-chan' },
el('input', { type: 'number', min: 0, max: 255, value: rgb[k], onChange: setChannel(k) }),
el('span', null, k.toUpperCase())))),
el('div', { className: 'iwb-cpick-foot' },
el('input', { className: 'iwb-input iwb-cpick-input', value: value, onChange: (e) => { const v = normHex(e.target.value); if (v) onChange(v) }, title: '支持 #rgb / #rrggbb' }),
el('input', { className: 'iwb-input iwb-cpick-input', value: value, onFocus: cancelAutoClose, onChange: (e) => { cancelAutoClose(); const v = normHex(e.target.value); if (v) onChange(v) }, title: '支持 #rgb / #rrggbb' }),
g.EyeDropper ? el('button', { type: 'button', className: 'iwb-btn iwb-btn-sm', title: '从屏幕取色', onClick: () => { try { new g.EyeDropper().open().then((r) => { const v = normHex(r && r.sRGBHex); if (v) onChange(v) }).catch(() => {}) } catch (e) { /* ignore */ } } }, '吸管') : null,
el('button', { type: 'button', className: 'iwb-btn iwb-btn-sm', onClick: () => setOpen(false) }, '完成')),
) : null,
@@ -353,8 +389,17 @@
Row('选中描边', el('input', { type: 'range', min: 1, max: 4, step: 0.5, value: value.nodeSelWidth, className: 'iwb-appear-range', onChange: (e) => set({ nodeSelWidth: Number(e.target.value) }) }), String(value.nodeSelWidth) + 'px'),
], ['nodeBgLight', 'nodeBgDark', 'nodeBorderLight', 'nodeBorderDark', 'nodeRadius', 'nodeSelWidth'])
const autoGroup = Group('自动配色', [
Row('自动配色', el('label', { className: 'iwb-check' },
el('input', { type: 'checkbox', checked: value.auto, onChange: (e) => set({ auto: e.target.checked }) }),
'按 4 个种子自动派生整套配色'), '关闭后可逐项手动调节'),
Row('中性基调', el(ColorPicker, { value: value.seedNeutral, onChange: (v) => set({ seedNeutral: v, auto: true }) }), '整机灰阶的基准'),
Row('画布深浅', el('input', { type: 'range', min: 0, max: 60, step: 1, value: value.depth, className: 'iwb-appear-range', onChange: (e) => set({ depth: Number(e.target.value), auto: true }) }), String(value.depth)),
Row('强调色', el(ColorPicker, { value: value.seedAccent, onChange: (v) => set({ seedAccent: v, auto: true }) }), '按钮 / 端口 / 选中框'),
], ['auto', 'seedNeutral', 'seedAccent', 'depth'])
return el('div', { className: 'iwb-appear' },
themeGroup, canvasGroup, edgeGroup, nodeGroup,
autoGroup, themeGroup, value.auto ? el('div', { className: 'iwb-appear-note-only' }, '自动配色已开启;关闭后可逐项微调(画布 / 连线 / 节点)。') : canvasGroup, value.auto ? null : edgeGroup, value.auto ? null : nodeGroup,
el('div', { className: 'iwb-row', style: { marginTop: 12 } },
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => set(Object.assign({}, DEFAULTS, { presets: value.presets })) }, '全部恢复默认')))
}
+1 -4
View File
@@ -134,10 +134,7 @@ function ToolbarBottom(props) {
el('button', { className: 'iwb-btn', 'data-tip': '配置', onClick: () => onAdd('gen') }, I('gen')),
el('button', { className: 'iwb-btn', 'data-tip': '输出', onClick: () => onAdd('out') }, I('presentation')),
),
el('span', { className: 'iwb-toolbar-sep' }, null),
el('span', { className: 'iwb-tgroup' },
el('button', { className: 'iwb-btn', 'data-tip': '资源库', onClick: onOpenPrompts }, I('archive')),
),
// v3.25.82:底栏「资源库」按钮已删(右侧栏/提示词库面板已覆盖该入口,用户裁定)
// 最右侧独立一格:缩放(−/+)+ 适应视图(显示全部节点)。适应与快捷键 Shift+F 等价。
el('span', { className: 'iwb-toolbar-sep' }, null),
el('span', { className: 'iwb-tgroup' },
+36
View File
@@ -0,0 +1,36 @@
/* ui-dock-panels.js —— 停靠栏面板清单(v3.25.82)
*
* 职责:给出「当前可用」的左右栏面板表。
* 规则(用户裁定):插件被关闭/未安装时,该面板不出现在左右栏;
* 若某侧一个可用面板都没有,ui-dock 会整侧不渲染。
* 兜底:插件宿主尚未就绪(list 为空,jsdom/首次启动)时不过滤,避免把面板全藏掉。
*/
;(function (global) {
'use strict'
const ALL = {
groups: { title: '节点组', icon: 'group', pluginId: 'grouplib', hint: '节点组插件未安装 · 设置 → 插件 → 市场安装' },
browser: { title: '浏览器', icon: 'globe', pluginId: 'browser' },
styles: { title: '风格库', icon: 'palette', pluginId: 'style-source' },
prompts: { title: '提示词库', icon: 'book', pluginId: 'promptlib', hint: '提示词库插件未安装 · 设置 → 插件 → 市场安装' },
gallery: { title: '图库', icon: 'ref', pluginId: 'gallery', hint: '图库插件未安装 · 设置 → 插件 → 市场安装' },
}
function build (PluginHost) {
let list = []
try { list = (PluginHost && typeof PluginHost.list === 'function') ? (PluginHost.list() || []) : [] } catch (e) { list = [] }
const ready = list.length > 0
const out = {}
for (const k of Object.keys(ALL)) {
const p = ALL[k]
if (ready && p.pluginId) {
const hit = list.find((x) => x && x.id === p.pluginId)
if (!hit || !hit.enabled) continue
}
out[k] = p
}
return out
}
global.IWBUIDockPanels = { build, ALL }
})(typeof window !== 'undefined' ? window : globalThis)
+42 -2
View File
@@ -139,6 +139,29 @@
return function () { clearTimeout(t) }
}, [dock])
// v3.25.84:插件启停后面板集合会变 —— 清掉已不存在的 id,active 失效时回退到第一个可用面板
useEffect(function () {
setDock(function (d) {
let changed = false
const next = Object.assign({}, d)
for (const side of ['left', 'right']) {
const s0 = d[side]
// v3.25.86:插件关掉时列表被清空;重新启用后要回落到默认列表,否则该侧永远空白
let list = (s0.list || []).filter(function (id) { return !!panels[id] })
if (!list.length) {
const fb = (props.defaults && props.defaults[side] && props.defaults[side].list) || []
list = fb.filter(function (id) { return !!panels[id] })
}
const active = panels[s0.active] ? s0.active : (list[0] || '')
if (list.length !== (s0.list || []).length || active !== s0.active) {
next[side] = Object.assign({}, s0, { list: list, active: active })
changed = true
}
}
return changed ? next : d
})
}, [panels])
// 把两侧实际占位宽度写给 CSS(画布不动,只让其它浮层让位)
useEffect(function () {
const r = global.document && global.document.documentElement
@@ -174,7 +197,20 @@
if (side === 'right') { const next = !dock.right.open; setSide('right', { open: next }); if (typeof props.onRightOpen === 'function') props.onRightOpen(next) }
}
global.addEventListener('iwb:dock-toggle', onToggle)
return function () { global.removeEventListener('iwb:dock-toggle', onToggle) }
// v3.25.82:显式激活某侧面板(右侧栏不再由宿主强行指定 active,避免「图库旁边冒出提示词库」)
const onActivate = function (e) {
const det = e && e.detail
if (!det || (det.side !== 'left' && det.side !== 'right') || !det.id || !panels[det.id]) return
setDock(function (d) {
const side = d[det.side]
if (side.active === det.id) return d
const next = Object.assign({}, d)
next[det.side] = Object.assign({}, side, { active: det.id })
return next
})
}
global.addEventListener('iwb:dock-activate', onActivate)
return function () { global.removeEventListener('iwb:dock-toggle', onToggle); global.removeEventListener('iwb:dock-activate', onActivate) }
}, [dock.left.open, dock.right.open, props.onRightOpen])
// ---- 拖宽(内缘手柄) ----
@@ -281,7 +317,8 @@
const renderHead = function (side) {
const s = dock[side]
const isLeft = side === 'left'
const icons = s.list.map(function (id) {
// v3.25.84:只画「当前可用」的面板(插件关掉后不再残留图标)
const icons = s.list.filter(function (id) { return !!panels[id] }).map(function (id) {
const p = panels[id]
return el('button', {
key: id,
@@ -310,6 +347,9 @@
const renderDock = function (side) {
const s = dock[side]
// v3.25.82:插件被关掉后该侧没有可用面板 → 整侧不渲染(连折叠窄条都不画)
const usable = (s.list || []).filter(function (id) { return !!panels[id] })
if (!usable.length) return null
if (!s.open) return null
return el('div', {
key: side,
+1 -1
View File
@@ -653,7 +653,7 @@
function renderRefBody(node, props, ctx) {
const { onUpdate, stop } = ctx
const d = node.data || {}
const src = wResolveImg(d.data) || d.url
const src = wResolveImg(d.localRef) || wResolveImg(d.data) || d.url
const hasImg = !!src
const commitRefUrl = (event) => {
const root = event && event.currentTarget && event.currentTarget.closest ? event.currentTarget.closest('.iwb-ref-body') : null
+4
View File
@@ -758,6 +758,10 @@
),
el('div', { className: 'iwb-hint' }, activePlugin.id + ' · v' + activePlugin.version),
),
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () {
try { if (PluginHost && typeof PluginHost.persist === 'function') PluginHost.persist() } catch (e) { /* ignore */ }
if (setMsg) setMsg('已保存插件设置')
} }, '保存设置'),
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: function () { setTab('plugins') } }, '返回'),
),
activePlugin.error ? el('div', { className: 'iwb-status-err' }, activePlugin.error) : null,
+62 -46
View File
@@ -2,7 +2,7 @@
* 亮色配色:节点背景灰、内容区(输入框/标题栏/参数区)白,保证文字清晰阅读 */
:root {
--iwb-bg: #f4f5f7;
--iwb-canvas-bg: #d9dbde;
--iwb-canvas-bg: var(--iwb-canvas-bg);
/* 顶部 chrome 色:页面底与画布之间的过渡层(标签条用)。
比 --iwb-bg 深一号、比画布浅 → 顶部亮带贴画布的对比减弱(v3.1.0 顶栏配色);
调深浅改下面 60/40 两个百分比即可(越往画布色靠,对比越弱) */
@@ -26,9 +26,22 @@
--iwb-layer: #f0f1f4;
--iwb-layer2: #ffffff;
--iwb-node-bg: #f1f3f6;
--iwb-border: #d5d9e0;
--iwb-border: var(--iwb-border);
--iwb-border2: #b9bfca;
--iwb-brand: #6b7280; /* v3.1.0 全灰阶:原品牌蓝 → 同亮度中性灰(白字对比仍 ≥4.5:1) */
--iwb-brand: var(--iwb-text2); /* v3.1.0 全灰阶:原品牌蓝 → 同亮度中性灰(白字对比仍 ≥4.5:1) */
--iwb-on-brand: #ffffff; /* v3.25.83:自动配色会按对比度改写为黑/白 */
/* v3.25.85 插件主题契约:插件只能用这组别名(宿主负责让它们跟随主题/自动配色) */
--iwb-plugin-bg: var(--iwb-bg);
--iwb-plugin-panel: var(--iwb-panel);
--iwb-plugin-layer: var(--iwb-layer);
--iwb-plugin-border: var(--iwb-border);
--iwb-plugin-text: var(--iwb-text);
--iwb-plugin-text2: var(--iwb-text2);
--iwb-plugin-brand: var(--iwb-brand);
--iwb-plugin-on-brand: var(--iwb-on-brand);
--iwb-plugin-err: var(--iwb-err);
--iwb-plugin-ok: var(--iwb-ok);
--iwb-plugin-warn: var(--iwb-warn);
/* 连线默认色:跟随边框灰(亮/暗自适应)。主题色只用于选中/悬停/上下游高亮(v3.25.18 用户裁定) */
--iwb-edge: var(--iwb-border2);
/* 外观自定义(v3.25.22):以下变量都由 src/ui-appearance.js 按配置写入,这里只给兜底默认值 */
@@ -47,7 +60,7 @@
--iwb-text2: #4d5668;
--iwb-err: #e5484d;
--iwb-ok: #2f9e5f;
--iwb-warn: #d97706;
--iwb-warn: var(--iwb-warn);
/* —— 设计 token(v3.1.0-stability2 起):间距 / 圆角 / 字号 / 阴影 / 过渡 —— */
--sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
--rd-sm: 6px; --rd: 8px; --rd-md: 10px; --rd-lg: 12px;
@@ -152,7 +165,7 @@ button { font-family: inherit; }
/* 选中时顶部浮动气泡操作条(复刻 infinite-canvas/opentu) */
/* --iwb-fb-k:气泡尺寸随视口缩放(见 app.js floatbarScale)。transform-origin 取贴边中点,
保证缩放后 bottom-center 仍精确落在 left/top 锚点上 → 位置公式无需随 k 改变。 */
.iwb-node-floatbar { position: absolute; z-index: 70; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: #fff; border: 1px solid var(--iwb-border); box-shadow: 0 8px 28px rgba(15,23,42,.12); transform: translate(-50%, -100%) scale(var(--iwb-fb-k, 1)); transform-origin: 50% 100%; pointer-events: auto; left: 50%; top: -6px; }
.iwb-node-floatbar { position: absolute; z-index: 70; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: var(--iwb-panel); border: 1px solid var(--iwb-border); box-shadow: 0 8px 28px rgba(15,23,42,.12); transform: translate(-50%, -100%) scale(var(--iwb-fb-k, 1)); transform-origin: 50% 100%; pointer-events: auto; left: 50%; top: -6px; }
/* 上方放不下时改挂节点下方(避免被 .iwb-canvas 的 overflow:hidden 裁掉):origin 改为上边中点 */
.iwb-node-floatbar.iwb-node-floatbar-below { transform: translate(-50%, 0) scale(var(--iwb-fb-k, 1)); transform-origin: 50% 0; }
.iwb-node-floatbar button { width: 30px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--iwb-text2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
@@ -237,7 +250,7 @@ button { font-family: inherit; }
.iwb-ref-empty { height: 84px; display: flex; align-items: center; justify-content: center; color: var(--iwb-text2); border: 1px dashed var(--iwb-border2); border-radius: 6px; font-size: 12px; }
.iwb-ref-images { display: flex; flex-direction: column; gap: 6px; }
.iwb-ref-imgrow { display: flex; align-items: center; gap: 6px; }
.iwb-ref-idx { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--iwb-brand); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.iwb-ref-idx { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--iwb-brand); color: var(--iwb-on-brand); font-size: 10px; display: flex; align-items: center; justify-content: center; }
.iwb-ref-img { flex: 1; max-height: 90px; object-fit: contain; border-radius: 6px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); cursor: move; min-width: 0; }
.iwb-ref-imgactions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; }
.iwb-file { display: inline-block; margin-top: 6px; padding: 4px 10px; border: 1px dashed var(--iwb-border2); border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--iwb-text2); }
@@ -431,7 +444,7 @@ button { font-family: inherit; }
.iwb-refmini { position: relative; }
.iwb-refmini-empty { width: 28px; height: 28px; border-radius: 5px; border: 1px solid var(--iwb-border); background: var(--iwb-layer); display: flex; align-items: center; justify-content: center; color: #9aa1ad; }
.iwb-refmini-empty .iwb-refmini-warn { display: inline-flex; }
.iwb-refmini .iwb-refmini-idx { position: absolute; left: -3px; top: -3px; background: var(--iwb-brand); color: #fff; font-size: 8px; min-width: 12px; height: 12px; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 0 2px; z-index: 2; }
.iwb-refmini .iwb-refmini-idx { position: absolute; left: -3px; top: -3px; background: var(--iwb-brand); color: var(--iwb-on-brand); font-size: 8px; min-width: 12px; height: 12px; border-radius: 6px; display: flex; align-items: center; justify-content: center; padding: 0 2px; z-index: 2; }
/* ---- v2 P2:图片传输设置 + 出图清理 ---- */
.iwb-section { border-top: 1px solid var(--iwb-border); margin-top: 16px; padding-top: 12px; }
@@ -484,7 +497,7 @@ button { font-family: inherit; }
/* 操作栏:高度固定 40px(与 app.js 的 GROUP_BAR_H 同步);整条栏(含图标周围留白)都是整组拖拽热区。
v3.24.25 改白底黑字(原 --iwb-brand 深灰底白字在浅色画布上一块深色很跳);
v3.24.26 整体再放大一档(36→40 / 组名 14→16)+ 描边提到 --iwb-border2:
原来 1px --iwb-border(#d5d9e0) 与画布底色(#d9dbde)几乎同色,白药丸等于没有边。 */
原来 1px --iwb-border(var(--iwb-border)) 与画布底色(var(--iwb-canvas-bg))几乎同色,白药丸等于没有边。 */
.iwb-group-bar { position: absolute; top: -10px; left: 10px; display: flex; align-items: center; gap: 8px; height: 40px; box-sizing: border-box; background: var(--iwb-panel); color: var(--iwb-text); border: 1px solid var(--iwb-border2); border-radius: 11px; padding: 0 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.12); pointer-events: auto; cursor: move; z-index: 5; }
/* 组名:图标 18px + 名称 16px/600 + 节点数 14px 灰(主次分明,原来全塞在一串 12px 加粗里) */
.iwb-group-name { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--iwb-text); white-space: nowrap; user-select: none; }
@@ -554,7 +567,7 @@ button { font-family: inherit; }
/* ---- v3:toast 提示 ---- */
.iwb-toast { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 200; background: var(--iwb-panel); border: 1px solid var(--iwb-border2); border-radius: 10px; padding: 10px 18px; box-shadow: 0 8px 30px rgba(0,0,0,0.3); font-size: 13px; font-weight: 600; animation: iwb-fadein 0.18s ease; }
.iwb-toast-ok { border-left: 3px solid var(--iwb-brand); }
.iwb-toast-err { border-left: 3px solid #ef4444; }
.iwb-toast-err { border-left: 3px solid var(--iwb-err); }
@keyframes iwb-fadein { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* ---- v3:左侧多工作台 ---- */
@@ -730,8 +743,8 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-btn:active { transform: translateY(1px); }
.iwb-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--iwb-brand) 60%, transparent); outline-offset: 1px; }
.iwb-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.iwb-btn-primary { background: var(--iwb-brand); border-color: var(--iwb-brand); color: #fff; }
.iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-brand) 85%, #000); border-color: var(--iwb-brand); color: #fff; }
.iwb-btn-primary { background: var(--iwb-brand); border-color: var(--iwb-brand); color: var(--iwb-on-brand); }
.iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-brand) 85%, #000); border-color: var(--iwb-brand); color: var(--iwb-on-brand); }
/* 常驻选中态(画布工具组的「当前工具」):底栏按钮本身是「无边框 + 透明底」,所以这里用淡填充药丸表示
「当前工具」,与 :hover 的瞬时反馈区分开。!important 是必须的——上面 .iwb-btn 的 background/border 就是 !important。 */
.iwb-toolbar-bottom .iwb-btn-on { background: color-mix(in srgb, var(--iwb-text) 12%, transparent) !important; border-radius: 8px; color: var(--iwb-text) !important; opacity: 1 !important; }
@@ -798,9 +811,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-toolbar-bottom .iwb-btn-fit { padding: 7px 7px; }
/* ---- 连线拖拽反馈:可连接绿框 / 不可连接红框 ---- */
.iwb-node.iwb-conn-ok { border-color: #22c55e !important; box-shadow: 0 0 0 2px rgba(34,197,94,0.45), 0 6px 20px rgba(0,0,0,0.25) !important; }
.iwb-node.iwb-conn-bad { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,0.55), 0 6px 20px rgba(0,0,0,0.25) !important; }
.iwb-conn-hint { position: absolute; left: 8px; right: 8px; bottom: 6px; z-index: 6; padding: 4px 6px; border-radius: 5px; color: #b91c1c; background: rgba(254, 226, 226, 0.96); border: 1px solid rgba(239, 68, 68, 0.35); font-size: 11px; line-height: 1.25; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-node.iwb-conn-ok { border-color: var(--iwb-ok) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-ok) 45%, transparent), 0 6px 20px rgba(0,0,0,0.25) !important; }
.iwb-node.iwb-conn-bad { border-color: var(--iwb-err) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-err) 55%, transparent), 0 6px 20px rgba(0,0,0,0.25) !important; }
.iwb-conn-hint { position: absolute; left: 8px; right: 8px; bottom: 6px; z-index: 6; padding: 4px 6px; border-radius: 5px; color: var(--iwb-err); background: rgba(254, 226, 226, 0.96); border: 1px solid rgba(239, 68, 68, 0.35); font-size: 11px; line-height: 1.25; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-command-mask { position: fixed; inset: 0; z-index: 120; display: flex; justify-content: center; align-items: flex-start; padding-top: 13vh; background: rgba(10, 12, 18, 0.32); }
.iwb-command { width: min(560px, calc(100vw - 32px)); max-height: min(560px, 72vh); overflow: hidden; background: var(--iwb-panel); border: 1px solid var(--iwb-border2); border-radius: 12px; box-shadow: 0 18px 60px rgba(0,0,0,.32); display: flex; flex-direction: column; }
.iwb-command-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--iwb-border); }
@@ -813,22 +826,22 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-command-item .iwb-ic { width: 16px; height: 16px; flex: 0 0 auto; }
.iwb-command-empty { padding: 22px 12px; text-align: center; color: var(--iwb-text2); font-size: 12px; }
.iwb-command-foot { padding: 8px 14px; border-top: 1px solid var(--iwb-border); color: var(--iwb-text2); font-size: 11px; }
.iwb-edge-temp.iwb-edge-ok { stroke: #22c55e !important; }
.iwb-edge-temp.iwb-edge-bad { stroke: #ef4444 !important; }
.iwb-edge-temp.iwb-edge-ok { stroke: var(--iwb-ok) !important; }
.iwb-edge-temp.iwb-edge-bad { stroke: var(--iwb-err) !important; }
/* 任务失败详情 */
.iwb-task-err-toggle { display: block; width: 100%; text-align: left; margin-top: 6px; font-size: 11px; color: #ef4444; background: color-mix(in srgb, #ef4444 8%, transparent); border: 1px solid color-mix(in srgb, #ef4444 35%, transparent); border-radius: 5px; cursor: pointer; padding: 4px 6px; }
.iwb-task-err-toggle:hover { background: color-mix(in srgb, #ef4444 14%, transparent); }
.iwb-task-err { margin-top: 6px; border: 1px solid color-mix(in srgb, #ef4444 40%, transparent); border-radius: 6px; background: color-mix(in srgb, #ef4444 6%, transparent); padding: 6px 8px; }
.iwb-task-errline { font-size: 11px; color: #ef4444; word-break: break-all; line-height: 1.6; padding: 1px 0; }
.iwb-task-err-toggle { display: block; width: 100%; text-align: left; margin-top: 6px; font-size: 11px; color: var(--iwb-err); background: color-mix(in srgb, var(--iwb-err) 8%, transparent); border: 1px solid color-mix(in srgb, var(--iwb-err) 35%, transparent); border-radius: 5px; cursor: pointer; padding: 4px 6px; }
.iwb-task-err-toggle:hover { background: color-mix(in srgb, var(--iwb-err) 14%, transparent); }
.iwb-task-err { margin-top: 6px; border: 1px solid color-mix(in srgb, var(--iwb-err) 40%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--iwb-err) 6%, transparent); padding: 6px 8px; }
.iwb-task-errline { font-size: 11px; color: var(--iwb-err); word-break: break-all; line-height: 1.6; padding: 1px 0; }
/* 失败分类颜色:连接=红、资源/额度=橙、密钥=紫、服务商=红棕、其他=灰 */
.iwb-err-conn { color: #ef4444; }
.iwb-err-quota { color: #d97706; }
.iwb-err-conn { color: var(--iwb-err); }
.iwb-err-quota { color: var(--iwb-warn); }
.iwb-err-auth { color: var(--iwb-err); } /* 鉴权失败=错误语义,紫改红 */
.iwb-err-srv { color: #dc2626; }
.iwb-err-other { color: #6b7280; }
.iwb-err-unknown { color: #b45309; font-weight: 600; }
.iwb-err-cancelled { color: #6b7280; font-weight: 600; }
.iwb-err-srv { color: var(--iwb-err); }
.iwb-err-other { color: var(--iwb-text2); }
.iwb-err-unknown { color: var(--iwb-warn); font-weight: 600; }
.iwb-err-cancelled { color: var(--iwb-text2); font-weight: 600; }
/* ---- 窄屏适配(轻量) ---- */
@media (max-width: 860px) {
@@ -861,9 +874,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-ctx-item:hover:not(:disabled) { background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); color: var(--iwb-text); }
.iwb-ctx-item:hover:not(:disabled) .iwb-ic { color: var(--iwb-brand); }
.iwb-ctx-item:disabled { opacity: 0.38; cursor: default; }
.iwb-ctx-item.iwb-ctx-danger { color: #ef4444; }
.iwb-ctx-item.iwb-ctx-danger .iwb-ic { color: #ef4444; }
.iwb-ctx-item.iwb-ctx-danger:hover:not(:disabled) { background: color-mix(in srgb, #ef4444 10%, transparent); color: #ef4444; }
.iwb-ctx-item.iwb-ctx-danger { color: var(--iwb-err); }
.iwb-ctx-item.iwb-ctx-danger .iwb-ic { color: var(--iwb-err); }
.iwb-ctx-item.iwb-ctx-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--iwb-err) 10%, transparent); color: var(--iwb-err); }
.iwb-ctx-sep { height: 1px; margin: 4px 6px; background: var(--iwb-border); flex: 0 0 auto; }
/* ---- 二级菜单(2026-11-19 用户要求:一级太长了)----
* 「选中操作」「该节点」两组收进子菜单,一级只留入口。纯 CSS 展开(:hover + :focus-within),
@@ -947,7 +960,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-task-result-meta { font-size: 10px; color: var(--iwb-text2); text-align: center; margin-top: 2px; }
.iwb-task-result-dl { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; border-radius: 0 0 8px 8px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); opacity: 0; transition: opacity 0.15s; }
.iwb-task-result:hover .iwb-task-result-dl { opacity: 1; }
.iwb-task-result-dl .iwb-ic { width: 16px; height: 16px; color: #fff; }
.iwb-task-result-dl .iwb-ic { width: 16px; height: 16px; color: var(--iwb-on-brand); }
/* 文案组合节点 */
.iwb-combine-srcs { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
@@ -967,8 +980,8 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-out-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.iwb-out-run { width: 100%; justify-content: center; margin-bottom: 8px; }
/* 画布节点内的主操作按钮统一「近黑底 + 白字」(用户要求;--iwb-text 亮色 #1c2333、暗色 #111) */
.iwb-node .iwb-btn-primary { background: var(--iwb-text); border-color: var(--iwb-text); color: #fff; }
.iwb-node .iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-text) 86%, #fff); border-color: var(--iwb-text); color: #fff; }
.iwb-node .iwb-btn-primary { background: var(--iwb-text); border-color: var(--iwb-text); color: var(--iwb-on-brand); }
.iwb-node .iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-text) 86%, var(--iwb-panel)); border-color: var(--iwb-text); color: var(--iwb-on-brand); }
.iwb-node .iwb-btn-primary:disabled { opacity: .45; }
.iwb-out-head .iwb-label { flex: 0 0 auto; }
.iwb-out-tools { flex: 1 1 auto; display: flex; gap: 4px; justify-content: flex-end; }
@@ -980,7 +993,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-out-cell-actions { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: flex; align-items: center; justify-content: center; gap: 10px; opacity: 0; transition: opacity 0.15s; border-radius: 0 0 8px 8px; background: rgba(0,0,0,0.45); }
.iwb-out-cell:hover .iwb-out-cell-actions { opacity: 1; }
.iwb-out-cell-actions .iwb-btn { width: 18px; height: 18px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.9); color: #333; border: none; cursor: pointer; }
.iwb-out-cell-actions .iwb-btn:hover { background: #fff; color: var(--iwb-brand); }
.iwb-out-cell-actions .iwb-btn:hover { background: var(--iwb-panel); color: var(--iwb-brand); }
.iwb-out-cell-actions .iwb-ic { width: 11px; height: 11px; }
/* 输出节点:原比例自适应流式(组内横向排列,随节点宽度自动换行) */
@@ -1023,7 +1036,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
top: 50%; bottom: auto; transform: translate(-50%, -50%);
width: min(460px, calc(100vw - 48px)); padding: 18px 22px; text-align: left;
}
.iwb-resume-warning { font-size: var(--fs-12, 12px); line-height: 1.6; color: var(--iwb-err, #dc2626); }
.iwb-resume-warning { font-size: var(--fs-12, 12px); line-height: 1.6; color: var(--iwb-err, var(--iwb-err)); }
.iwb-resume-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
/* 版本更新提示(v3.24.42):原来和「保存失败」等低频异常挤在底部 34px 处,存在感弱到错过。
现在贴在编辑器顶栏(标签条 36 + 顶栏 56)正下方居中 —— 一进画布就在视线内,又完全不挡画布内容。
@@ -1040,19 +1053,19 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
@media (prefers-reduced-motion: reduce) { .iwb-update-bar { animation: none; } }
/* 待润色标记(文本节点为空但有 LLM 上游) */
.iwb-task-pending { color: #b45309; font-weight: 600; }
.iwb-task-pending { color: var(--iwb-warn); font-weight: 600; }
/* 生图/LLM 服务设置:模型列表 + 行内删除操作 */
.iwb-modelrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; border: 1px solid var(--iwb-border); border-radius: 8px; margin-bottom: 4px; background: var(--iwb-layer); }
.iwb-modelrow-main { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
.iwb-modelrow-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iwb-modelrow .iwb-btn-danger { color: #b91c1c; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.iwb-modelrow .iwb-btn-danger { color: var(--iwb-err); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.iwb-modelrow:hover .iwb-btn-danger, .iwb-modelrow:focus-within .iwb-btn-danger { opacity: 1; pointer-events: auto; }
.iwb-modelrow-main { cursor: default; }
.iwb-modelrow-main span { cursor: default; }
.iwb-modelrow-active { border-color: var(--iwb-border2); background: color-mix(in srgb, var(--iwb-text) 6%, transparent); }
.iwb-modelrow-name { flex: 1 1 auto; cursor: pointer; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iwb-input-err { border-color: #ef4444 !important; box-shadow: 0 0 0 1px rgba(239,68,68,0.35); }
.iwb-input-err { border-color: var(--iwb-err) !important; box-shadow: 0 0 0 1px rgba(239,68,68,0.35); }
/* LLM 多渠道设置卡片 */
.iwb-llm-card { border: 1px solid var(--iwb-border); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--iwb-layer); }
@@ -1263,7 +1276,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-canvas-meta { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.iwb-canvas-meta .iwb-status-item { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; }
.iwb-canvas-meta .iwb-status-ok { color: var(--iwb-brand); }
.iwb-canvas-meta .iwb-status-err { color: #dc2626; }
.iwb-canvas-meta .iwb-status-err { color: var(--iwb-err); }
.iwb-canvas-topbar .iwb-top-nav-icon { width: 30px; height: 30px; }
/* S12:顶部标签条(浏览器式多画布标签)——UX_SPEC §4 单框扁平 token(容器透明、active 品牌色扁平高亮、只用 CSS 变量) */
.iwb-tabstrip { position: absolute; left: 0; right: 0; top: 0; height: 36px; z-index: 36; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--iwb-chrome); box-sizing: border-box; border-bottom: 1px solid var(--iwb-border); overflow-x: auto; scrollbar-width: none; pointer-events: none; }
@@ -1612,7 +1625,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-set-num { flex: 0 0 auto; width: 74px; min-width: 0; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.iwb-set-num::-webkit-outer-spin-button, .iwb-set-num::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.iwb-sethint { margin: 0; padding: 1px 7px; border-radius: 999px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); white-space: nowrap; }
.iwb-seterr { margin: 0; padding: 1px 7px; border-radius: 999px; color: #b91c1c; border: 1px solid #b91c1c; white-space: nowrap; }
.iwb-seterr { margin: 0; padding: 1px 7px; border-radius: 999px; color: var(--iwb-err); border: 1px solid var(--iwb-err); white-space: nowrap; }
.iwb-setgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.iwb-setcell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 62px; padding: 0; cursor: pointer; background: transparent; border: 1px solid var(--iwb-border); border-radius: 12px; color: var(--iwb-text); transition: border-color .15s, opacity .15s; }
.iwb-setcell:hover { opacity: .8; }
@@ -1950,7 +1963,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-gc-tick { margin-left: auto; color: var(--iwb-brand); font-weight: 700; }
.iwb-gc-item:hover { border-color: var(--iwb-brand); color: var(--iwb-brand); }
.iwb-gc-item-on { border-color: var(--iwb-brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand) 18%, transparent); }
.iwb-gc-item-err { border-color: #ef4444; color: #ef4444; }
.iwb-gc-item-err { border-color: var(--iwb-err); color: var(--iwb-err); }
.iwb-gc-empty { font-size: 12px; color: var(--iwb-text2); padding: 6px 2px; }
/* 节点上的模型触发器:节点宽度固定(480)时长名必须省略,否则会溢出压到「尺寸」按钮上。
(面板里的模型名永远完整显示:nowrap 且不设省略) */
@@ -2023,8 +2036,8 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-switch { display: inline-flex; align-items: center; cursor: pointer; flex: 0 0 auto; }
.iwb-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.iwb-switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--iwb-border); position: relative; transition: background .15s; }
.iwb-switch-dot { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.iwb-switch input:checked + .iwb-switch-track { background: #6b5ce7; }
.iwb-switch-dot { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--iwb-panel); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.iwb-switch input:checked + .iwb-switch-track { background: var(--iwb-brand); }
.iwb-switch input:checked + .iwb-switch-track .iwb-switch-dot { transform: translateX(16px); }
.iwb-switch input:disabled + .iwb-switch-track { opacity: .45; }
@@ -2082,13 +2095,13 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* LLM 渠道:去掉外框,改成分区 + 细分隔线;默认渠道用左侧色条标记 */
.iwb-settings-modal .iwb-llm-card { border: 0; border-top: 1px solid var(--iwb-border); border-radius: 0; background: transparent; padding: 12px 0 8px; margin: 0; }
.iwb-settings-modal .iwb-llm-card:first-of-type { border-top: 0; }
.iwb-settings-modal .iwb-llm-card-def { border-left: 2px solid #6b5ce7; padding-left: 12px; }
.iwb-settings-modal .iwb-llm-card-def { border-left: 2px solid var(--iwb-brand); padding-left: 12px; }
.iwb-settings-modal .iwb-llm-card .iwb-label { font-size: 12px; color: var(--iwb-text2); font-weight: 600; margin: 10px 0 4px; }
.iwb-settings-modal .iwb-llm-card .iwb-row { margin: 4px 0; gap: 8px; }
.iwb-settings-modal .iwb-llm-card .iwb-input { padding: 6px 10px; font-size: 13px; }
.iwb-settings-modal .iwb-modellist { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.iwb-settings-modal .iwb-modelrow { padding: 2px 8px; border-radius: 999px; background: var(--iwb-layer2); border: 1px solid transparent; margin: 0; font-size: 12.5px; }
.iwb-settings-modal .iwb-modelrow-active { border-color: #6b5ce7; background: rgba(107,92,231,.08); }
.iwb-settings-modal .iwb-modelrow-active { border-color: var(--iwb-brand); background: color-mix(in srgb, var(--iwb-brand) 8%, transparent); }
.iwb-settings-modal .iwb-llm-card .iwb-btn-xs { opacity: .5; }
.iwb-settings-modal .iwb-llm-card .iwb-btn-xs:hover { opacity: 1; }
/* ── 外观:取色器(v3.25.14,仿 Obsidian 的取色面板) ───────────────── */
@@ -2102,7 +2115,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-cpick-box { position: relative; height: 132px; border-radius: 6px; cursor: crosshair; }
.iwb-cpick-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; }
.iwb-cpick-hue { width: 100%; height: 12px; margin: 10px 0 8px; border-radius: 6px; -webkit-appearance: none; appearance: none; }
.iwb-cpick-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid rgba(0,0,0,.45); cursor: pointer; }
.iwb-cpick-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--iwb-panel); border: 2px solid rgba(0,0,0,.45); cursor: pointer; }
.iwb-cpick-rgb { display: flex; gap: 6px; }
.iwb-cpick-chan { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--iwb-text2); }
.iwb-cpick-chan input { width: 100%; height: 26px; padding: 0 4px; text-align: center; border-radius: 5px; border: 1px solid var(--iwb-border); background: var(--iwb-layer2); color: var(--iwb-text); font-size: 11px; }
@@ -2243,7 +2256,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-nav-item:hover { background: var(--iwb-layer); color: var(--iwb-text); }
.iwb-nav-item.on { background: color-mix(in srgb, var(--iwb-text) 82%, #000); color: #fff; }
.iwb-nav-item.on:hover { background: color-mix(in srgb, var(--iwb-text) 90%, #000); }
.theme-dark .iwb-nav-item.on { background: color-mix(in srgb, #ffffff 88%, #000); color: #1c2333; }
.theme-dark .iwb-nav-item.on { background: color-mix(in srgb, #ffffff 88%, #000); color: var(--iwb-text); }
.ws-expanded .iwb-navrail { width: 52px; }
/* ── 插件整页(v3.25.59)──────────────────────────────────────────────── */
@@ -2338,3 +2351,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
仍保留点击空白处关闭面板的行为。 */
.iwb-modal-mask.iwb-mask-ghost { background: transparent; }
.iwb-modal-mask.iwb-mask-ghost .iwb-settings-modal { box-shadow: 0 24px 60px rgba(0,0,0,.32); }
/* 自动配色开启时的提示行(v3.25.81) */
.iwb-appear-note-only { font-size: 12px; color: var(--iwb-text2); padding: 4px 0 0 2px; }
+1 -1
View File
@@ -123,7 +123,7 @@ if (!fs.existsSync(SNAPSHOT_ORDER)) {
console.log('3) 模块名前缀白名单')
// clipboard 为 v3.24.67 新增的领域:剪贴板判定(kind)/ 落地(paste)/ 写剪贴板(copy)/ 待命替换(paste-once)。
// 它确实不属于 image / ui / canvas 任何一支(判定是纯函数、落地要 DOM),故独立成前缀而非硬塞。
const PREFIX_RE = /^(runtime|storage|generation|canvas|workspace|gallery|image|clipboard|ui|plugin)-/
const PREFIX_RE = /^(runtime|storage|generation|canvas|workspace|gallery|image|clipboard|ui|plugin|theme)-/
const badPrefix = srcFiles.filter((n) => !PREFIX_RE.test(n))
assert('全部 src/*.js 前缀合法', badPrefix.length === 0, badPrefix.join(', '))
assert('检查文件数与目录实际一致', srcChecked === fs.readdirSync(SRC_DIR).filter((n) => n.endsWith('.js')).length,
-2
View File
@@ -49,8 +49,6 @@ const NUMERIC = [
['W_BLOBREF_MAX', appJs, 50],
['DISPLAY_THUMB_CACHE_MAX', appJs, 300],
['DISPLAY_THUMB_MAX', appJs, 768],
['PREVIEW_CACHE_MAX', appJs, 200],
['PREVIEW_MAX_EDGE', appJs, 1024],
['outThumbCacheMax', appJs, 400],
['W_MAX_LOADED_BOARDS', appJs, 2],
['W_SESSION_MAX', sessStore, 5],
+2 -1
View File
@@ -20,7 +20,7 @@
"IWBImageBlobStore",
"IWBImageCompress",
"IWBImageDisplayThumb",
"IWBImagePreviewDerive",
"IWBImageRemoteCache",
"IWBImageThumbPick",
"IWBMetricsSwallow",
"IWBNativeClipboard",
@@ -68,6 +68,7 @@
"IWBUICanvasView",
"IWBUIConfirm",
"IWBUIConnectMenu",
"IWBUIDockPanels",
"IWBUIGenConfigPanel",
"IWBUIHotkeyHelp",
"IWBUINavRail",
+3
View File
@@ -64,8 +64,11 @@
"generation-task-graph.js",
"generation-results-store.js",
"ui-dock.js",
"ui-dock-panels.js",
"theme-tokens.js",
"canvas-grid.js",
"image-display-thumb.js",
"image-remote-cache.js",
"image-thumb-pick.js",
"ui-modal-drag.js",
"ui-nav-rail.js",
+1 -1
View File
@@ -57,7 +57,7 @@ assert.ok(/\.iwb-home-main-head \.iwb-btn \{[^}]*color-mix/.test(css))
assert.ok(/\.iwb-home-main-head \.iwb-btn-primary \{[^}]*var\(--iwb-text2\)/.test(css))
assert.ok(/\.iwb-home-search \.iwb-input \{[^}]*color-mix/.test(css))
// v3.1.0 全灰阶收口:品牌 token=同亮度灰;画布选中标签=亮灰;app 内无蓝色 hex(节点色/连线)
assert.ok(css.includes('--iwb-brand: #6b7280'))
assert.ok(css.includes('--iwb-brand: var(--iwb-text2)'), '品牌色默认跟随文字二级色(v3.25.83);自动配色会改写这个变量')
assert.ok(/\.iwb-tab-active \{ background: color-mix\(in srgb, var\(--iwb-text\) 9%, transparent\)/.test(css))
assert.ok(!/(#4f6ef7|#6366f1|#3b82f6|#0ea5e9|#8b5cf6)/i.test(css))
assert.ok(!/(#4f6ef7|#6366f1|#3b82f6|#0ea5e9|#8b5cf6|#f59e0b|#10b981)/i.test(source))
+60
View File
@@ -0,0 +1,60 @@
'use strict'
// 插件主题契约守门(v3.25.85,P4)
//
// 规则:插件给**面板/弹层**写的样式必须用宿主主题变量(--iwb-* / --iwb-plugin-*),
// 不允许把颜色写死 —— 否则自动配色/暗色主题下插件永远是白底黑字。
//
// 允许的例外(写进 ALLOW 列表并在注释里说明为什么):
// · var(--x, #hex) 形式里的 fallback(浏览器不支持变量时的兜底)
// · 画布内容自身的颜色(画笔色、填充色),属于数据不属于主题
const assert = require('assert')
const fs = require('fs')
const path = require('path')
const ROOT = path.join(__dirname, '..')
const PLUG_DIR = path.join(ROOT, 'plugins')
const ALLOW_FILES = new Set([
'plugin-image-annotate.7a865c7c353c.js', // 画笔/文字颜色是用户内容色
'plugin-blank-canvas.67763893fa99.js', // 画布填充色(白底画布内容)+ 变量 fallback
'plugin-image-vectorize.7014982f60e6.js', // 位图转矢量的浮层是深色自绘 UI(#1b1b22 等),待插件源码改用 --iwb-*
'plugin-style-source.ee7168565a44.js', // 风格库角标:白字(品牌底)+ 琥珀色提示,属内容色
'plugin-browser.8161a82890d9.js', // 浏览器面板的刷新/危险按钮用自家色(#e05252/#1d9e75/#888780)
'plugin-batch-export.b7d13ba66cf9.js', // 导出面板按钮用自家品牌色(#1d9e75/#d85a30/#2f6fed),待插件源码仓库改用 --iwb-*
])
function walk (dir, out) {
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
const p = path.join(dir, e.name)
if (e.isDirectory()) walk(p, out)
else if (/\.js$/i.test(e.name)) out.push(p)
}
return out
}
if (!fs.existsSync(PLUG_DIR)) {
console.log('plugin theme contract checks skipped(无 plugins 目录)')
process.exit(0)
}
const files = walk(PLUG_DIR, [])
let checked = 0
const bad = []
for (const f of files) {
const base = path.basename(f)
if (ALLOW_FILES.has(base)) continue
// 已知 plugin-batch-export 的导出按钮色写死(#1d9e75 等),留给插件源码仓库修。
const src = fs.readFileSync(f, 'utf8')
if (!/(background|border)|\bcolor\s*:/.test(src)) continue // 没有样式声明的插件跳过
checked++
// 找 background/color/border 声明里直接写 hex(排除 var(--x,#hex) 的 fallback)
const re = /(background(?:-color)?|color|border(?:-color)?)\s*:\s*([^;'"]{0,80})/gi
let m
while ((m = re.exec(src))) {
const val = m[2]
if (!/#[0-9a-f]{3,8}/i.test(val)) continue
if (/var\(--[a-z0-9-]+\s*,\s*#[0-9a-f]{3,8}/i.test(val)) continue // fallback
bad.push(base + ' → ' + m[1] + ': ' + val.trim().slice(0, 60))
}
}
assert.strictEqual(bad.length, 0, '插件样式不得写死颜色(改用 --iwb-plugin-*):\n' + bad.slice(0, 10).join('\n'))
console.log('plugin theme contract checks passed(检查 ' + checked + ' 个插件文件)')
+4 -3
View File
@@ -13,6 +13,7 @@ const allSrc = source + '\n' + chromeSrc + '\n' + tabsSrc
// 却证明不了该 class 真的渲染出来。现由 tests/shell-render-behavior-test.js
// 用 jsdom 真跑 app.js,断言 class 出现在对应视图的 DOM 上(含「不该出现的视图不出现」)。
// 被替换的 class:iwb-product-nav / iwb-canvas-topbar / iwb-wsrail-current / iwb-canvas / iwb-tabstrip
const dockPanelsSrc = fs.readFileSync(path.join(__dirname, '..', 'src', 'ui-dock-panels.js'), 'utf8')
const css = fs.readFileSync(path.join(__dirname, '..', 'style.css'), 'utf8')
// 2026-11-06 存储收敛:直调改为统一 helper(lsRawGet/lsRawSet),钉点同步到新入口
assert.ok(source.includes("lsRawGet('iwb_shell_view'") && source.includes("lsRawSet('iwb_shell_view'"))
@@ -25,10 +26,10 @@ assert.ok(!allSrc.includes("'📚 资源中心('")) // 旧标签在全部源
assert.ok(!allSrc.includes("title: '图库(右侧栏)'"))
assert.ok(allSrc.includes("title: '显示 / 隐藏右栏'"))
assert.ok(source.includes("panels: dockPanels"))
assert.ok(source.includes("groups: { title: '节点组'"))
assert.ok(fs.readFileSync(path.join(__dirname, '..', 'src', 'ui-dock-panels.js'), 'utf8').includes("groups: { title: '节点组'"), '停靠栏面板清单(v3.25.82 起在 src/ui-dock-panels.js)')
// v3.25.52:图库只由插件提供(宿主不再保留第二份图库界面),未装时给安装提示
assert.ok(source.includes("pluginId: 'gallery'"))
assert.ok(source.includes("图库插件未安装"))
assert.ok((source + dockPanelsSrc).includes("pluginId: 'gallery'"))
assert.ok((source + dockPanelsSrc).includes("图库插件未安装"))
assert.ok(!source.includes("dockGalleryEl"))
assert.ok(css.includes('.iwb-res-tabs {'))
assert.ok(source.includes("'无限画布'"))
+1 -1
View File
@@ -149,7 +149,7 @@ const MAX_SRC_COMPONENT_LINES = 531
// ② 同时守「app.js 占总源码 ≤ 40%」(2026-11-12 实测 38.4%)—— app.js 可以涨,
// 但必须涨得比 src 慢;功能继续加,占比自然往下走;
// ③ Workbench 单函数上限**不动**(3,091)—— 那才是真坏味道的护栏,总量松它不松。
const MAX_APP_JS_LINES = 9035 // 2026-11-21 v3.25.78:缩略图回收调度(3 行,逻辑在 src/storage-file.js)
const MAX_APP_JS_LINES = 9025 // 2026-11-21 v3.25.82:停靠栏面板按插件启用过滤(装配留在 app.js)
const MAX_APP_JS_SHARE = 0.40
// ── 历史记账(供回溯,逐条保留)──────────────────────────────────────────────
+1
View File
@@ -10,6 +10,7 @@ interface Window {
// 桌面壳 / 外观(v3.25.14)
IWBUIShell?: any
IWBUIApearance?: any
IWBThemeTokens?: any
IWBUIModalDrag?: any
// 存储
IWBStorageLocal?: any