chore: v3.26.228(测试版:输出节点下载圆钮)
This commit is contained in:
1 parent
c3bbe1a75a
commit
f948a45fcc
9 files changed
+37
-16
No files matched your search
@@ -20,6 +20,11 @@
|
||||
|
||||
- 历史条目补录:该 tag 当时未在 CHANGELOG 记录(release-records 守卫要求 tag 与条目双向一致),内容按当时提交补一句占位说明。
|
||||
|
||||
## v3.26.228(2026-12-03)输出节点下载圆钮
|
||||
|
||||
- 输出节点结果图的下载浮层从底部横条改为右下角圆形图标:只占一个角,矮图不再被横条挡住中心。
|
||||
- 只新增 .iwb-dl-corner / .iwb-dl-round 规则;容器 pointer-events:none、按钮 auto;不动 z-index、不动 token、不动图库。旧的横条样式保留可回退。
|
||||
|
||||
## v3.26.227(2026-12-03)图库一致性快修
|
||||
|
||||
- add 按 url 幂等(已存在复用、本批去重),从源头杜绝同一张图两条索引。
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
- 图片**新写入主通道 = IndexedDB Blob `{__blob}` / key `imgblob_<hash>_<len>`** (A) `app.js:2143`;`{__cache}`(Cache Storage)为兜底;\`ref_\`(`app.js` 内定义的 `IDB_REF_PREFIX = 'ref_'`)为 legacy 形态 (A)。
|
||||
- 大图判定:`isBigDataUrl` = `data:` 且 `length > 3000` (A) `app.js:2018`;**画布保存保留阈值** `< 16384` 才原样保留 (A) `app.js:2182`。**两处阈值并存,含义不同**。
|
||||
- 单测是**源码契约测试**:`tests/` 目录共 **493** 处源码文本钉点(`source.includes` / `source.indexOf` / `/re/.test(source)`),分布在 **20** 个文件(其中 `iwb-v32-web-test.js` 一个就占 **407**)→ **结构性重构会先打红测试**。**该数字已由 `tests/source-text-ratchet-test.js` 的「只减不增」棘轮守门**(2026-10-20 起守卫范围从 1 个文件扩到全目录:新增任何一处源码文本钉点都会打红)。**2026-11-12 复算**(`npm run audit:pins`,v3.24.76):二分 STRUCT **417** / NAME **76**;形态 **POS 403 / NEG 87 / COUNT 3**;难度 **易 62 / 中 316 / 难 115**。钉点减法第一批(v3.24.72)把 **537 → 505**:8 条探针钉点改为「门禁内 spec 是否真的读该计数器」、5 条改为运行时断言(生产态 `window` 上无探针)、10 条改为 DOM 断言(质量档位禁用 / 传输页无三模式按钮 / 模型项 title)、4 条改为运行时对象断言(健康检查两域、策略对象冻结)、其余 9 条有同文件 DOM 等价断言或仅剩 NEG。第二批(v3.24.76)把 **505 → 493**:94-5~7 三条「多标签释放语义」(10 处正则)换成 `tests/iwb-tabs-release.spec.js` 的 3 条真 e2e,剩 1 条「消费方契约」(断言该 spec 在门禁内且 spec 源码真的读两个探针);另 2 条 `wPurgeIntent.add` 钉点改为读 `src/workspace-purge.js`。**这一批一换就查出 3 个真缺陷**(objectURL 从未释放 / 彻底删除留孤儿标签 · session / 刷新后误回收打开标签的图)—— 见 CHANGELOG v3.24.76。
|
||||
- `app.js` = 单 IIFE **9,146 行**(**双层预算**:绝对上限 9,146 / 占总源码 ≤ 40%,现 **26.0%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,533 行**(上限 **2,533**,余量 0;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **127** 个模块 / 26,042 行,`sourceModules` 127 项;v3.24.68 新增 `clipboard-graph.js`,v3.24.74 新增 `image-admit.js`,v3.24.75 新增 `image-dedupe.js`,v3.24.76 新增 `workspace-purge.js`,v3.24.79 新增 `generation-provider-ping.js`,v3.24.80 删除无调用的 `createWBFlushViewport` 17 行)。
|
||||
- `app.js` = 单 IIFE **9,146 行**(**双层预算**:绝对上限 9,146 / 占总源码 ≤ 40%,现 **26.0%**,2026-11-12 起;此前为单一上限 8,509、零余量);`Workbench()` = **2,533 行**(上限 **2,533**,余量 0;2026-11-16 把生成取消族 `cancelRunsFor`/`cancelRun`/`cancelTaskJobs` 与工作区列表写回族 `persistWs`/`duplicateWs` 搬进 `src/runtime-workbench-logic.js`(`createCancelActions` / `createWorkspaceListActions`),并删掉全仓零调用的 `runAll`,3090 → 2,998);大量逻辑已抽到 `src/*.js`(现 **127** 个模块 / 26,045 行,`sourceModules` 127 项;v3.24.68 新增 `clipboard-graph.js`,v3.24.74 新增 `image-admit.js`,v3.24.75 新增 `image-dedupe.js`,v3.24.76 新增 `workspace-purge.js`,v3.24.79 新增 `generation-provider-ping.js`,v3.24.80 删除无调用的 `createWBFlushViewport` 17 行)。
|
||||
- 门禁:`npm run verify` = `verify:ci`(`build` → `node --check app.js` → `node --check dist/app.js` → `check-dist.js` → `lint`(ESLint 正确性规则,`src/` + `app.js`,P4-16a)→ `test:unit` → `test` → `test:facts`)+ `test:e2e` (A) `package.json`。
|
||||
|
||||
## 1.5 内存基线(2026-11-30,v3.26.115,Windows / WebView2 实测)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.26.227",
|
||||
"version": "3.26.228",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
Generated
+1
-1
@@ -2014,7 +2014,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.26.227"
|
||||
version = "3.26.228"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.26.227"
|
||||
version = "3.26.228"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.26.227",
|
||||
"version": "3.26.228",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
+11
-8
@@ -28,27 +28,30 @@
|
||||
) : null,
|
||||
)
|
||||
}
|
||||
// 共享「下载浮层」:底部渐变 + 下载(可选复制),hover/focus 才出现。
|
||||
// 图库插件是原生 DOM,用同一组 token 在插件 CSS 里复刻;宿主这里只需一个 React 组件。
|
||||
// pointer-events:浮层条本身不吃事件(否则会挡住图片点击/双击),只有悬停后按钮才可点。
|
||||
// 共享「下载浮层」:右下角圆形图标(可选复制),hover/focus 才出现。
|
||||
// 2026-12-03(用户裁定):只改输出节点这一处呈现 —— 底部横条会压住矮图的中心,改成只占右下角。
|
||||
// 约束(上一次改造踩过的坑):① 容器 pointer-events:none、只有按钮 auto;② 不改任何类名之外的 DOM 结构;
|
||||
// ③ 不动 z-index 层级表、不动 token 体系;旧的 .iwb-dl-bar 样式保留在 CSS 里可随时回退。
|
||||
function ResultDownloadOverlay (props) {
|
||||
const p = props || {}
|
||||
const stopDown = (e) => { try { e.stopPropagation() } catch (err) { /* ignore */ } }
|
||||
return el('div', { className: 'iwb-dl-ov' },
|
||||
p.children,
|
||||
el('div', { className: 'iwb-dl-bar' },
|
||||
el('div', { className: 'iwb-dl-corner' },
|
||||
p.onCopyRef ? el('button', {
|
||||
className: 'iwb-dl-btn iwb-dl-btn-ghost',
|
||||
className: 'iwb-dl-round',
|
||||
title: p.copyTitle || '插入为参考图节点',
|
||||
'aria-label': p.copyLabel || '复制',
|
||||
onPointerDown: stopDown,
|
||||
onClick: (e) => { e.stopPropagation(); p.onCopyRef() },
|
||||
}, p.copyIcon || null, el('span', { className: 'iwb-dl-txt' }, p.copyLabel || '复制')) : null,
|
||||
}, p.copyIcon || '⧉') : null,
|
||||
el('button', {
|
||||
className: 'iwb-dl-btn',
|
||||
className: 'iwb-dl-round iwb-dl-round-primary',
|
||||
title: p.downloadTitle || '下载原图',
|
||||
'aria-label': p.label || '下载',
|
||||
onPointerDown: stopDown,
|
||||
onClick: (e) => { e.stopPropagation(); if (p.onDownload) p.onDownload() },
|
||||
}, p.icon || null, el('span', { className: 'iwb-dl-txt' }, p.label || '下载')),
|
||||
}, p.icon || '↓'),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -957,6 +957,15 @@ body .iwb-history-embedded .iwb-history-item.iwb-history-selected:hover img {
|
||||
.iwb-dl-btn-ghost { background: color-mix(in srgb, var(--iwb-panel) 18%, transparent); color: var(--iwb-on-brand); border-color: color-mix(in srgb, var(--iwb-on-brand) 26%, transparent); }
|
||||
.iwb-dl-btn .iwb-ic { width: var(--iwb-icon-sm); height: var(--iwb-icon-sm); }
|
||||
.iwb-dl-txt { white-space: nowrap; }
|
||||
/* 2026-12-03:输出节点下载浮层改右下角圆形图标(只占一个角,矮图不再被横条挡住中心)。
|
||||
容器不吃事件、只有按钮吃;不引入 z-index(DOM 顺序已保证在图片之上)。旧 .iwb-dl-bar 保留可回退。 */
|
||||
.iwb-dl-corner { position: absolute; right: var(--iwb-space-8); bottom: var(--iwb-space-8); display: flex; gap: var(--iwb-space-4); opacity: 0; pointer-events: none; transition: opacity var(--iwb-motion-hover) var(--iwb-ease-hover); }
|
||||
.iwb-dl-ov:hover .iwb-dl-corner, .iwb-dl-ov:focus-within .iwb-dl-corner { opacity: 1; }
|
||||
.iwb-dl-round { pointer-events: auto; width: 26px; height: 26px; border-radius: var(--iwb-radius-full); border: 1px solid var(--iwb-border2); background: var(--iwb-panel); color: var(--iwb-text); display: grid; place-items: center; padding: 0; cursor: pointer; font-size: var(--iwb-font-xs); line-height: 1; }
|
||||
.iwb-dl-round:hover { background: var(--iwb-hover); }
|
||||
.iwb-dl-round-primary { color: var(--iwb-brand-text, var(--iwb-text)); }
|
||||
.iwb-dl-round .iwb-ic { width: var(--iwb-icon-sm); height: var(--iwb-icon-sm); }
|
||||
@media (prefers-reduced-motion: reduce) { .iwb-dl-corner { transition: none; } }
|
||||
@media (prefers-reduced-motion: reduce) { .iwb-out-cell-img, .iwb-dl-bar { transition: none; } .iwb-out-cell:hover .iwb-out-cell-img { transform: none; } }
|
||||
.iwb-out-cell-meta { font-size: var(--iwb-font-2xs); color: var(--iwb-text2); text-align: center; margin-top: var(--iwb-space-2); }
|
||||
.iwb-out-cell-actions { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: flex; align-items: center; justify-content: center; gap: var(--iwb-space-10); opacity: 0; transition: opacity .15s; border-radius: 0 0 8px 8px; background: rgba(0,0,0,0.45); } /*iwb:raw-until=3.28.0*/
|
||||
|
||||
@@ -50,10 +50,14 @@ const ov = sandbox.IWBResultDownloadOverlay({
|
||||
onCopyRef: () => { copied++ },
|
||||
children: { type: 'img', props: {} },
|
||||
})
|
||||
const bar = ov.props.children.find((c) => c && c.props && c.props.className === 'iwb-dl-bar')
|
||||
assert.ok(bar, '浮层必须渲染底部条')
|
||||
const btns = bar.props.children.filter(Boolean)
|
||||
// 2026-12-03:下载浮层从底部横条改成右下角圆形图标(只占一个角)
|
||||
const corner = ov.props.children.find((c) => c && c.props && c.props.className === 'iwb-dl-corner')
|
||||
assert.ok(corner, '浮层必须渲染右下角操作区')
|
||||
const btns = corner.props.children.filter(Boolean)
|
||||
assert.strictEqual(btns.length, 2, '浮层应有复制 + 下载两个按钮')
|
||||
assert.ok(String(btns[0].props.className).indexOf('iwb-dl-round') >= 0, '复制按钮必须是圆钮')
|
||||
assert.ok(String(btns[1].props.className).indexOf('iwb-dl-round-primary') >= 0, '下载按钮必须是主圆钮')
|
||||
assert.strictEqual(btns[1].props['aria-label'], '下载', '图标按钮必须有 aria-label(可发现性)')
|
||||
btns[0].props.onClick({ stopPropagation() {} })
|
||||
btns[1].props.onClick({ stopPropagation() {} })
|
||||
btns[1].props.onPointerDown({ stopPropagation() { stopped++ } })
|
||||
|
||||
Reference in new issue
Block a user