feat(tokens): M4-B4 设置/外观 —— 控件等高 + 半像素字号清零(3.26.47)

用户能感知的只有一件:设置页同一行里输入框 33px、按钮 24px 的 9px 落差没有了。

控件等高
- 新增 --iwb-control-h: 30px。输入框竖内边距 7→6(13px 字 + 6×2 + 2 描边 = 30),
  默认按钮 24→30(align-items:center 自带居中)。
- 渠道卡片显式 height:auto —— 它是「卡片里的卡片」,固定高度会顶住上下分隔线。
- 不动全局 .iwb-input(28px):改它会让画布/停靠栏/节点里每个输入框都长 2px,不属于本批。

字号
- 设置页正文 14→13、标题 16→15(与同屏 section-title 同档);13.5×8→md、12.5×2→sm。

删 21 条死规则
- setcell(+hover/on/label)/setgrid/setopen/ratio-mini(-auto)/ratio-box/set-page-head(-headtext)/
  set-row(两处定义,一 grid 一 flex)/set-row-*/pop-anchor .setcell/appear-val/appear-note-only
  在 dist/app.js 与 plugins/** 里都是 0 次。

两条「写了但从未生效」的声明
- .iwb-set-nav-item 的 padding: 7px 9px 被 .iwb-settings-modal .iwb-tab(两个类)按 specificity
  压掉,实测一直是 8/16 —— 改它毫无反应。同类:.iwb-appear-range 写两遍,前者 flex 被后者覆盖。

守卫(tests/settings-scope-test.js,进 test:unit)
- 控件必须共用 control-h、范围内禁半像素字号、9 个死类名不许复现、引用的 token 必须存在。
- 最后一条是本批真踩到的:--iwb-radius-pill 拼错(真名 --iwb-radius-full)会让声明整条失效、
  圆角静默变 0,亮色基线看不出来。

验收
- 计算样式 diff:设置页 16 个元素 + 外观 15 个元素,18 项变化全部预期,无「没打算改却被改」。
- 12 张视觉基线:只有设置弹窗亮/暗 2 张变化(已核对无裁切/溢出),其余 10 张 0 diff。
- 审计:字号写死 243→212、间距 548→483、圆角 139→128、style.css 2339→2314;
  「引用了但从未定义」保持 0。verify:ci 全绿。
This commit is contained in:
qiqi committed 2026-11-23 16:10:51 +08:00
1 parent 68c10b625c
commit f5c81740d2
12 files changed
+225 -104

No files matched your search

+33
View File
@@ -14,6 +14,39 @@
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
## v3.26.47(2026-11-23)设置页:输入框与按钮终于一样高,半像素字号清零
> **状态:待发布**(`verify:ci` 全绿、12 张视觉基线只有设置弹窗 2 张变化且已核对;未打 tag)
M4-B4 批次。用户能感知的是**设置页更整齐**:同一行里输入框 33px、按钮 24px 的 9px 落差没有了,现在都是 30px。
**控件等高(本批的主任务)**
- 新增 `--iwb-control-h: 30px`。设置页输入框竖内边距 7→6(13px 字 + 6×2 + 2 描边 = 30),
默认按钮 24→30(`align-items:center` 自带居中,不用改内边距)。
- 渠道卡片是「卡片里的卡片」,显式 `height: auto` 按自身内边距算高,不吃固定高度。
- 没动全局 `.iwb-input`(现在 28px):改它会让画布、停靠栏、节点里每个输入框都长 2px,
这不是本批该带的观感变化。B6 收尾再定。
**字号**
- 设置页正文 14→13、标题 16→15,与同屏 `section-title(15)` 落到同一档(原来 16/15 差 1px,
读起来是两个「差不多大」的层级)。范围内半像素字号清零:13.5×8 → `md(13)`、12.5×2 → `sm(12)`。
**删 21 条死规则**
- 十四组类名在 `dist/app.js` 与 `plugins/**` 里都是 0 次:`setcell`(+hover/on/label)、`setgrid`、`setopen`、
`ratio-mini(-auto)`/`ratio-box`、`set-page-head(-headtext)`、`set-row`(两处定义,一 grid 一 flex)、
`set-row-*`、`pop-anchor .setcell`、`appear-val`、`appear-note-only`。
- `.iwb-set-row` 是插件设置页改版时被 `.iwb-mk-setrow` 取代的旧类。
**修掉一条「写了但从未生效」的声明**
- `.iwb-set-nav-item { padding: 7px 9px }` 被 `.iwb-settings-modal .iwb-tab`(两个类)按 specificity 压掉,
实测一直是 8/16 —— 改它毫无反应。
- 同类:`.iwb-appear-range` 写了两遍(`flex:1 1 0` 又被 `flex:0 1 260px` 覆盖),合并成一条。
**新增守卫** `tests/settings-scope-test.js`(已进 `test:unit`):
控件必须共用 `--iwb-control-h`、范围内禁半像素字号、9 个死类名不许复现、**引用的 token 必须存在**。
最后一条是本批真踩到的坑:`--iwb-radius-pill` 拼错(真名 `--iwb-radius-full`)会让声明整条失效、圆角静默变 0,
亮色基线看不出来 —— 这类错误只能靠断言。
## v3.26.46(2026-11-23)首页/库:字号与间距收进档位,删掉 30 条死规则
> **状态:待发布**(`verify:ci` 全绿、12 张视觉基线只有首页 2 张变化且已核对;未打 tag)
+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 119 个单测文件(jsdom 契约测试;2026-11-07 新增 sync-facts-guard(事实一致性)/ _helpers/source(统一源文本);2026-11-12 新增 provider-ping(测速 no-cors 兜底))
test:unit 120 个单测文件(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 -6
View File
@@ -134,7 +134,7 @@
| **B1 壳层** ✅ | `.iwb-tabstrip/.iwb-tab`(5 套)、`.iwb-dock-*`、`.iwb-toolbar*`、`.iwb-statusbar` | 页签收敛为 1 套(单框扁平 + 品牌高亮 + `--iwb-tab-height`);字号/圆角/间距换 token | 0.5d | 首页/画布截图;5 套类名只留 1 套 |
| **B2 浮层** ✅ | `.iwb-modal/.iwb-fullmask/.iwb-command/.iwb-ctxmenu/.iwb-toast/.iwb-pop*` | 圆角 → `radius-panel/popover`;阴影 → `elevation-2/3/4`;z-index → `--iwb-z-*`(toast 提到 modal 之上) | 0.5d | 遮罩/弹窗层级实测:toast 在确认框之上 |
| **B3 首页/库** ✅ | `.iwb-home-*/.iwb-lib-*/.iwb-res-*` | 间距归并(就近下取)、字号 7 档(新增 `display`) | 0.5d | 首页截图;文案换行逐条看 |
| **B4 设置/外观** | `.iwb-settings-modal/.iwb-appear-*/.iwb-setcell` | 控件统一 `pad-control` / `control-height` | 0.5d | 设置页截图 |
| **B4 设置/外观** ✅ | `.iwb-settings-modal/.iwb-appear-*/.iwb-set*` | 控件统一 `control-h`(输入框与按钮等高);半像素字号清零 | 0.5d | 设置页截图 + 计算样式 diff |
| **B5 节点** | `.iwb-node*/.iwb-gen-*/.iwb-port` | 节点内字号 12/15 归口;圆角走 `--iwb-node-radius`;端口/小标签换 `bg-chip` | 1d | 画布截图(最复杂,单独一轮) |
| **B6 插件** | `plugins/**` + 插件源码仓库 | 硬编码 → `--iwb-*`;`ALLOW_FILES` 逐项清零 | 0.5d | 契约测试白名单 4 → 0 |
@@ -207,6 +207,30 @@ B4/B5 建议照这个办法做(比逐张看截图快,也不会漏)。
token 化后必红,但它真正要保护的是「卡片标题用 `lg` 档」这个层级关系。已改成钉 token 档位
(`font-size: var(--iwb-font-lg)`),断言反而更强了。
**B4 执行结果(v3.26.47,2026-11-23)**:设置 / 外观。
| 项 | 计划 | 实际 | 说明 |
|---|---|---|---|
| 死代码 | — | **删 21 条死规则** | 十四组类名在 `dist/app.js` 与 `plugins/**` 里都是 0 次:`setcell`(+hover/on/label)、`setgrid`、`setopen`、`ratio-mini(-auto)/ratio-box`、`set-page-head(-headtext)`、`set-row`(两处定义,一 grid 一 flex)、`set-row-text/desc/main/title`、`pop-anchor .setcell`、`appear-val`、`appear-note-only`。`set-row` 是插件设置页改版时被 `.iwb-mk-setrow` 取代的旧类 |
| 控件等高 | `control-height` | **`--iwb-control-h: 30px`**,输入框 + 默认按钮共用 | 实测输入框 33px、按钮 24px,同一行差 9px。取 30:输入框竖内边距 7→6(13px 字 + 6×2 + 2 描边 = 30),按钮 24→30(`align-items:center` 自带居中) |
| 半像素字号 | 并入整数档 | **范围内清零**(13.5×8、12.5×2) | 13.5→`md(13)`、12.5→`sm(12)`。全局还剩 16 处(备份页、右键菜单、插件市场卡),留给 B5/B6 |
| 标题层级 | 16 归 lg 还是 xl | **归 `lg(15)`** | 与同屏 `section-title(15)` 落到同一档。原来是「标题 16 / 分节 15」两个差不多大的层级,读起来分不出主次 |
| 假声明 | — | **删 1 条** | `.iwb-set-nav-item` 的 `padding: 7px 9px` 被 `.iwb-settings-modal .iwb-tab`(2 个类)压掉,实测一直是 8/16,改它毫无反应 |
| 重复规则 | — | **合并 1 组** | `.iwb-appear-range` 写了两遍(`flex:1 1 0` 后又被 `flex:0 1 260px` 覆盖),只剩 `min/max-width` 生效 |
| 视觉基线 | 12 张 | **设置弹窗亮/暗 2 张变化,其余 10 张 0 diff** | ②③ 两张都看过:无裁切、无溢出、按钮与输入框齐平 |
| 守卫 | — | **新增 `tests/settings-scope-test.js`** | 三条不变量:控件必须共用 `control-h`、范围内禁半像素字号、9 个死类名不许复现 |
**这一批的坑与 B3 同源,但更隐蔽:特异性吃掉声明。**
`.iwb-set-nav-item { padding: 7px 9px }` 读起来就是「导航项用 7/9」,但导航项同时带 `.iwb-tab` 类,
而 `.iwb-settings-modal .iwb-tab { padding: 8px 16px }` 是两个类选择器 —— 按 specificity 赢,7/9 从未生效。
**这类错误的特征是「改它没反应」,不是「改错值」**,只有采计算样式才看得见(B3 的 `.iwb-home-panel` 五层 padding 是同一病因)。
规律:`{ 组件 } .{ 元素 }` 形式的覆盖规则会静默压掉 `.{ 元素 }` 上的同属性声明,写单类规则前必须先搜一遍这个元素还被谁管着。
**为什么 `--iwb-control-h` 只给设置页**:全局 `.iwb-input` 现在 28px(`padding: 6px 9px` + 12px 字),
直接改成 30 会让画布、停靠栏、节点里的每个输入框都长 2px —— B4 是「几乎零观感」的批次,不该带这个。
设置页是控件最密、且**输入框与按钮并排**的地方(别处多是纯输入或纯按钮),先在这里立规矩,
B6 收尾时再决定全局跟不跟。
**每批三条硬验收**:
1. 亮/暗两张截图 `0 diff`(B1 例外:允许 tab 视觉变化,需人工确认)
2. `token-audit.js` 对应计数下降
@@ -242,7 +266,8 @@ B4/B5 建议照这个办法做(比逐张看截图快,也不会漏)。
| 3.26.44 | M2 + M3 + M4-B1 | **有变化** | 附亮/暗前后对比图;单独可回滚。M3 与 B1 搭同一版:M3 零观感、B1 只有标签变化,合起来只解释一次 |
| 3.26.45 | M4-B2 浮层 | 几乎零(阴影略软 + toast 可见性修复) | 层级表 + 阴影 4 档;toast 从「被弹窗盖住」修好,用户能感知的是「以前看不到的成功提示现在看得到」 |
| 3.26.46 | M4-B3 首页/库 | **有变化** | 首页主标题 26→24、侧栏条目 38→34、卡片脚注更紧;同时删了 30 条死规则。用户能感知的是「首页更紧凑」,附亮/暗前后对比图 |
| 3.26.47–3.26.50 | M4-B4–B6 | 仅 B5 有变化 | 每批可单独发 |
| 3.26.47 | M4-B4 设置/外观 | **轻微** | 设置页正文 14→13、标题 16→15;同行输入框与按钮由「33 vs 24」变成都在 30。用户能感知的是「设置页更整齐」,不是「字变小」——13 与 15 仍在原层级里 |
| 3.26.48–3.26.50 | M4-B5–B6 | 仅 B5 有变化 | 每批可单独发 |
| 3.27.7 | M5 | 零 | 闸门上线 |
| 3.28.0 | M6 | 零 | 案例沉淀 |
@@ -254,12 +279,12 @@ B4/B5 建议照这个办法做(比逐张看截图快,也不会漏)。
| 指标 | 基线(实测) | M4 后目标 | M6 后目标 |
|---|---|---|---|
| 引用但未定义的变量 | 7 | 0 | 0 |
| 字号档数 | 19 | 7(B3 后散值 **17**;闭集 7 档已建) | 7 |
| 字号档数 | 19 | 7(B4 后散值仍 **17**:13.5/12.5 在范围外还有 16 处;闭集 7 档已建) | 7 |
| 圆角档数 | 18 | 5 | 5 |
| 间距档数 | 30 | ≤16 | ≤16 |
| 字号写死处 | 268 | ≤60(B3 后 **243**) | ≤20 |
| 圆角写死处 | 164 | ≤40(B3 后 **139**) | ≤10 |
| 间距写死处 | 629 | ≤200(B3 后 **548**) | ≤80 |
| 字号写死处 | 268 | ≤60(B4 后 **212**) | ≤20 |
| 圆角写死处 | 164 | ≤40(B4 后 **128**) | ≤10 |
| 间距写死处 | 629 | ≤200(B4 后 **483**) | ≤80 |
| 阴影写法种类 | 52 | ≤8 | 5 |
| z-index 取值种类 | 42 | ≤10(B2 后 **31**) | 9 |
| `var(--iwb-layer)` 引用 | 59(一词多义) | 0(已拆) | 0 |
+15 -5
View File
@@ -474,6 +474,10 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
> 落地改为 6 档 + 短名,原因同上(两层名字增加查找成本)。B3 归并结论:**14→`md`、16→`lg`、18→`xl`**
> (18 是侧栏标题与图标字形,向上取到 20 会让侧栏标题比导航项大太多,所以走 17);设置页的 16px 标题
> 按同一规则归 `lg`,B4 里若观感变差再单独提。
>
> **B4 已执行这条待定项**:设置页 `16px` 标题(工具条标题、插件设置页标题)统一归 `lg(15)`,
> 与同屏的 `section-title(15)` 落到同一档 —— 原来标题 16 / 分节 15 差 1px,是两个「差不多大」的层级,
> 读起来分不出谁更重要。B4 范围内半像素字号(13.5 ×8、12.5 ×2)全部并入 `md(13)` / `sm(12)`。
- 行高:`--iwb-lh-tight:1.25` / `--iwb-lh-normal:1.45` / `--iwb-lh-loose:1.6`(正文 1.45,单行控件 1.25)
- 字重:`--iwb-fw-regular:400` / `-medium:500` / `-semibold:600` / `-bold:700`
@@ -578,11 +582,17 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
| token | 值 | 消费者 |
|---|---|---|
| `--iwb-tab-height` | 28px | 全部 5 套 tab(收敛后只剩 1 套) |
| `--iwb-control-height` | 30px | 输入框、按钮 |
| `--iwb-panel-radius` | = radius-panel | 面板/弹窗 |
| `--iwb-tab-h` | 28px | 全部 5 套 tab(收敛后只剩 1 套) |
| `--iwb-control-h` | 30px | 设置页输入框 + 设置页默认按钮(B4 落地);B6 再扩到全局控件 |
| `--iwb-radius-panel` | 14px | 面板/弹窗 |
| `--iwb-node-radius` | 用户可调 14px | 画布节点 |
**`--iwb-control-h` 的由来(B4 实测)**:设置页同一行里输入框 33px、按钮 24px —— 差 9px,肉眼就是「高低不齐」。
两者都写死高度没意义,必须是**同一个数**。取 30 而不是 33:输入框竖内边距从 7 收到 6(13px 字 + 6×2 + 描边 2 = 30),
按钮从 24 涨到 30(`align-items: center` 自动居中文字,不用改内边距)。
`tests/settings-scope-test.js` 钉死「这两条规则必须写 `height: var(--iwb-control-h)`」,
防止以后有人单独给其中一个加 `padding` 又把高度差拉开。
---
## 4. 落地路线
@@ -635,7 +645,7 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
| **B1 壳层** | `.iwb-tabstrip` `.iwb-tab` `.iwb-dock-*` `.iwb-toolbar*` `.iwb-statusbar` | 5 套 tab 收敛为 1 套(单框扁平 + 品牌高亮);圆角/间距/字号换 token | 0.5 天 |
| **B2 浮层** | `.iwb-modal` `.iwb-fullmask` `.iwb-command` `.iwb-ctxmenu` `.iwb-toast` `.iwb-pop*` | 圆角统一 → `radius-panel/popover`;阴影 → `elevation-2/3/4`;z-index → `--iwb-z-*` | 0.5 天 |
| **B3 首页/画布库** | `.iwb-home-*` `.iwb-lib-*` `.iwb-res-*` | 间距归并、字号归并 | 0.5 天 |
| **B4 设置/外观** | `.iwb-settings-modal` `.iwb-appear-*` `.iwb-setcell` | 表单控件统一 `pad-control` / `control-height` | 0.5 天 |
| **B4 设置/外观** ✅ | `.iwb-settings-modal` `.iwb-appear-*` `.iwb-set*` | 控件统一 `control-h`(输入框与按钮等高);半像素字号清零;删 21 条死规则 | 0.5 天 |
| **B5 节点** | `.iwb-node*` `.iwb-gen-*` `.iwb-port` | 节点内字号 12/15 归口;圆角走 `node-radius` | 1 天 |
| **B6 插件** | `plugins/**` + 插件源码仓库 | 硬编码 → `--iwb-*`;`ALLOW_FILES` 逐项清零 | 配合插件发版 |
@@ -784,7 +794,7 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
| # | 决定 | 裁定 | 影响与执行口径 |
|---|---|---|---|
| ① | 面板圆角 | **14px**(`radius-panel`) | 浮层(modal/fullmask/菜单/命令面板)统一 14;`popover` 用 12,`control` 用 8,`chip` 用 6,`round` 用 999。节点保持 `--iwb-node-radius`(默认 14)不受影响 |
| ② | 半像素字号 | **并入整数档**(10.5→10、11.5→11、12.5→12、13.5→13) | 8 档闭集:10 / 11 / 12 / 13 / 14 / 15 / 16 / 18。迁移时逐条看换行,只允许「文案变短一行」不允许「挤出容器」 |
| ② | 半像素字号 | **并入整数档**(10.5→10、11.5→11、12.5→12、13.5→13)|**已执行**:B3 清首页/库、B4 清设置/外观 | 闭集实际落在 7 档:11 / 12 / 13 / 15 / 17 / 20 / 24。迁移时逐条看换行,只允许「文案变短一行」不允许「挤出容器」。B5/B6 收尾时清剩余 16 处(备份、右键菜单、插件市场卡) |
| ③ | 间距迁移 | **先等值替换**,收敛另起一轮 | M4 只换写法不换值(0 diff);30 档 → 16 档的收敛放到 M4 之后单独一批,届时逐屏对照 |
| ④ | 色彩模型修复范围 | **全修 D1–D9**,但**分两版**:3.26.43 只放 D1(零观感),D3/D4/D5/D6/D7/D8/D9 放 3.26.44 | D1 = 单一写入点(消闪变、修系统转暗不生效),观感零风险;其余会改变暗色观感,单独发版并附亮/暗对比图 |
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "image-workbench-web",
"private": true,
"version": "3.26.46",
"version": "3.26.47",
"description": "Browser-based node canvas image workbench",
"scripts": {
"build": "node scripts/build.js && node scripts/copy-plugins.js",
@@ -10,7 +10,7 @@
"app:build": "tauri build",
"lint": "eslint src app.js",
"test": "node tests/relay-task-graph-fixture-test.js && node tests/plugin-style-node-test.js && node tests/inherit-text-test.js",
"test:unit": "node tests/plugin-archive-test.js && node tests/plugin-files-policy-test.js && node tests/theme-plugin-tokens-test.js && node tests/theme-static-snapshot-test.js && node tests/overlay-layer-test.js && node tests/appearance-v2-test.js && node tests/image-prompt-cover-test.js && node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/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/native-overlay-park-test.js && node tests/ui-dock-sanitize-test.js && node tests/ui-minimap-fit-test.js && node tests/ui-workbench-hooks-test.js",
"test:unit": "node tests/plugin-archive-test.js && node tests/plugin-files-policy-test.js && node tests/theme-plugin-tokens-test.js && node tests/theme-static-snapshot-test.js && node tests/overlay-layer-test.js && node tests/settings-scope-test.js && node tests/appearance-v2-test.js && node tests/image-prompt-cover-test.js && node tests/unit-test.js && node tests/canvas-actions-test.js && node tests/canvas-performance-test.js && node tests/canvas-drag-performance-test.js && node tests/resize-observer-performance-test.js && node tests/node-drag-jank-test.js && node tests/edge-graph-performance-test.js && node tests/persistence-export-images-test.js && node tests/settings-hotkeys-size-presets-test.js && node tests/custom-size-validation-test.js && node tests/image-node-performance-test.js && node tests/drag-frame-performance-test.js && node tests/canvas-edge-memo-test.js && node tests/canvas-node-transform-test.js && node tests/canvas-dot-zoom-test.js && node tests/duplicate-ws-fresh-source-test.js && node tests/single-canvas-shell-test.js && node tests/navigation-layout-test.js && node tests/home-canvas-library-test.js && node tests/left-resource-layout-test.js && node tests/interface-hierarchy-test.js && node tests/three-page-layout-test.js && node tests/page-chrome-regression-test.js && node tests/task-cache-test.js && node tests/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/native-overlay-park-test.js && node tests/ui-dock-sanitize-test.js && node tests/ui-minimap-fit-test.js && node tests/ui-workbench-hooks-test.js",
"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",
+2 -1
View File
@@ -125,6 +125,7 @@ const SCALE = [
['--iwb-chrome-h', '36px', '顶部标签条高度:tabstrip / dockarea / home-panel 三处共用(原来各写一遍 36px)'],
['--iwb-tab-h', '28px', '标签高度'],
['--iwb-tab-radius', '7px', '标签圆角'],
['--iwb-control-h', '30px', '表单控件高度:同一行里的输入框与默认按钮必须等高(设置页实测曾是 33 vs 24)'],
/* ── 层级表(M4-B2)───────────────────────────────────────────────
* 迁移前 z-index 有 42 种取值,其中「谁盖谁」全靠散落在各处的数字对撞,出过两次真 bug:
@@ -338,7 +339,7 @@ function groupOf (name) {
if (/^sh-/.test(n)) return 'shadow'
if (/^z-/.test(n)) return 'z'
if (n === 'grid-dot') return 'color'
if (/^(grid-|nav-|node-radius|node-sel-w|edge-w|edge-dash|chrome-h|tab-h|tab-radius)/.test(n)) return 'layout'
if (/^(grid-|nav-|node-radius|node-sel-w|edge-w|edge-dash|chrome-h|tab-h|tab-radius|control-h)/.test(n)) return 'layout'
if (/^plugin-/.test(n)) return 'color.plugin'
return 'color'
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "image-workbench",
"version": "3.26.46",
"version": "3.26.47",
"identifier": "com.malongan.imageworkbench",
"build": {
"frontendDist": "../dist",
+1
View File
@@ -119,6 +119,7 @@
--iwb-chrome-h: 36px; /* 顶部标签条高度:tabstrip / dockarea / home-panel 三处共用(原来各写一遍 36px) */
--iwb-tab-h: 28px; /* 标签高度 */
--iwb-tab-radius: 7px; /* 标签圆角 */
--iwb-control-h: 30px; /* 表单控件高度:同一行里的输入框与默认按钮必须等高(设置页实测曾是 33 vs 24) */
--iwb-z-ctx: 90; /* 右键遮罩 */
--iwb-z-ctx-menu: 91; /* 右键菜单 */
--iwb-z-curtain: 100; /* 应用遮罩 / 图片预览底 */
+63 -88
View File
@@ -413,14 +413,14 @@ button { font-family: inherit; }
.iwb-help-row { font-size: 14px; line-height: 1.6; }
.iwb-help-row b { color: var(--iwb-brand-text, var(--iwb-brand)); font-weight: 700; margin-right: 6px; }
/* 设置面板:字号 +2、间距加大,方便阅读 */
.iwb-settings-modal .iwb-modal-head { padding: 14px 20px; }
.iwb-settings-modal .iwb-modal-body { font-size: 14px; gap: 16px; padding: 18px 22px; }
.iwb-settings-modal .iwb-toolbar-title { font-size: 16px; }
.iwb-settings-modal .iwb-tab { padding: 8px 16px; font-size: 13px; }
.iwb-settings-modal .iwb-input { font-size: 14px; padding: 7px 11px; background: var(--iwb-panel); border-color: var(--iwb-border); }
.iwb-settings-modal .iwb-modal-head { padding: var(--iwb-space-12) var(--iwb-space-20); }
.iwb-settings-modal .iwb-modal-body { font-size: var(--iwb-font-md); gap: var(--iwb-space-16); padding: var(--iwb-space-16) var(--iwb-space-24); }
.iwb-settings-modal .iwb-toolbar-title { font-size: var(--iwb-font-lg); }
.iwb-settings-modal .iwb-tab { padding: var(--iwb-space-8) var(--iwb-space-16); font-size: var(--iwb-font-md); }
.iwb-settings-modal .iwb-input { height: var(--iwb-control-h); font-size: var(--iwb-font-md); padding: var(--iwb-space-6) var(--iwb-space-12); background: var(--iwb-panel); border-color: var(--iwb-border); }
/* 设置弹窗固定高度:切换 Tab 不改变窗口大小;内容区内部滚动 */
.iwb-help-modal { width: 640px; }
.iwb-settings-modal .iwb-label { font-size: 13.5px; margin: 8px 0 4px; }
.iwb-settings-modal .iwb-label { font-size: var(--iwb-font-md); margin: var(--iwb-space-8) 0 var(--iwb-space-4); }
/* 数据备份与恢复弹窗 */
.iwb-backup-modal { width: 560px; }
/* 嵌入设置面板时:不要外框、不要固定宽度(用户反馈「不要框住了」) */
@@ -441,14 +441,14 @@ button { font-family: inherit; }
.iwb-backup-actions .iwb-btn { font-size: 13px; }
.iwb-backup-file { font-size: 12.5px; color: var(--iwb-text2); padding: 2px 0 4px; }
.iwb-backup-note { font-size: 12px; color: var(--iwb-text2); line-height: 1.6; }
.iwb-settings-modal .iwb-hint { font-size: 13.5px; }
.iwb-settings-modal .iwb-btn { font-size: 13.5px; }
.iwb-settings-modal .iwb-section-title { font-size: 15px; margin: 6px 0 8px; }
.iwb-settings-modal .iwb-section-sub { font-size: 13.5px; }
.iwb-settings-modal .iwb-provider-card { padding: 12px 14px; gap: 8px; }
.iwb-settings-modal .iwb-row { gap: 8px; }
.iwb-settings-modal .iwb-keyrow, .iwb-settings-modal .iwb-speed-row, .iwb-settings-modal .iwb-mode-row { padding: 5px 0; gap: 8px; }
.iwb-settings-modal .iwb-modellist .iwb-check { font-size: 13.5px; }
.iwb-settings-modal .iwb-hint { font-size: var(--iwb-font-md); }
.iwb-settings-modal .iwb-btn { height: var(--iwb-control-h); font-size: var(--iwb-font-md); }
.iwb-settings-modal .iwb-section-title { font-size: var(--iwb-font-lg); margin: var(--iwb-space-6) 0 var(--iwb-space-8); }
.iwb-settings-modal .iwb-section-sub { font-size: var(--iwb-font-md); }
.iwb-settings-modal .iwb-provider-card { padding: var(--iwb-space-12); gap: var(--iwb-space-8); }
.iwb-settings-modal .iwb-row { gap: var(--iwb-space-8); }
.iwb-settings-modal .iwb-keyrow, .iwb-settings-modal .iwb-speed-row, .iwb-settings-modal .iwb-mode-row { padding: var(--iwb-space-6) 0; gap: var(--iwb-space-8); }
.iwb-settings-modal .iwb-modellist .iwb-check { font-size: var(--iwb-font-md); }
.iwb-toolbar { overflow: visible; }
.iwb-node-fixed .iwb-node-body { display: flex; flex-direction: column; overflow: visible; min-height: 0; }
@@ -1439,7 +1439,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* ===== v3.86.5 图像设置浮层(质量 / 尺寸 / 分辨率 / 宽高比网格) ===== */
.iwb-image-settings { width: 380px; max-width: calc(100vw - 32px); }
.iwb-image-settings .iwb-modal-body { display: flex; flex-direction: column; gap: 12px; }
.iwb-setgroup { display: flex; flex-direction: column; gap: 6px; }
.iwb-setgroup { display: flex; flex-direction: column; gap: var(--iwb-space-6); }
/* v3.87.5:质量档位一行放 6 个 chip(自动/快速/标准/高清/极高/最高)→ 只在这个浮层里收紧内边距;
.iwb-setrow 本来就有 flex-wrap,字体差异导致放不下时自然换行,不存在溢出。 */
.iwb-image-settings .iwb-chip-line { padding: 5px 10px; }
@@ -1448,24 +1448,15 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 设置里模型行的「质量」勾选:紧跟名字,不参与右侧按钮的挤压 */
.iwb-modelrow-q { flex: 0 0 auto; font-size: 12px; }
.iwb-modelrow-q input { margin: 0; }
.iwb-setlabel { color: var(--iwb-text2); font-size: 12px; font-weight: 700; }
.iwb-sethd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.iwb-setalign { font-size: 12px; white-space: nowrap; }
.iwb-setrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.iwb-setlabel { color: var(--iwb-text2); font-size: var(--iwb-font-sm); font-weight: 700; }
.iwb-sethd { display: flex; align-items: center; justify-content: space-between; gap: var(--iwb-space-8); }
.iwb-setalign { font-size: var(--iwb-font-sm); white-space: nowrap; }
.iwb-setrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--iwb-space-6); }
.iwb-setx { color: var(--iwb-text2); flex: 0 0 auto; }
.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: 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; }
.iwb-setcell-on { border-color: var(--iwb-brand); }
.iwb-setcell-label { font-size: 12px; line-height: 1; }
.iwb-ratio-mini { display: grid; place-items: center; width: 36px; height: 26px; }
.iwb-ratio-mini-auto { border-bottom: 1px dashed var(--iwb-border); }
.iwb-ratio-box { border: 2px solid currentColor; border-radius: 2px; }
.iwb-setopen { flex: 0 0 auto; }
.iwb-sethint { margin: 0; padding: 1px var(--iwb-space-6); border-radius: var(--iwb-radius-full); background: var(--iwb-layer); border: 1px solid var(--iwb-border); white-space: nowrap; }
.iwb-seterr { margin: 0; padding: 1px var(--iwb-space-6); border-radius: var(--iwb-radius-full); color: var(--iwb-err); border: 1px solid var(--iwb-err); white-space: nowrap; }
/* ===== v3.86.5 图像设置:贴节点浮层(popover)形态 ===== */
.iwb-pop-anchor { position: fixed; z-index: var(--iwb-z-anchor); }
@@ -1477,7 +1468,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-chip-line { background: transparent; border: 1px solid var(--iwb-border); color: var(--iwb-text); border-radius: 999px; padding: 5px 14px; }
.iwb-chip-line:hover { border-color: var(--iwb-brand); color: var(--iwb-text); }
.iwb-chip-line-on, .iwb-chip-line-on:hover { background: transparent; border-color: var(--iwb-brand); color: var(--iwb-brand-text, var(--iwb-brand)); font-weight: 700; }
.iwb-pop-anchor .iwb-setcell { background: var(--iwb-panel); }
/* 节点内图像设置汇总条(唯一入口,点击弹出面板) */
.iwb-gen-summary { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* ===== v3.86.6 节点参数:一行排布 + 服务商/分组/模型 自绘气泡 + 字号统一 15px ===== */
@@ -1523,7 +1513,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 弹窗内四组控件的形状统一:跟随「尺寸」那组(圆角矩形,非胶囊);字号统一 15px */
.iwb-pop .iwb-chip-line { border-radius: 10px; min-height: 38px; padding: 6px 14px; font-size: 15px; }
.iwb-pop .iwb-set-num { font-size: 15px; }
.iwb-pop .iwb-set-num { font-size: var(--iwb-font-lg); }
.iwb-pop-title { font-size: 15px; }
/* ---------- 分层节点(layer)----------
@@ -1619,16 +1609,10 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-plugin-tag-warn { color: var(--iwb-err); border-color: var(--iwb-err); }
.iwb-set-main { display: flex; flex: 1 1 auto; min-height: 0; }
.iwb-set-nav { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; overflow: auto; border-right: 1px solid var(--iwb-border); background: var(--iwb-layer); }
.iwb-set-nav-group { font-size: 12px; font-weight: 600; color: var(--iwb-text2); margin: 10px 8px 4px; }
.iwb-set-nav-item { width: 100%; height: auto; padding: 7px 9px; justify-content: flex-start; text-align: left; gap: 8px; }
.iwb-set-page-title { font-size: 16px; font-weight: 700; margin: 2px 0 4px; }
.iwb-set-page-head { display: flex; align-items: flex-start; gap: 10px; }
.iwb-set-page-headtext { min-width: 0; flex: 1 1 auto; }
.iwb-set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--iwb-border); border-radius: 10px; background: var(--iwb-layer); margin-top: 10px; }
.iwb-set-row > input { justify-self: end; }
.iwb-set-row-text { min-width: 0; }
.iwb-set-row-desc { font-size: 12.5px; color: var(--iwb-text2); margin-top: 2px; line-height: 1.5; }
.iwb-set-nav { width: 232px; flex: 0 0 232px; display: flex; flex-direction: column; gap: var(--iwb-space-2); padding: var(--iwb-space-12) var(--iwb-space-10); overflow: auto; border-right: 1px solid var(--iwb-border); background: var(--iwb-layer); }
.iwb-set-nav-group { font-size: var(--iwb-font-sm); font-weight: 600; color: var(--iwb-text2); margin: var(--iwb-space-10) var(--iwb-space-8) var(--iwb-space-4); }
.iwb-set-nav-item { width: 100%; height: auto; justify-content: flex-start; text-align: left; gap: var(--iwb-space-8); }
.iwb-set-page-title { font-size: var(--iwb-font-lg); font-weight: 700; margin: var(--iwb-space-2) 0 var(--iwb-space-4); }
/* ── 「模型设置」面板(2026-10-30):服务商 / 分组 / 模型 ─────────────────────
模型列表用「标签流式排列」:每个按内容宽度,排满一行自动折行(2026-10-31 用户指定样式);
@@ -1815,14 +1799,14 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-textarea.is-inherited { color: color-mix(in srgb, var(--iwb-text) 74%, transparent); }
/* ── 设置面板整理(桌面版):少框线、多留白、分层靠标题而不是边框 ───────── */
.iwb-settings-modal .iwb-section { border-top: none; margin-top: 4px; padding-top: 0; }
.iwb-settings-modal .iwb-section + .iwb-section { margin-top: 26px; }
.iwb-settings-modal .iwb-section-sub { margin: 20px 0 6px; }
.iwb-settings-modal .iwb-section-sub:first-of-type { margin-top: 10px; }
.iwb-settings-modal .iwb-row { margin: 6px 0; }
.iwb-settings-modal .iwb-hint { margin: 4px 0 0; line-height: 1.6; }
.iwb-settings-modal .iwb-section { border-top: none; margin-top: var(--iwb-space-4); padding-top: 0; }
.iwb-settings-modal .iwb-section + .iwb-section { margin-top: var(--iwb-space-24); }
.iwb-settings-modal .iwb-section-sub { margin: var(--iwb-space-20) 0 var(--iwb-space-6); }
.iwb-settings-modal .iwb-section-sub:first-of-type { margin-top: var(--iwb-space-10); }
.iwb-settings-modal .iwb-row { margin: var(--iwb-space-6) 0; }
.iwb-settings-modal .iwb-hint { margin: var(--iwb-space-4) 0 0; line-height: 1.6; }
.iwb-settings-modal .iwb-set-nav { border-right: none; }
.iwb-settings-modal .iwb-set-nav-group { margin: 16px 8px 6px; }
.iwb-settings-modal .iwb-set-nav-group { margin: var(--iwb-space-16) var(--iwb-space-8) var(--iwb-space-6); }
/* 桌面端插件列表:标题行 + 右侧操作(对齐 Obsidian,省纵向空间) */
.iwb-plugin-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--iwb-border); }
@@ -1845,11 +1829,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-mk-tags { display: flex; flex-wrap: wrap; }
.iwb-mk-actions { display: flex; justify-content: flex-end; margin-top: 2px; }
/* 设置行(Obsidian 风格:标题 + 说明 + 右侧控件) */
.iwb-set-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--iwb-border); }
.iwb-set-row-main { flex: 1 1 auto; min-width: 0; }
.iwb-set-row-title { font-weight: 600; font-size: 14px; }
/* 开关 */
.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; }
@@ -1910,14 +1889,14 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-mk-card .iwb-mk-tag { font-size: 10.5px; padding: 0 7px; line-height: 16px; }
.iwb-mk-card .iwb-btn-sm { padding: 3px 10px; font-size: 12px; }
/* 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 { border: 0; border-top: 1px solid var(--iwb-border); border-radius: 0; background: transparent; padding: var(--iwb-space-12) 0 var(--iwb-space-8); 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 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-llm-card-def { border-left: 2px solid var(--iwb-brand); padding-left: var(--iwb-space-12); }
.iwb-settings-modal .iwb-llm-card .iwb-label { font-size: var(--iwb-font-sm); color: var(--iwb-text2); font-weight: 600; margin: var(--iwb-space-10) 0 var(--iwb-space-4); }
.iwb-settings-modal .iwb-llm-card .iwb-row { margin: var(--iwb-space-4) 0; gap: var(--iwb-space-8); }
.iwb-settings-modal .iwb-llm-card .iwb-input { height: auto; padding: var(--iwb-space-6) var(--iwb-space-10); font-size: var(--iwb-font-md); }
.iwb-settings-modal .iwb-modellist { display: flex; flex-wrap: wrap; gap: var(--iwb-space-6); margin: var(--iwb-space-2) 0 var(--iwb-space-4); }
.iwb-settings-modal .iwb-modelrow { padding: var(--iwb-space-2) var(--iwb-space-8); border-radius: var(--iwb-radius-full); background: var(--iwb-layer2); border: 1px solid transparent; margin: 0; font-size: var(--iwb-font-sm); }
.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; }
@@ -1978,9 +1957,8 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-history-head .iwb-btn-sm { padding-left: 6px; padding-right: 6px; }
/* 外观自定义(v3.25.22):数值滑杆与预设按钮 */
.iwb-appear-range { flex: 1 1 0; min-width: 90px; max-width: 220px; }
.iwb-appear-val { min-width: 52px; text-align: right; font-size: var(--fs-sm); color: var(--iwb-text2); }
.iwb-appear-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.iwb-appear-range { flex: 0 1 260px; min-width: 90px; max-width: 220px; }
.iwb-appear-presets { display: flex; flex-wrap: wrap; gap: var(--iwb-space-6); margin-bottom: var(--iwb-space-8); }
/* ===== 左右停靠栏(v3.25.35,Obsidian 式) =====
* 画布始终 inset:0 不动;只有工具栏/小地图/提示条按 --iwb-dock-l/--iwb-dock-r 让位。
@@ -2153,21 +2131,20 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* v3.25.69:屏幕外节点不参与绘制(配合已有视口裁剪,进一步缩小每次重绘的像素面) */
/* ── 外观面板(v3.25.75 重构):4 组 + 两栏网格 ─────────────────────────── */
.iwb-appear { display: flex; flex-direction: column; gap: 22px; }
.iwb-appear-group { display: flex; flex-direction: column; gap: 4px; }
.iwb-appear-ghead { display: flex; align-items: center; justify-content: space-between; padding: 0 0 6px; border-bottom: 1px solid var(--iwb-border); margin-bottom: 6px; }
.iwb-appear-gtitle { font-size: 13px; font-weight: 700; color: var(--iwb-text); }
.iwb-appear-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 40px; }
.iwb-appear-label { font-size: 12px; color: var(--iwb-text2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-appear-ctrl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.iwb-appear { display: flex; flex-direction: column; gap: var(--iwb-space-24); }
.iwb-appear-group { display: flex; flex-direction: column; gap: var(--iwb-space-4); }
.iwb-appear-ghead { display: flex; align-items: center; justify-content: space-between; padding: 0 0 var(--iwb-space-6); border-bottom: 1px solid var(--iwb-border); margin-bottom: var(--iwb-space-6); }
.iwb-appear-gtitle { font-size: var(--iwb-font-md); font-weight: 700; color: var(--iwb-text); }
.iwb-appear-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: var(--iwb-space-10); min-height: var(--iwb-space-40); }
.iwb-appear-label { font-size: var(--iwb-font-sm); color: var(--iwb-text2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwb-appear-ctrl { display: flex; align-items: center; gap: var(--iwb-space-8); min-width: 0; }
.iwb-appear-ctrl > .iwb-input, .iwb-appear-ctrl > select { max-width: 360px; }
.iwb-appear-note { font-size: 11px; color: var(--iwb-text2); white-space: nowrap; }
.iwb-appear-note { font-size: var(--iwb-font-xs); color: var(--iwb-text2); white-space: nowrap; }
.iwb-appear-select { max-width: 360px; }
.iwb-appear-range { flex: 0 1 260px; }
.iwb-appear-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.iwb-appear-btns { display: flex; gap: var(--iwb-space-6); flex-wrap: wrap; }
/* 分段控件(网格样式:点 / 线 / 空白) */
.iwb-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); }
.iwb-seg-item { border: 0; background: transparent; color: var(--iwb-text2); font-size: 12px; padding: 5px 14px; border-radius: 7px; cursor: pointer; }
.iwb-seg { display: inline-flex; padding: var(--iwb-space-4); gap: var(--iwb-space-2); border-radius: var(--iwb-radius-card); background: var(--iwb-layer); border: 1px solid var(--iwb-border); }
.iwb-seg-item { border: 0; background: transparent; color: var(--iwb-text2); font-size: var(--iwb-font-sm); padding: var(--iwb-space-6) var(--iwb-space-12); border-radius: var(--iwb-tab-radius); cursor: pointer; }
.iwb-seg-item:hover { color: var(--iwb-text); }
.iwb-seg-item.on { background: var(--iwb-panel); color: var(--iwb-text); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 700; }
@media (max-width: 720px) { .iwb-appear-row { grid-template-columns: 92px minmax(0, 1fr); } .iwb-appear-note { display: none; } }
@@ -2182,23 +2159,21 @@ 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: var(--iwb-elevation-4); }
/* 自动配色开启时的提示行(v3.25.81) */
.iwb-appear-note-only { font-size: 12px; color: var(--iwb-text2); padding: 4px 0 0 2px; }
/* 外观 v2(v3.26.42):模式切换 / 派生摘要 / 跟随·自定义 / 对比度徽标 */
.iwb-appear-mode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.iwb-appear-modehint { font-size: 11px; color: var(--iwb-text2); }
.iwb-appear-gnote { font-size: 11px; color: var(--iwb-text2); font-weight: 400; white-space: nowrap; }
.iwb-appear-swaches { display: flex; flex-wrap: wrap; gap: 10px; padding: 2px 0 4px 130px; }
.iwb-appear-sw { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--iwb-text2); }
.iwb-appear-sw i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--iwb-border); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--iwb-text) 28%, transparent); }
.iwb-appear-revert { border: 1px solid var(--iwb-border); background: var(--iwb-layer); color: var(--iwb-text2); font-size: 11px; border-radius: 999px; padding: 1px 7px; cursor: pointer; }
.iwb-appear-mode { display: flex; align-items: center; gap: var(--iwb-space-12); flex-wrap: wrap; }
.iwb-appear-modehint { font-size: var(--iwb-font-xs); color: var(--iwb-text2); }
.iwb-appear-gnote { font-size: var(--iwb-font-xs); color: var(--iwb-text2); font-weight: 400; white-space: nowrap; }
.iwb-appear-swaches { display: flex; flex-wrap: wrap; gap: var(--iwb-space-10); padding: var(--iwb-space-2) 0 var(--iwb-space-4) 130px; }
.iwb-appear-sw { display: inline-flex; align-items: center; gap: var(--iwb-space-6); font-size: var(--iwb-font-xs); color: var(--iwb-text2); }
.iwb-appear-sw i { width: 14px; height: 14px; border-radius: var(--iwb-radius-chip); border: 1px solid var(--iwb-border); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--iwb-text) 28%, transparent); }
.iwb-appear-revert { border: 1px solid var(--iwb-border); background: var(--iwb-layer); color: var(--iwb-text2); font-size: var(--iwb-font-xs); border-radius: var(--iwb-radius-full); padding: 1px var(--iwb-space-6); cursor: pointer; }
.iwb-appear-revert:hover { color: var(--iwb-text); border-color: var(--iwb-border2); }
.iwb-ratio { margin-left: 6px; font-size: 10px; padding: 1px 5px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.iwb-ratio.ok { color: var(--iwb-ok); background: color-mix(in srgb, var(--iwb-ok) 14%, transparent); }
.iwb-ratio.warn { color: var(--iwb-warn); background: color-mix(in srgb, var(--iwb-warn) 16%, transparent); }
.iwb-ratio.bad { color: var(--iwb-err); background: color-mix(in srgb, var(--iwb-err) 16%, transparent); }
.iwb-appear-preset { display: inline-flex; align-items: center; gap: 2px; }
.iwb-appear-del { border: none; background: transparent; color: var(--iwb-text2); cursor: pointer; font-size: 11px; padding: 2px 4px; border-radius: 4px; }
.iwb-appear-preset { display: inline-flex; align-items: center; gap: var(--iwb-space-2); }
.iwb-appear-del { border: none; background: transparent; color: var(--iwb-text2); cursor: pointer; font-size: var(--iwb-font-xs); padding: var(--iwb-space-2) var(--iwb-space-4); border-radius: var(--iwb-radius-chip); }
.iwb-appear-del:hover { color: var(--iwb-err); background: color-mix(in srgb, var(--iwb-err) 12%, transparent); }
@media (max-width: 720px) { .iwb-appear-swaches { padding-left: 92px; } }
@@ -2248,7 +2223,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-mk-actions { gap: 6px; }
.iwb-mk-actions .iwb-btn { border: 0; background: var(--iwb-layer2); box-shadow: none; }
.iwb-mk-subtitle { font-size: 11.5px; color: var(--iwb-text2); margin: 2px 0 10px; }
.iwb-set-page-title { margin-bottom: 2px; }
.iwb-set-page-title { margin-bottom: var(--iwb-space-2); }
/* ── v3.26.25 插件市场二次优化:自适应全宽 + 淡描边 + 已安装徽标(去绿色底) ── */
.iwb-set-page { max-width: none; }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 106 KiB

+76
View File
@@ -0,0 +1,76 @@
// B4 设置/外观:三条不变量
//
// 这一批踩到的两类坑都不是「写错值」,而是「写了但不生效」「写了但没人用」:
// ① `.iwb-set-nav-item` 声明了 padding: 7px 9px,被 `.iwb-settings-modal .iwb-tab`(两个类)
// 按 specificity 盖掉,实测一直是 8/16 —— 改它毫无反应,只能靠采样计算样式发现;
// ② `.iwb-setcell` / `.iwb-set-row` 这类类名在样式表里躺着,DOM 早已不渲染(v3.22 与插件设置页改版)。
// 所以这里的断言不看「值对不对」,只看「这条声明还有没有意义」。
const assert = require('assert')
const fs = require('fs')
const path = require('path')
const root = path.join(__dirname, '..')
const css = fs.readFileSync(path.join(root, 'style.css'), 'utf8')
const tokens = fs.readFileSync(path.join(root, 'src/design-tokens.css'), 'utf8')
// ── 1. 控件高度:同一行里的输入框与默认按钮必须共用同一个 token ──
const m = tokens.match(/--iwb-control-h:\s*(\d+px)/)
assert.ok(m, '缺少 --iwb-control-h(表单控件高度)')
assert.strictEqual(m[1], '30px', '--iwb-control-h 应为 30px')
for (const sel of ['.iwb-settings-modal .iwb-input {', '.iwb-settings-modal .iwb-btn {']) {
const i = css.indexOf(sel)
assert.ok(i >= 0, '找不到规则:' + sel)
const body = css.slice(i, css.indexOf('}', i))
assert.ok(
body.includes('height: var(--iwb-control-h)'),
sel + ' 必须用 height: var(--iwb-control-h) —— 否则它旁边的控件会高低不齐(曾是 33 vs 24)'
)
}
// 渠道卡片是「卡片里的卡片」,允许按自身内边距算高,但必须显式 height: auto 而不是继承 30
const llm = css.indexOf('.iwb-settings-modal .iwb-llm-card .iwb-input {')
assert.ok(llm > 0, '找不到渠道卡片输入框规则')
assert.ok(css.slice(llm, css.indexOf('}', llm)).includes('height: auto'), '渠道卡片输入框应显式 height: auto')
// ── 2. 半像素字号在设置/外观范围内必须清零 ──
// 13.5px / 12.5px 这类值来自「凭手感调半像素」,闭集里没有它们;B4 范围内已全部并到 13/12。
// 范围外的(备份、右键菜单、插件市场卡)留给 B5/B6,这里不越界。
const SCOPE = /\.iwb-(settings-modal|appear|set|setcell|set-num|set-nav|set-page|set-row|set-main|setlabel|sethd|setalign|setx|sethint|seterr|setrow|setgrid|setopen)/
const halfPixel = []
css.split('\n').forEach((line, i) => {
const brace = line.indexOf('{')
if (brace < 0) return
if (!SCOPE.test(line.slice(0, brace))) return
if (/font-size:\s*[\d]+\.5px/.test(line)) halfPixel.push((i + 1) + ':' + line.trim().slice(0, 70))
})
assert.deepStrictEqual(halfPixel, [], '设置/外观范围内还有半像素字号')
// ── 3. 已删除的死规则不许回来 ──
// 判据:DOM 不渲染 + 插件不复用。删除前查过 dist/app.js 与 plugins/**(B3 的教训:只查产物会把插件契约误删)。
const DEAD = [
'.iwb-setcell', '.iwb-setgrid', '.iwb-setopen', '.iwb-ratio-mini', '.iwb-ratio-box',
'.iwb-set-row', '.iwb-set-page-head', '.iwb-appear-val', '.iwb-appear-note-only',
]
for (const cls of DEAD) {
const re = new RegExp('\\' + cls + '(?![-A-Za-z0-9_])')
assert.ok(!re.test(css), cls + ' 已确认无生产者(DOM 与插件都不再产出),不该重新出现')
}
// ── 4. 引用的 token 必须存在 ──
// `border-radius: var(--iwb-radius-pill)` 这种拼错不会报错、不会警告,声明整条失效,圆角静默变 0。
// 本批真踩到了:999px 的药丸圆角 token 叫 `--iwb-radius-full`,我写成了 `--iwb-radius-pill`,
// 亮色基线照样「看起来正常」(那几个胶囊不在基线视野里)。所以这条必须是断言,不能只靠审计脚本打印。
const defs = new Set([...tokens.matchAll(/(?:^|[\s;{])--[a-z0-9-]+\s*:/gim)]
.map((s) => s[0].trim().replace(/^[;{]/, '').trim().replace(/\s*:$/, '')))
for (const m2 of css.matchAll(/(?:^|[\s;{])--[a-z0-9-]+\s*:/gim)) {
defs.add(m2[0].trim().replace(/^[;{]/, '').trim().replace(/\s*:$/, ''))
}
// 运行时由 JS 写进 style 的变量(见 scripts/token-audit.js 的 RUNTIME_SET)
const RUNTIME = new Set(['--iwb-dock-l', '--iwb-dock-r', '--iwb-fb-k', '--iwb-node-color'])
const missing = [...new Set([...css.matchAll(/var\(\s*(--[a-z0-9-]+)/gi)].map((r) => r[1]))]
.filter((r) => !defs.has(r) && !RUNTIME.has(r))
assert.deepStrictEqual(missing, [], '引用了不存在的 token(声明会整条失效且没有报错)')
console.log('settings scope checks passed(控件等高 / 半像素清零 / ' + DEAD.length + ' 个死类名不复现 / ' + defs.size + ' 个 token 引用全部有定义)')