feat(tokens): M6 延展验证 —— 面板合并重写 + 三个闭集缺口回填(3.26.51)
- style.css 插件面板两段六次叠加(1819-1885 / 2194-2295)合并成一份有意图的实现;133 行新增零裸值,净减 34 行,删 3 个死类与 1 条死兜底 - 新增 --iwb-font-base: 14px(8 档):全站 10 处标准正文原本在 13→15 之间无处安放;走 gen-tokens 单一源同步 CSS/DTCG/快照 - derive() 亮色状态色调深(ok #15803d / err #b91c1c / warn #b45309,暗色不变)—— --iwb-ok 原本对浅页面仅 2.13 却一直当文字色用 - theme-contrast-test 补 3 状态色 × 4 表面 × 2 主题,114 → 138 对 - 新增 ⑦⑧ 组件夹具基线(桌面端面板在网页 e2e 不可达),夹具内禁用 transition 消除 1 级灰度随机 diff;16 张连跑两次全绿 - batch-export 1.2.2 同步(内容寻址 + SRI):状态色走宿主 token,去掉纯蓝主按钮 - 棘轮基线首次下调:字号 159 / 圆角 95 / 间距 377 / hex 79 / 圆角种数 17 / 阴影 44 - 文档:规范 §5.7 接入案例、§3.3 第 8 档、修正 §5.2 里不存在的 --iwb-dur-* 引用;计划 M6 执行结果与度量看板
This commit is contained in:
1 parent
46008b4d8b
commit
21554b05ae
19 files changed
+527
-214
No files matched your search
@@ -14,6 +14,54 @@
|
||||
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
|
||||
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
|
||||
|
||||
## v3.26.51(2026-11-23)M6 延展验证:照着规范写一遍,撞出来的才是真问题
|
||||
|
||||
> **状态:待发布**(`verify:ci` 全绿;16 张视觉基线连跑两次全绿;本批只出本地安装包与源码提交,未上线)
|
||||
|
||||
M5 装完闸门,M6 的任务不是再迁移一批数字,而是**证明这套东西真的能照着写**。
|
||||
选了插件管理面板(设置行 / 列表 / 开关 / 工具条 / 筛选胶囊 / 卡片墙,覆盖面够)和
|
||||
`batch-export` 插件各写一遍。顺的地方不用记,**卡住的三处才是需要修的地方**——
|
||||
都回去改了 token 和守卫,没有在文档里糊过去。
|
||||
|
||||
**① 面板合并重写(133 行新增,0 处裸值)**
|
||||
|
||||
这段样式原本是 v3.26.24 → v3.26.27 六次叠加:`.iwb-mk-list` 的 `gap` 写过 3 次、
|
||||
`.iwb-mk-grid` 3 次、主按钮背景 4 次、`.iwb-set-page` 的 `max-width` 一改一撤,
|
||||
最终值散在 `style.css` 两处相隔 300 行的位置。按当前生效值**重写成一份**,
|
||||
删掉 3 个零引用类和 1 条永不生效的 `var(--iwb-ok, #1d9e75)` 死兜底。
|
||||
`style.css` 净减 34 行,`lint:tokens` 对全部新增行放行。
|
||||
|
||||
**② 撞出来的三个缺口**
|
||||
|
||||
- **闭集缺 14px**:表单行标题、命令输入、帮助正文全站 10 处,13→15 跨 2px 无处安放。
|
||||
补 `--iwb-font-base: 14px`(7→8 档),走 `gen-tokens.js` 单一源同步 CSS / DTCG / 快照。
|
||||
- **状态色不能当文字色**:`--iwb-ok` 亮色 `#22c55e` 对浅页面对比只有 **2.13**,
|
||||
而 `.iwb-status-ok` / `.iwb-ratio.ok` 一直直接拿它当文字色 —— M5 的 114 对守卫只查
|
||||
text/text2/dim/brandText,把这类漏了。`derive()` 亮色状态色调深
|
||||
(ok `#15803d` / err `#b91c1c` / warn `#b45309`,暗色不变),守卫补 24 对 → **138 对**。
|
||||
- **最乱的面板没有截图保护**:`DesktopPluginsTab` 只在 `isDesk()` 时渲染,网页 e2e 走另一条分支。
|
||||
新增 ⑦⑧ 组件夹具基线(同类名 + 真实 `dist/style.css` + 构造 DOM),亮暗共 **16 张**。
|
||||
夹具里必须 `transition:none` —— 开关 `.15s` 收尾会让两次截图差 7 个像素 × 1 级灰度,
|
||||
`threshold: 0` 就会随机红。
|
||||
|
||||
**③ `batch-export` 1.2.2(插件仓)**
|
||||
|
||||
文件级豁免那一半在 B6 已清零,本批做另一半:状态色改走宿主语义 token(保留私有值兜底,
|
||||
脱离宿主不退化);去掉与「全灰阶、无蓝」冲突的纯蓝主按钮,改成 `text`/`layer` 成对反相;
|
||||
热按钮从「实心绿 + 白字」改成绿描边 + 绿字 + 14% 绿底。实测亮色主按钮对比 **9.51**、暗色 **14.10**;
|
||||
状态色对页面亮 5.38/6.95、暗 10.01/7.03。
|
||||
|
||||
**④ 存量真的降了(棘轮装好后第一次)**
|
||||
|
||||
字号写死 170→159、圆角 103→95、间距 415→377、hex 84→79、圆角种数 18→17、阴影 45→44,
|
||||
已写回 `tests/fixtures/token-baseline.json`。闸门管增量、真实改版清存量,分工成立。
|
||||
|
||||
**文档**:规范新增 §5.7 接入案例(两份实现的决策表 + 三个缺口 + 照抄清单);
|
||||
顺手修掉 §5.2 里「动效用 `--iwb-dur-*`」这条会让人踩空的说明 —— 该 token 根本不存在,
|
||||
现改为明确标注「动效尚未 token 化」这个已知缺口。
|
||||
|
||||
**M1–M6 全部完成**。本批未上线:插件 `[email protected]` 与客户端 v3.26.51 的发布动作留待确认。
|
||||
|
||||
## v3.26.50(2026-11-23)M5 闸门:让「下次又散掉」变得不可能
|
||||
|
||||
> **状态:待发布**(`verify:ci` 全绿含新闸门;零观感,视觉基线应 12/12 不变)
|
||||
|
||||
@@ -343,7 +343,7 @@ hover 完全没反馈。改成 `color-mix(text 10%, transparent)` 后两个主
|
||||
|
||||
**留给 RFC 的一件事**:遮罩色 `rgba(18,20,26,.72)` 没有对应 token(全仓 3 处遮罩各写一份),硬凑 `bg`/`panel` 会让亮色主题出现浅色遮罩 —— 登记 `/*iwb:raw-until=3.28.0*/`,待 `--iwb-scrim` 的取值与消费者定案。
|
||||
|
||||
### M6 延展验证(0.5d)
|
||||
### M6 延展验证(0.5d)—— ✅ 已完成 2026-11-23(v3.26.51)
|
||||
|
||||
| ID | 任务 | 验收 |
|
||||
|---|---|---|
|
||||
@@ -351,6 +351,23 @@ hover 完全没反馈。改成 `color-mix(text 10%, transparent)` 后两个主
|
||||
| T6.2 | 选 `plugin-batch-export`(15 处硬编码)改版并发一个 patch | 契约测试白名单移除该项;插件暗色正常 |
|
||||
| T6.3 | 把这次的两份实现写成「接入案例」附在规范 §5.2 下 | 后来者照抄即可 |
|
||||
|
||||
**执行结果**:
|
||||
|
||||
| ID | 做了什么 | 验收实测 |
|
||||
|---|---|---|
|
||||
| T6.1 ✅ | 把 `style.css` 里 v3.26.24→27 六次叠加的两段(1819–1885 / 2194–2295)**合并重写成一份**;删 3 个零引用类与 1 条死兜底;新增 `--iwb-font-base` 承接 14px 正文 | 133 行新增 → `lint:tokens` **0 处裸值**;`style.css` 净减 34 行;新增 ⑦⑧ 两张组件夹具基线,16 张连跑两次全绿 |
|
||||
| T6.2 ✅ | 文件级豁免那一半在 **B6 已提前完成**(`ALLOW_FILES` 6→0);本批改的是另一半:`batch-export` 状态色改走宿主语义 token + 保留私有值兜底,去掉与「全灰阶」冲突的纯蓝主按钮,发 **1.2.2** | 亮色主按钮对比 **9.51**、暗色 **14.10**;状态色对页面亮 5.38/6.95、暗 10.01/7.03;插件仓 `validate` 13/13、契约测试 0 文件豁免 |
|
||||
| T6.3 ✅ | 规范新增 **§5.7 接入案例**(两份实现的决策表 + 三个缺口 + 照抄清单);顺手修掉 §5.2 里「引用并不存在的 `--iwb-dur-*`」这条会让人踩空的说明 | 文档与代码同批复核 |
|
||||
|
||||
**三个被撞出来的缺口**(这才是 M6 的产出 —— 都回去改了 token/守卫,没有改文档糊过去):
|
||||
|
||||
1. **闭集缺 14px**:表单行标题、命令输入、帮助正文全站 10 处,13→15 跨 2px 无处安放 → 新增 `--iwb-font-base: 14px`(7→8 档)。
|
||||
2. **状态色不能当文字色**:`--iwb-ok` 亮色 `#22c55e` 对浅页面只有 **2.13**,而 `.iwb-status-ok` / `.iwb-ratio.ok` 一直这么用 → `derive()` 亮色状态色调深(暗色不变),`theme-contrast-test` 补 3 色 × 4 表面 × 2 主题,**114 → 138 对**。M5 的守卫只查 text/text2/dim/brandText,把这类漏了。
|
||||
3. **面板在网页 e2e 里不可达**:`DesktopPluginsTab` 只在 `isDesk()` 时渲染,最乱的样式反而没有截图保护 → 加组件夹具基线(同类名 + 真实 `dist/style.css` + 构造 DOM),并必须在夹具里关掉 `transition`,否则开关 `.15s` 收尾会让两次截图差 7 个像素 × 1 级灰度,`threshold: 0` 随机红。
|
||||
|
||||
**存量计数下调并写回棘轮基线**:字号 170→159、圆角 103→95、间距 415→377、hex 84→79、圆角种数 18→17、阴影 45→44。
|
||||
这是 M5 装上棘轮以来**第一次真正下降** —— 闸门管增量、真实改版清存量,分工成立。
|
||||
|
||||
## 5. 发布节奏
|
||||
|
||||
| 版本 | 内容 | 观感 | 备注 |
|
||||
@@ -363,7 +380,7 @@ hover 完全没反馈。改成 `color-mix(text 10%, transparent)` 后两个主
|
||||
| 3.26.48 | M4-B5 节点 | **有变化(暗色改善明显)** | 端口从「黑洞」变成可见小圆点、提示词节点高度 −4px、浮条阴影统一。用户能感知的是「深色画布上端口看得见了」,附放大对比图 |
|
||||
| 3.26.49 | M4-B6 ✅ | 肉眼零,基线 8 张变化 | 收尾:16 处半像素清零、`control-h` 不扩全局(裁定)、插件契约文件级豁免 **6 → 0**。②④⑤⑥ 含画布场景因字号栅格化变化更新基线,逐张核对无错位 |
|
||||
| 3.26.50 | M5 ✅ | 零 | 闸门上线:`lint:tokens`(只查新增行)+ 13 项棘轮 + 114 对对比度;三道闸门各打红一次 |
|
||||
| 3.26.51 | M6 | 零 | 案例沉淀(用 token 重做插件管理 + 改版 batch-export) |
|
||||
| 3.26.51 | M6 ✅ | 亮色状态色调深(见下) | 案例沉淀:合并重写插件面板 + batch-export 1.2.2 + 补 font-base 档 + 对比度守卫 114→138 |
|
||||
|
||||
> 前置:3.26.42(外观 v2)需先发,本计划从 3.26.43 起。
|
||||
> 插件侧:`batch-export` / `browser` / `image-vectorize` / `image-annotate` 各自在下次 patch 版本清硬编码,**不阻塞客户端**。
|
||||
@@ -373,24 +390,25 @@ hover 完全没反馈。改成 `color-mix(text 10%, transparent)` 后两个主
|
||||
| 指标 | 基线(实测) | M4 后目标 | M6 后目标 |
|
||||
|---|---|---|---|
|
||||
| 引用但未定义的变量 | 7 | 0 | 0 |
|
||||
| 字号档数 | 19 | 7(B6 后散值 **13**:半像素已全部清零,剩 8/10 微缩徽标与画布区的 14/16/18/22/28/30,属 M5 棘轮范围;闭集 7 档已建) | 7 |
|
||||
| 字号档数 | 19 | 7(B6 后散值 **13**;闭集 7 档已建) | **8**(M6 补 `--iwb-font-base`:14px,散值仍 13) |
|
||||
| 圆角档数 | 18 | 5 | 5 |
|
||||
| 间距档数 | 30 | ≤16 | ≤16 |
|
||||
| 字号写死处 | 268 | ≤60(B6 后 **170**) | ≤20 |
|
||||
| 圆角写死处 | 164 | ≤40(B6 后 **103**) | ≤10 |
|
||||
| 间距写死处 | 629 | ≤200(B6 后 **415**) | ≤80 |
|
||||
| 阴影写法种类 | 52 | ≤8 | 5 |
|
||||
| 字号写死处 | 268 | ≤60(B6 后 **170**) | ≤20(**M6 后 159**) |
|
||||
| 圆角写死处 | 164 | ≤40(B6 后 **103**) | ≤10(**M6 后 95**) |
|
||||
| 间距写死处 | 629 | ≤200(B6 后 **415**) | ≤80(**M6 后 377**) |
|
||||
| 阴影写法种类 | 52 | ≤8 | 5(**M6 后 44**,存量待清) |
|
||||
| z-index 取值种类 | 42 | ≤10(B2 后 **31**) | 9 |
|
||||
| `var(--iwb-layer)` 引用 | 59(一词多义) | 0(已拆) | 0 |
|
||||
| 暗色硬编码色行 | 24 | 0 | 0 |
|
||||
| text 对表面 <4.5 的格数 | 暗色 4 格 | 0 | 0 |
|
||||
| 插件契约白名单文件 | 6(文件级豁免) | 0(B6 起按角色分类:私有皮肤自声明 + 强调色 chroma 判据 + 内容色行内标记) | 0 |
|
||||
| 视觉基线 diff | 无基线 | 每批 0 | 每批 0 |
|
||||
| 视觉基线 diff | 无基线 | 每批 0 | **16 张**(M6 新增 ⑦⑧ 组件夹具;每批 0 diff) |
|
||||
| **新增裸值(增量)** | 无闸门 | **0/PR**(M5:`lint:tokens` 只查新增行) | 0 |
|
||||
| **对比度达标对** | 未度量 | **114/114**(M5:亮/暗 × 文字 × 表面) | 114/114 |
|
||||
| **对比度达标对** | 未度量 | **114/114**(M5:亮/暗 × 文字 × 表面) | **138/138**(M6 补状态色 24 对) |
|
||||
|
||||
**M5 后(v3.26.50)**:存量计数**一个没变**(字号 170 / 圆角 103 / 间距 415 / z-index 31)—— 这一批只装闸门,不动样式。
|
||||
棘轮已把基线钉在 `tests/fixtures/token-baseline.json`:从这一版起存量只能降,涨一个就红。存量清理留给 M6 起的真实改版(改哪个面板就清哪块)。
|
||||
**M6 后(v3.26.51)**:**第一次真正下降** —— 字号 159 / 圆角 95 / 间距 377 / hex 79 / 圆角种数 17 / 阴影 44,
|
||||
已写回棘轮基线。同时补齐两处「规范自称有、实际没有」的地方:`--iwb-font-base`(14px) 与状态色对比度守卫(138 对)。
|
||||
M1–M6 全部完成,设计 token 从「铺完」走到「能照着写、有闸门、有回归」。
|
||||
|
||||
## 7. 风险登记
|
||||
|
||||
|
||||
@@ -523,18 +523,26 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
|
||||
|
||||
### 3.3 字号 / 行高 / 字重
|
||||
|
||||
**已落地(v3.26.44,M4-B1)**:6 档。**v3.26.46(M4-B3)补第 7 档 `display`**。
|
||||
**已落地(v3.26.44,M4-B1)**:6 档。**v3.26.46(M4-B3)补第 7 档 `display`**;
|
||||
**v3.26.51(M6)补第 8 档 `base`**。
|
||||
|
||||
| token | 值 | 归并掉 | 用途 |
|
||||
|---|---|---|---|
|
||||
| `--iwb-font-xs` | 11px | 10, 11.5 | 状态栏、徽标、辅助信息 |
|
||||
| `--iwb-font-sm` | 12px | 12.5 | **默认正文 / 标签**(UI 里出现最多) |
|
||||
| `--iwb-font-md` | 13px | 13.5, **14** | 面板正文、列表项、工具栏标题 |
|
||||
| `--iwb-font-lg` | 15px | 14, 15.5, **16** | 小标题、节点标题、卡片标题 |
|
||||
| `--iwb-font-xl` | 17px | 16, 17.5, **18** | 面板标题、侧栏标题、图标字形 |
|
||||
| `--iwb-font-2xl` | 20px | 18, 19, 22 | 页面大标题 |
|
||||
| `--iwb-font-md` | 13px | 13.5 | **紧凑**正文、列表项、工具栏标题 |
|
||||
| `--iwb-font-base` | 14px | 14 | **标准正文**:表单行标题、命令输入、帮助正文、尺寸数字 |
|
||||
| `--iwb-font-lg` | 15px | 15.5, **16** | 小标题、节点标题、卡片标题 |
|
||||
| `--iwb-font-xl` | 17px | 17.5, **18** | 面板标题、侧栏标题、图标字形 |
|
||||
| `--iwb-font-2xl` | 20px | 19, 22 | 页面大标题 |
|
||||
| `--iwb-font-display` | 24px | **26, 28, 30** | 展示级标题:页面/视图主标题(全仓 ≤5 处) |
|
||||
|
||||
> **为什么补第 8 档(M6 重做插件面板时定的)**:B1 的表里 14px 同时挂在 `md(13)` 和 `lg(15)`
|
||||
> 的「归并掉」列 —— 两边都声称收了它,实际全站**还剩 10 处**(表单行标题、命令输入、帮助正文、
|
||||
> 尺寸数字),角色全是「标准正文」。13 偏小、15 偏大,硬塞就是「每次改版都要重新选一个错的」。
|
||||
> 14 是浏览器默认正文字号,13→15 之间跨 2px 本来就该有落脚点。补一档比继续塞诚实。
|
||||
> `base` 不在 t-shirt 序列里是有意的:它表示「正文字号基准」,不是「比 md 大一点」。
|
||||
|
||||
> **为什么补第 7 档(B3 归并 26px 时定的)**:首页主标题原本 26px,压到 `2xl(20)` 会与面板标题同级,
|
||||
> 页面层级直接塌掉(用户看到的是「标题变小了」而不是「变整齐了」)。`display` 只给**页面级**标题用,
|
||||
> 与 `2xl`(区块级)隔一档;全仓当前只有 26/28/30px 三处候选,不构成新的散值来源。
|
||||
@@ -791,14 +799,15 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
|
||||
1. 先翻 §3 找现成 L2,**80% 的情况不需要新 token**
|
||||
2. 颜色只用语义色(`--iwb-text` / `--iwb-text2` / `--iwb-layer2` / `--iwb-field` / `--iwb-border` / `--iwb-brand`),不写 `#hex`/`rgba()`
|
||||
3. 间距只用 `--iwb-space-{2..64}`
|
||||
4. 字号只用 `--iwb-font-{xs,sm,md,lg,xl,2xl,display}`(禁止 10.5/11.5/12.5/13.5 这类半像素)
|
||||
4. 字号只用 `--iwb-font-{xs,sm,md,base,lg,xl,2xl,display}`(禁止 10.5/11.5/12.5/13.5 这类半像素)
|
||||
5. 圆角只用 `--iwb-radius-{chip,control,card,panel,popover,full}`
|
||||
6. 浮层阴影用 `--iwb-elevation-{1..4}`,暗色另有描边
|
||||
7. z-index 用 `--iwb-z-*`,插件不得高于 `--iwb-z-anchor`(3200)
|
||||
8. 动效用 `--iwb-dur-*` + `--iwb-ease-*`,并支持 reduced-motion
|
||||
8. 动效时长(`transition`)**尚未 token 化**——这是 M6 实测后登记的已知缺口,先沿用现有 `.12s/.14s/.15s`,别去引用并不存在的 `--iwb-dur-*`
|
||||
9. 亮/暗各截一张图放进 PR
|
||||
|
||||
第 2–7 步现在**有机器守卫兜着**:写完跑 `npm run lint:tokens`,它会指着 `file:line` 告诉你哪一行漏了。
|
||||
第 8 步是唯一没有守卫的一项,因为它连闭集都还没有;不要因为「规范里写了」就以为 token 存在。
|
||||
|
||||
### 5.3 token 变更的版本与弃用
|
||||
|
||||
@@ -840,6 +849,57 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
|
||||
| `theme-contrast-test` 红了 | 调色改坏了某对「文字 × 表面」。改回去,或用 `clampAgainst` 重新夹紧;阈值在 `theme-tokens.js` 的 `RATIO`,别在测试里改数字 |
|
||||
| 想全局看存量 | `node scripts/token-lint.js --file style.css`(整文件模式,迁移时用) |
|
||||
|
||||
### 5.7 接入案例(M6 实录,照抄即可)
|
||||
|
||||
M6 用这套 token **重做了插件管理面板**(设置行 / 列表 / 开关 / 工具条 / 筛选胶囊 / 卡片墙),
|
||||
并改版了 `batch-export` 插件。目的不是再迁移一批数字,而是验证「照着规范写」到底顺不顺。
|
||||
结论:**顺的地方不用记,卡住的三处才是这套系统真正需要修的地方**——都回去改了 token 和守卫,
|
||||
没有在文档里糊过去。
|
||||
|
||||
#### 案例 A:面板样式的合并重写
|
||||
|
||||
原始状态是 v3.26.24 → v3.26.27 六次叠加:`.iwb-mk-list` 的 `gap` 写过 3 次、`.iwb-mk-grid` 3 次、
|
||||
主按钮背景 4 次、`.iwb-set-page` 的 `max-width` 一改一撤。同一个最终值散在两处(1819–1885 / 2194–2295),
|
||||
读的人要在心里跑一遍层叠。做法是**按当前生效值重写一份**,不是逐行翻译:
|
||||
|
||||
| 旧值 | 新写法 | 为什么 |
|
||||
|---|---|---|
|
||||
| `font-size: 14px`(行名 / 设置行标题) | `var(--iwb-font-base)` | 闭集原本 13→15 跨 2px,14 无处安放(见缺口 ①) |
|
||||
| `gap: 10px` / `gap: 14px` / `gap: 6px` | `--iwb-space-10/12/6` | 叠加后的多个值统一按语义选一档 |
|
||||
| `border-radius: 14px`(卡片) | `--iwb-radius-card`(10px) | 卡片用 card 档,14px 是 popover 档的语义 |
|
||||
| `border-radius: 999px`(胶囊/开关) | `--iwb-radius-full` | 药丸统一 |
|
||||
| `padding: 14px 2px` / `margin: 4px 0 10px` | `--iwb-space-12/-2` / `-4 0 -10` | 就近归并,逐条看过没有挤出容器 |
|
||||
| `var(--iwb-ok, #1d9e75)` 的死兜底 | `var(--iwb-ok)` | 该 token 亮暗都有定义,兜底永不生效,只会误导 |
|
||||
| 3 个零引用类 | 删除 | 全仓 JS 里没有引用(改前先做存活比对,别按 dist 计数误删) |
|
||||
|
||||
**验收**:`npm run lint:tokens` 对这 133 行新增报 **0 处裸值**;`style.css` 净减 34 行;
|
||||
字号写死 170→159、圆角 103→95、间距 415→377。新增 ⑦⑧ 两张基线(组件夹具,见下)。
|
||||
|
||||
#### 案例 B:插件改版(`batch-export` 1.2.2)
|
||||
|
||||
插件是「宿主 token + 私有强调色」混合型,B6 已把文件级豁免清零,本批做的是**让状态色真正跟主题走**:
|
||||
|
||||
| 旧写法 | 新写法 | 收益 |
|
||||
|---|---|---|
|
||||
| 成功 `#1d9e75` / 错误 `#d85a30` | `var(--iwb-ok,…)` / `var(--iwb-err,…)`(带私有值兜底) | 暗色自动变亮,脱离宿主独立运行也不退化 |
|
||||
| 主按钮纯蓝 `#2f6fed` + 白字 | `var(--iwb-text)` 底 + `var(--iwb-layer)` 字 | 去掉与「全灰阶、无蓝」冲突的蓝;亮/暗自动反相(对比 9.51 / 14.10) |
|
||||
| 热按钮实心绿 + 白字 | 绿描边 + 绿字 + 14% 绿底 | 暗色下亮绿底压白字本来就不够对比 |
|
||||
| 状态色直接当文字色 | `color-mix(in srgb, var(--iwb-ok) 82%, var(--iwb-text))` | 照 §3 的 `iwb-mk-badge` 范例压深,亮暗都读得清 |
|
||||
|
||||
`var()` 一律保留字面兜底:插件可能在宿主样式生效前渲染,也可能被单独加载。
|
||||
|
||||
#### 三个被撞出来的缺口(这才是延展验证的产出)
|
||||
|
||||
| # | 撞到什么 | 回去改了什么 |
|
||||
|---|---|---|
|
||||
| ① | 表单行标题是 14px,闭集只有 11/12/13/15/17/20/24;全站 10 处 14px 全是「正文/输入」角色 | `gen-tokens.js` 新增 `--iwb-font-base: 14px`(8 档)。**补档而不是把 14 塞进 13 或 15**——它不是一处特例 |
|
||||
| ② | `--iwb-ok` 亮色 `#22c55e` 对浅页面对比只有 **2.13**,而 `.iwb-status-ok` / `.iwb-ratio.ok` 一直直接拿它当文字色 | `derive()` 亮色状态色调深(ok `#15803d` / err `#b91c1c` / warn `#b45309`,暗色不变);`theme-contrast-test` 补 3 色 × 4 表面 × 2 主题 = **114 → 138 对**。M5 的守卫只查 text/text2/dim/brandText,把状态色漏了 |
|
||||
| ③ | 桌面端面板在网页 e2e 里不可达(`isDesk()` 走另一条分支),最乱的样式反而没有截图保护 | 加组件夹具基线:同一套类名 + 真实 `dist/style.css` + 构造 DOM。夹具里必须 `transition:none!important`——开关 `.15s` 过渡收尾会让两次截图差 1 级灰度、7 个像素,`threshold:0` 就会随机红 |
|
||||
|
||||
**照抄清单**:先按 §3 查现成 L2 → 写完跑 `lint:tokens` → 亮暗各截一张(组件够不到就用夹具,记得关过渡)→
|
||||
如果某值在闭集里找不到落脚点,**先怀疑闭集缺了一档**,再决定是归并还是补档 → 补完档同步
|
||||
`gen-tokens.js` / 快照 / 度量看板 / 对比度守卫,别只改 CSS。
|
||||
|
||||
---
|
||||
|
||||
## 6. 现有页面统一清单(按优先级)
|
||||
@@ -910,7 +970,7 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
|
||||
| # | 决定 | 裁定 | 影响与执行口径 |
|
||||
|---|---|---|---|
|
||||
| ① | 面板圆角 | **14px**(`radius-panel`) | 浮层(modal/fullmask/菜单/命令面板)统一 14;`popover` 用 12,`control` 用 8,`chip` 用 6,`round` 用 999。节点保持 `--iwb-node-radius`(默认 14)不受影响 |
|
||||
| ② | 半像素字号 | **并入整数档**(10.5→11、11.5→12、12.5→12、13.5→13)|**已执行**:B3 清首页/库、B4 清设置/外观、**B6 清剩余 16 处** | 闭集落在 7 档:11 / 12 / 13 / 15 / 17 / 20 / 24。迁移时逐条看换行,只允许「文案变短一行」不允许「挤出容器」。B6 全部清零:备份页 2、右键菜单 1、操作日志 1、确认框 1、插件市场卡 9、资源浮标/继承条各 1;其中市场卡的 `.iwb-mk-card .iwb-mk-name/.iwb-mk-sub` 两条归并后与全局同档,作为重复声明删除 |
|
||||
| ② | 半像素字号 | **并入整数档**(10.5→11、11.5→12、12.5→12、13.5→13)|**已执行**:B3 清首页/库、B4 清设置/外观、**B6 清剩余 16 处** | 闭集落在 **8 档**:11 / 12 / 13 / 14(base) / 15 / 17 / 20 / 24(M6 补 14)。迁移时逐条看换行,只允许「文案变短一行」不允许「挤出容器」。B6 全部清零:备份页 2、右键菜单 1、操作日志 1、确认框 1、插件市场卡 9、资源浮标/继承条各 1;其中市场卡的 `.iwb-mk-card .iwb-mk-name/.iwb-mk-sub` 两条归并后与全局同档,作为重复声明删除 |
|
||||
| ③ | 间距迁移 | **先等值替换**,收敛另起一轮 | M4 只换写法不换值(0 diff);30 档 → 16 档的收敛放到 M4 之后单独一批,届时逐屏对照 |
|
||||
| ④ | 色彩模型修复范围 | **全修 D1–D9**,但**分两版**:3.26.43 只放 D1(零观感),D3/D4/D5/D6/D7/D8/D9 放 3.26.44 | D1 = 单一写入点(消闪变、修系统转暗不生效),观感零风险;其余会改变暗色观感,单独发版并附亮/暗对比图 |
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.26.50",
|
||||
"version": "3.26.51",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
[
|
||||
{
|
||||
"id": "batch-export",
|
||||
"file": "plugin-batch-export.4beb9bc20c26.js",
|
||||
"version": "1.2.1",
|
||||
"integrity": "sha256-S+ubwgwmP+6V2GNX1sWsL/QpV3kx9+qCo5SYl4a1NFA="
|
||||
"file": "plugin-batch-export.44c13ac8e6d9.js",
|
||||
"version": "1.2.2",
|
||||
"integrity": "sha256-RME6yObZW4tKMZmfwtaIX4iODMFlo57baLn/y0GZbfU="
|
||||
},
|
||||
{
|
||||
"id": "blank-canvas",
|
||||
|
||||
+20
-10
@@ -454,37 +454,47 @@
|
||||
'.iwb-bx-name{flex:1;min-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
||||
'.iwb-bx-tag{font-size:11px;white-space:nowrap;color:var(--iwb-text2,#4d5668);',
|
||||
'max-width:46%;min-width:0;overflow:hidden;text-overflow:ellipsis}',
|
||||
'.iwb-bx-tag-ok{color:#1d9e75}',
|
||||
'.iwb-bx-tag-err{color:#d85a30}',
|
||||
// 状态色不能直接当文字色:宿主 --iwb-ok 亮色是 #22c55e,压在浅页面上对比只有 2.13。
|
||||
// 照 design-tokens.md §3 的 iwb-mk-badge 范例,用 color-mix 往 --iwb-text 压 18%,亮暗两端都读得清。
|
||||
'.iwb-bx-tag-ok{color:color-mix(in srgb,var(--iwb-ok,#1d9e75) 82%,var(--iwb-text,#1c2333))}',
|
||||
'.iwb-bx-tag-err{color:color-mix(in srgb,var(--iwb-err,#d85a30) 82%,var(--iwb-text,#1c2333))}',
|
||||
// 行内单张下载:常驻不悬浮(要一眼看出「这行能下什么」),无产物时灰掉但保留占位,
|
||||
// 避免产物出现时行宽突然变化导致列表跳动。
|
||||
'.iwb-bx-dl{flex:0 0 auto;padding:2px 6px;border-radius:5px;font-size:11px;line-height:1.5;',
|
||||
'font-family:ui-monospace,SFMono-Regular,Menlo,monospace;border:1px solid var(--iwb-border,#d5d9e0);',
|
||||
'background:transparent;color:var(--iwb-text2,#4d5668);cursor:pointer}',
|
||||
'.iwb-bx-dl-on{background:var(--iwb-layer,#f0f1f4);color:var(--iwb-text,#1c2333);border-color:var(--iwb-text2,#4d5668)}',
|
||||
'.iwb-bx-dl-on:hover{border-color:#2f6fed;color:#2f6fed}',
|
||||
'.iwb-bx-dl-on:hover{border-color:var(--iwb-brand,#2f6fed);color:var(--iwb-brand-text,#2f6fed)}',
|
||||
'.iwb-bx-dl[disabled]{opacity:.45;cursor:not-allowed;border-color:var(--iwb-border,#d5d9e0)}',
|
||||
'.iwb-bx-empty{padding:24px 12px;text-align:center;color:var(--iwb-text2,#4d5668)}',
|
||||
// 缩略图:小方图(30px)常驻在行首,跑完换成产物本身,一眼能对上「哪张图、出了什么」
|
||||
'.iwb-bx-thumb{width:30px;height:30px;flex:0 0 auto;object-fit:contain;border-radius:5px;',
|
||||
'border:1px solid var(--iwb-border,#d5d9e0);background:#fff/*iwb:content*/;cursor:zoom-in;padding:1px}',
|
||||
'.iwb-bx-thumb-out{border-color:#1d9e75;cursor:zoom-in}',
|
||||
'.iwb-bx-thumb-out{border-color:var(--iwb-ok,#1d9e75);cursor:zoom-in}',
|
||||
'.iwb-bx-thumb-ph{background:var(--iwb-layer,#f0f1f4);cursor:default}',
|
||||
'.iwb-bx-done{display:none;align-items:center;gap:6px;padding:9px 12px;font-size:11px;',
|
||||
'color:#1d9e75;background:rgba(29,158,117,.08);border-top:1px solid var(--iwb-border,#d5d9e0)}',
|
||||
'color:color-mix(in srgb,var(--iwb-ok,#1d9e75) 82%,var(--iwb-text,#1c2333));',
|
||||
'background:color-mix(in srgb,var(--iwb-ok,#1d9e75) 8%,transparent);',
|
||||
'border-top:1px solid var(--iwb-border,#d5d9e0)}',
|
||||
'.iwb-bx-zoom{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;',
|
||||
'background:rgba(0,0,0,.72);cursor:zoom-out}',
|
||||
'.iwb-bx-zoom img{max-width:86vw;max-height:86vh;border-radius:8px;background:#fff/*iwb:content*/}',
|
||||
// 双类选择器:单靠 .iwb-bx-btn-hot 会被后定义的 .iwb-bx-btn 背景覆盖(同特异性,后者胜)
|
||||
'.iwb-bx-btn.iwb-bx-btn-hot{background:#1d9e75;border-color:#1d9e75;color:#fff}',
|
||||
// 主/热按钮此前是纯蓝 #2f6fed 实心 + 白字:与项目「全灰阶、无蓝」的配色约束冲突,
|
||||
// 且暗色下亮绿底压白字对比度不足。改成宿主语义色成对反相 + 状态色描边,
|
||||
// var() 兜底保留私有值,脱离宿主独立运行时不退化。
|
||||
'.iwb-bx-btn.iwb-bx-btn-hot{',
|
||||
'background:color-mix(in srgb,var(--iwb-ok,#1d9e75) 14%,transparent);',
|
||||
'border-color:color-mix(in srgb,var(--iwb-ok,#1d9e75) 82%,var(--iwb-text,#1c2333));',
|
||||
'color:color-mix(in srgb,var(--iwb-ok,#1d9e75) 82%,var(--iwb-text,#1c2333))}',
|
||||
'.iwb-bx-foot{display:flex;align-items:center;gap:8px;padding:10px 12px;',
|
||||
'border-top:1px solid var(--iwb-border,#d5d9e0)}',
|
||||
'.iwb-bx-prog{flex:1;height:4px;border-radius:2px;background:var(--iwb-border,#d5d9e0);overflow:hidden}',
|
||||
'.iwb-bx-prog i{display:block;height:100%;width:0;background:#2f6fed;transition:width .15s}',
|
||||
'.iwb-bx-prog i{display:block;height:100%;width:0;background:var(--iwb-brand-text,#2f6fed);transition:width .15s}',
|
||||
'.iwb-bx-btn{padding:5px 10px;border-radius:6px;border:1px solid var(--iwb-border,#d5d9e0);',
|
||||
'background:var(--iwb-layer,#f0f1f4);color:inherit;font:inherit;cursor:pointer;white-space:nowrap}',
|
||||
'.iwb-bx-btn[disabled]{opacity:.45;cursor:not-allowed}',
|
||||
'.iwb-bx-btn-primary{background:#2f6fed;border-color:#2f6fed;color:#fff}',
|
||||
'.iwb-bx-btn-primary{background:var(--iwb-text,#2f6fed);border-color:var(--iwb-text,#2f6fed);',
|
||||
'color:var(--iwb-layer,#fff)}',
|
||||
].join('')
|
||||
|
||||
function ensureStyle() {
|
||||
@@ -500,7 +510,7 @@
|
||||
global.IWBPluginHost.register({
|
||||
id: 'batch-export',
|
||||
name: '批量出图',
|
||||
version: '1.2.1',
|
||||
version: '1.2.2',
|
||||
apiVersion: 1,
|
||||
capabilities: ['panels', 'canvas'],
|
||||
settings: {
|
||||
@@ -117,7 +117,11 @@ const SCALE = [
|
||||
['--iwb-radius-full', '999px', '圆形/药丸'],
|
||||
['--iwb-font-xs', '11px', 'M4 字号:状态栏/徽标'],
|
||||
['--iwb-font-sm', '12px', '标签/次要正文'],
|
||||
['--iwb-font-md', '13px', '正文/工具栏标题'],
|
||||
['--iwb-font-md', '13px', '紧凑正文/工具栏标题'],
|
||||
// 14px 是浏览器默认正文字号,也是全站第四高频(M6 实测 10 处:表单行标题、命令输入、
|
||||
// 帮助正文、尺寸数字)。闭集原本 13 → 15 跨 2px,中间有洞,凡是「标准正文」都无处安放,
|
||||
// 只能就近塞进 13(偏小)或 15(偏大)。补这一档而不是继续塞,是因为它不是一处特例。
|
||||
['--iwb-font-base', '14px', '标准正文:表单行标题/命令输入/帮助正文'],
|
||||
['--iwb-font-lg', '15px', '小标题/节点标题'],
|
||||
['--iwb-font-xl', '17px', '面板标题'],
|
||||
['--iwb-font-2xl', '20px', '页面大标题'],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.26.50"
|
||||
version = "3.26.51"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.26.50",
|
||||
"version": "3.26.51",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -69,9 +69,9 @@
|
||||
--iwb-plugin-inset: #ebebeb;
|
||||
--iwb-plugin-hover: #e2e2e2;
|
||||
/* —— 语义色 —— */
|
||||
--iwb-err: #ef4444;
|
||||
--iwb-ok: #22c55e;
|
||||
--iwb-warn: #d97706;
|
||||
--iwb-err: #b91c1c;
|
||||
--iwb-ok: #15803d;
|
||||
--iwb-warn: #b45309;
|
||||
/* —— 尺度层(L1)—— */
|
||||
--sp-1: 4px; /* @deprecated 全部 5 个 → M3 的 --iwb-space-4/8/12/16/24 */
|
||||
--sp-2: 8px;
|
||||
@@ -111,7 +111,8 @@
|
||||
--iwb-radius-full: 999px; /* 圆形/药丸 */
|
||||
--iwb-font-xs: 11px; /* M4 字号:状态栏/徽标 */
|
||||
--iwb-font-sm: 12px; /* 标签/次要正文 */
|
||||
--iwb-font-md: 13px; /* 正文/工具栏标题 */
|
||||
--iwb-font-md: 13px; /* 紧凑正文/工具栏标题 */
|
||||
--iwb-font-base: 14px; /* 标准正文:表单行标题/命令输入/帮助正文 */
|
||||
--iwb-font-lg: 15px; /* 小标题/节点标题 */
|
||||
--iwb-font-xl: 17px; /* 面板标题 */
|
||||
--iwb-font-2xl: 20px; /* 页面大标题 */
|
||||
|
||||
+6
-3
@@ -174,9 +174,12 @@
|
||||
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'
|
||||
// 亮色状态色必须能**直接当文字色**(.iwb-status-ok / .iwb-ratio.ok / 插件状态标签都这么用)。
|
||||
// 原先 #22c55e / #ef4444 / #d97706 对浅页面只有 2.1 / 3.5 / 3.0,M6 给 batch-export
|
||||
// 接 token 时实测撞到;暗色仍用原来的亮色版本(对深页面本来就够)。
|
||||
const err = d ? mix('#ef4444', '#ffffff', 0.18) : '#b91c1c'
|
||||
const ok = d ? mix('#22c55e', '#ffffff', 0.18) : '#15803d'
|
||||
const warn = d ? mix('#d97706', '#ffffff', 0.22) : '#b45309'
|
||||
// 品牌色上的文字:按对比度自动选黑/白
|
||||
const onBrand = contrast('#ffffff', brand) >= RATIO.onBrand ? '#ffffff' : '#1c2333'
|
||||
|
||||
|
||||
@@ -1816,73 +1816,145 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-confirm-title { font-weight: 650; font-size: 15px; margin-bottom: 8px; }
|
||||
.iwb-confirm-text { font-size: var(--iwb-font-md); line-height: 1.65; color: var(--iwb-text2); white-space: pre-wrap; word-break: break-word; }
|
||||
.iwb-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
|
||||
/* 插件市场卡片(设置 → 插件 / 与 market.maqiart.eu.org 同一套视觉) */
|
||||
.iwb-mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 4px 0 6px; }
|
||||
.iwb-mk-head { display: flex; }
|
||||
.iwb-mk-avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 36px; }
|
||||
.iwb-mk-name { display: flex; align-items: center; flex-wrap: wrap; }
|
||||
.iwb-mk-desc { flex: 1 1 auto; }
|
||||
.iwb-mk-tags { display: flex; flex-wrap: wrap; }
|
||||
/* ── 插件管理 / 插件市场(M6 重做)───────────────────────────────────────
|
||||
* 这一段原本是 v3.26.24 → v3.26.27 六次叠加的结果,读者要先在心里跑一遍层叠才知道最终值:
|
||||
* .iwb-mk-list gap 写过 3 次(无 → 8 → 0) .iwb-mk-grid gap 写过 3 次(10 → 14 → 12)
|
||||
* .iwb-mk-actions .iwb-btn 背景改过 4 次 .iwb-set-page max-width 一改一撤
|
||||
* M6 把它合成一份:布局写一次、视觉写一次,排版属性全部落闭集(M5 的 lint:tokens 对新增行
|
||||
* 生效,这一段是按闸门要求写出来的第一个完整面板——案例见 docs/standards/design-tokens.md §5.2)。
|
||||
* 顺带删掉 3 个全仓零引用的类(筛选条旧容器、绿色状态点、旧分隔条)。
|
||||
*/
|
||||
.iwb-set-page { max-width: none; }
|
||||
.iwb-set-page-title { margin-bottom: var(--iwb-space-2); }
|
||||
|
||||
.iwb-mk-actions { display: flex; justify-content: flex-end; margin-top: 2px; }
|
||||
/* 开关 */
|
||||
/* 工具条:搜索框 + 标签筛选。用块面底色分区,不画线框 */
|
||||
.iwb-mk-toolbar {
|
||||
display: flex; flex-wrap: wrap; align-items: center; gap: var(--iwb-space-8);
|
||||
background: var(--iwb-layer);
|
||||
border: 1px solid color-mix(in srgb, var(--iwb-border) 45%, transparent);
|
||||
border-radius: var(--iwb-radius-panel);
|
||||
padding: var(--iwb-space-8) var(--iwb-space-10);
|
||||
margin: var(--iwb-space-6) 0 var(--iwb-space-12);
|
||||
}
|
||||
.iwb-mk-toolbar .iwb-input { border: 0; background: var(--iwb-layer2); box-shadow: none; }
|
||||
.iwb-mk-toolbar .iwb-input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand) 22%, transparent); }
|
||||
.iwb-mk-subtitle { font-size: var(--iwb-font-sm); color: var(--iwb-text2); margin: var(--iwb-space-2) 0 var(--iwb-space-10); }
|
||||
|
||||
/* 筛选胶囊:底色比工具条深一档,否则 layer 叠 layer 等于没有边界 */
|
||||
.iwb-mk-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--iwb-space-6); margin: 0; }
|
||||
.iwb-mk-chip {
|
||||
cursor: pointer; border: 0;
|
||||
background: var(--iwb-layer2); color: var(--iwb-text2);
|
||||
padding: var(--iwb-space-4) var(--iwb-space-12);
|
||||
border-radius: var(--iwb-radius-full);
|
||||
font-size: var(--iwb-font-sm); line-height: 18px;
|
||||
transition: background .12s ease, color .12s ease;
|
||||
}
|
||||
.iwb-mk-chip:hover { background: var(--iwb-hover); color: var(--iwb-text); }
|
||||
.iwb-mk-chip.on { background: var(--iwb-text); color: var(--iwb-layer); }
|
||||
|
||||
/* 卡片墙:等高、底部对齐。悬停只变色不位移(同一屏里还有列表,两种形态靠形状区分) */
|
||||
.iwb-mk-grid {
|
||||
display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
|
||||
gap: var(--iwb-space-12); margin: var(--iwb-space-4) 0 var(--iwb-space-6);
|
||||
align-items: stretch;
|
||||
}
|
||||
.iwb-mk-card {
|
||||
display: flex; flex-direction: column; gap: var(--iwb-space-10);
|
||||
min-height: 168px; padding: var(--iwb-space-12);
|
||||
background: var(--iwb-panel);
|
||||
border: 1px solid color-mix(in srgb, var(--iwb-border) 55%, transparent);
|
||||
border-radius: var(--iwb-radius-card);
|
||||
transition: background .14s ease, border-color .14s ease;
|
||||
}
|
||||
.iwb-mk-card:hover { background: color-mix(in srgb, var(--iwb-layer) 55%, var(--iwb-panel)); border-color: color-mix(in srgb, var(--iwb-border2) 62%, transparent); }
|
||||
|
||||
/* 卡片头部:头像 + 名称/元信息,操作按钮落在 foot 右侧 */
|
||||
.iwb-mk-head { display: flex; align-items: flex-start; gap: var(--iwb-space-8); }
|
||||
.iwb-mk-avatar {
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
flex: 0 0 32px; width: 32px; height: 32px;
|
||||
border-radius: var(--iwb-radius-card); font-size: var(--iwb-font-xl);
|
||||
}
|
||||
.iwb-mk-titles { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-name { display: flex; align-items: center; flex-wrap: wrap; gap: var(--iwb-space-6); font-weight: 600; font-size: var(--iwb-font-md); line-height: 1.35; }
|
||||
.iwb-mk-sub { font-size: var(--iwb-font-sm); color: var(--iwb-text2); margin-top: var(--iwb-space-2); }
|
||||
.iwb-mk-badge {
|
||||
padding: 0 var(--iwb-space-6);
|
||||
border-radius: var(--iwb-radius-full);
|
||||
font-size: var(--iwb-font-xs); line-height: 17px;
|
||||
background: color-mix(in srgb, var(--iwb-ok) 14%, transparent);
|
||||
color: color-mix(in srgb, var(--iwb-ok) 82%, var(--iwb-text));
|
||||
border: 1px solid color-mix(in srgb, var(--iwb-ok) 32%, transparent);
|
||||
}
|
||||
.iwb-mk-desc {
|
||||
flex: 1 1 auto; font-size: var(--iwb-font-sm); line-height: 1.55; color: var(--iwb-text2);
|
||||
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
|
||||
}
|
||||
.iwb-mk-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--iwb-space-8); margin-top: auto; }
|
||||
.iwb-mk-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--iwb-space-4); }
|
||||
.iwb-mk-tag {
|
||||
border-radius: var(--iwb-radius-full);
|
||||
background: var(--iwb-layer2); color: var(--iwb-text2);
|
||||
font-size: var(--iwb-font-xs); line-height: 16px;
|
||||
padding: 0 var(--iwb-space-6);
|
||||
}
|
||||
.iwb-mk-card .iwb-plugin-tag { font-size: var(--iwb-font-xs); padding: 0 var(--iwb-space-6); line-height: 16px; }
|
||||
.iwb-mk-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--iwb-space-6); }
|
||||
/* 卡片按钮:浅底无边框 —— panel 上的「按钮感」靠底色,不靠线框 */
|
||||
.iwb-mk-actions .iwb-btn {
|
||||
border: 0; box-shadow: none;
|
||||
background: color-mix(in srgb, var(--iwb-tint) 6%, var(--iwb-panel));
|
||||
transition: background .12s ease, color .12s ease;
|
||||
}
|
||||
.iwb-mk-actions .iwb-btn:hover { background: color-mix(in srgb, var(--iwb-tint) 11%, var(--iwb-panel)); }
|
||||
.iwb-mk-actions .iwb-btn:active { background: color-mix(in srgb, var(--iwb-tint) 16%, var(--iwb-panel)); }
|
||||
.iwb-mk-actions .iwb-btn-primary { background: var(--iwb-text); color: var(--iwb-layer); }
|
||||
.iwb-mk-actions .iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-tint) 86%, var(--iwb-layer)); }
|
||||
|
||||
/* 已安装列表:横线分隔、不套卡片(与卡片墙同屏并存时靠形态区分) */
|
||||
.iwb-mk-list { display: flex; flex-direction: column; }
|
||||
.iwb-mk-row {
|
||||
display: flex; align-items: center; gap: var(--iwb-space-12);
|
||||
padding: var(--iwb-space-12) var(--iwb-space-6);
|
||||
border-bottom: 1px solid color-mix(in srgb, var(--iwb-border) 62%, transparent);
|
||||
transition: background .12s ease;
|
||||
}
|
||||
.iwb-mk-row:last-child { border-bottom: 0; }
|
||||
.iwb-mk-row:hover { background: color-mix(in srgb, var(--iwb-tint) 3%, transparent); }
|
||||
.iwb-mk-row-main { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: var(--iwb-space-8); }
|
||||
.iwb-mk-row-name { font-weight: 600; font-size: var(--iwb-font-base); }
|
||||
.iwb-mk-row-ver, .iwb-mk-row-author { color: var(--iwb-text2); font-size: var(--iwb-font-sm); }
|
||||
.iwb-mk-row-desc { color: var(--iwb-text2); font-size: var(--iwb-font-sm); margin-top: var(--iwb-space-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-mk-row-actions { display: flex; align-items: center; flex: 0 0 auto; gap: var(--iwb-space-6); }
|
||||
.iwb-mk-row-actions .iwb-btn { box-shadow: none; transition: background .12s ease; }
|
||||
.iwb-mk-row-actions .iwb-btn:hover { background: color-mix(in srgb, var(--iwb-tint) 10%, var(--iwb-panel)); }
|
||||
|
||||
/* 插件设置行:无外框只有分隔线;控件在上/在下由 stacked 决定整行竖排 */
|
||||
.iwb-mk-setrow {
|
||||
display: flex; align-items: center; gap: var(--iwb-space-16);
|
||||
padding: var(--iwb-space-12) var(--iwb-space-2);
|
||||
border: 0; border-bottom: 1px solid var(--iwb-border);
|
||||
background: transparent; border-radius: 0; margin: 0;
|
||||
}
|
||||
.iwb-mk-setrow:last-of-type { border-bottom: 0; }
|
||||
.iwb-mk-setrow-main { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-setrow-title { font-weight: 600; font-size: var(--iwb-font-base); line-height: 1.4; }
|
||||
.iwb-mk-setrow .iwb-hint { margin-top: var(--iwb-space-4); line-height: 1.55; }
|
||||
.iwb-mk-setrow-col { display: block; }
|
||||
.iwb-mk-setrow-col > .iwb-mk-setrow-main { width: 100%; }
|
||||
.iwb-mk-setrow-col > .iwb-input, .iwb-mk-setrow-col > .iwb-plugin-setting-custom { margin-top: var(--iwb-space-10); }
|
||||
.iwb-plugin-setting-custom { display: block; min-width: 0; max-width: 100%; }
|
||||
|
||||
/* 开关:38×22 与滑块 18 是组件自身几何,没有闭集(width/height 本来就不在 lint 范围) */
|
||||
.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: var(--iwb-panel); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
|
||||
.iwb-switch-track { width: 38px; height: 22px; border-radius: var(--iwb-radius-full); 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: 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; }
|
||||
|
||||
/* 已安装插件:横向列表 */
|
||||
.iwb-mk-list { display: flex; flex-direction: column; }
|
||||
|
||||
.iwb-mk-row-main { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
||||
.iwb-mk-row-name { font-weight: 600; font-size: 14px; }
|
||||
.iwb-mk-row-ver { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-mk-row-author { color: var(--iwb-text2); font-size: 12px; }
|
||||
.iwb-mk-row-desc { color: var(--iwb-text2); font-size: var(--iwb-font-sm); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.iwb-mk-row-actions { display: flex; align-items: center; flex: 0 0 auto; }
|
||||
.iwb-mk-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
|
||||
|
||||
.iwb-mk-chip.on { border-color: var(--iwb-text); }
|
||||
/* 插件设置:行(无边框盒子,只有细分隔线) */
|
||||
.iwb-mk-setrow { display: flex; align-items: center; gap: 16px; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--iwb-border); background: transparent; border-radius: 0; margin: 0; }
|
||||
.iwb-mk-setrow:last-of-type { border-bottom: 0; }
|
||||
.iwb-mk-setrow-main { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-setrow-title { font-weight: 600; font-size: 14px; line-height: 1.4; }
|
||||
.iwb-mk-setrow .iwb-hint { margin-top: 3px; line-height: 1.55; }
|
||||
/* 插件设置项:说明在上、控件在下(左对齐,2026-11-19)。
|
||||
* 原来 label 在左、输入框挤在右边 260px,地址/书签这类内容既看不全也改不动;
|
||||
* 布尔开关仍留在行末 —— 那是「开/关」,不是要填写的内容。 */
|
||||
.iwb-mk-setrow-col { display: block; }
|
||||
.iwb-mk-setrow-col > .iwb-mk-setrow-main { width: 100%; }
|
||||
.iwb-mk-setrow-col > .iwb-input, .iwb-mk-setrow-col > .iwb-plugin-setting-custom { margin-top: 10px; }
|
||||
.iwb-plugin-setting-custom { display: block; min-width: 0; max-width: 100%; }
|
||||
|
||||
/* 市场页筛选条 */
|
||||
.iwb-mk-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 12px; align-items: center; }
|
||||
.iwb-mk-filters .iwb-mk-sep { width: 1px; height: 16px; background: var(--iwb-border); margin: 0 4px; }
|
||||
/* 市场卡片:等高、底部按钮对齐 */
|
||||
.iwb-mk-grid { align-items: stretch; }
|
||||
|
||||
.iwb-mk-card .iwb-mk-desc { flex: 1 1 auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
||||
.iwb-mk-card .iwb-mk-tags { align-items: center; }
|
||||
.iwb-mk-card .iwb-mk-actions { margin-top: auto; display: flex; align-items: center; justify-content: flex-end; min-height: 30px; }
|
||||
.iwb-mk-card .iwb-mk-name { line-height: 1.35; }
|
||||
.iwb-mk-card .iwb-plugin-tag { font-size: 11px; padding: 0 6px; line-height: 16px; }
|
||||
/* 市场卡片:紧凑版(按钮在右上角,去掉底部空档) */
|
||||
|
||||
.iwb-mk-head { align-items: flex-start; gap: 8px; }
|
||||
.iwb-mk-titles { flex: 1 1 auto; min-width: 0; }
|
||||
.iwb-mk-head .iwb-mk-actions { flex: 0 0 auto; margin: 0; padding: 0; min-height: 0; }
|
||||
.iwb-mk-card .iwb-mk-avatar { width: 32px; height: 32px; flex: 0 0 32px; font-size: 17px; border-radius: 9px; }
|
||||
/* 字号已与下方 .iwb-mk-name/.iwb-mk-sub 同档(13/12),原来这里用 13.5/11.5 覆盖,归并后是重复声明 */
|
||||
.iwb-mk-card .iwb-mk-desc { font-size: 12px; line-height: 1.45; min-height: 0; margin-top: 2px; }
|
||||
.iwb-mk-card .iwb-mk-tags { min-height: 0; margin-top: 2px; gap: 5px; }
|
||||
.iwb-mk-card .iwb-mk-tag { font-size: var(--iwb-font-xs); 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: var(--iwb-space-12) 0 var(--iwb-space-8); margin: 0; }
|
||||
.iwb-settings-modal .iwb-llm-card:first-of-type { border-top: 0; }
|
||||
@@ -2191,108 +2263,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
|
||||
.iwb-dock-body[data-panel="groups"] .iwb-pcard:hover { background: var(--iwb-plugin-hover); border-color: var(--iwb-border2); }
|
||||
.iwb-dock-body[data-panel="groups"] .iwb-pcard-selected { border-color: var(--iwb-brand); box-shadow: 0 0 0 1px var(--iwb-brand); }
|
||||
|
||||
/* ── v3.26.24 插件市场重设计:去线框、块面分区、按钮收敛 ───────────────── */
|
||||
.iwb-set-page { max-width: 1180px; }
|
||||
.iwb-mk-toolbar {
|
||||
display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
|
||||
background: var(--iwb-layer); border-radius: 12px; padding: 8px 10px; margin: 6px 0 12px;
|
||||
}
|
||||
.iwb-mk-toolbar .iwb-input { border: 0; background: var(--iwb-layer2); box-shadow: none; }
|
||||
.iwb-mk-toolbar .iwb-input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-brand) 22%, transparent); }
|
||||
.iwb-mk-filters { margin: 0; gap: 6px; }
|
||||
|
||||
.iwb-mk-chip:hover { background: var(--iwb-layer2); color: var(--iwb-text); }
|
||||
.iwb-mk-chip.on { background: var(--iwb-text); color: var(--iwb-layer); }
|
||||
|
||||
.iwb-mk-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
|
||||
.iwb-mk-name { font-weight: 600; font-size: var(--iwb-font-md); }
|
||||
.iwb-mk-sub { font-size: var(--iwb-font-sm); color: var(--iwb-text2); margin-top: 1px; }
|
||||
.iwb-mk-desc { font-size: 12px; line-height: 1.55; color: var(--iwb-text2); }
|
||||
.iwb-mk-dot {
|
||||
width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; flex: 0 0 auto;
|
||||
background: var(--iwb-ok, #1d9e75); box-shadow: 0 0 0 2px color-mix(in srgb, var(--iwb-ok, #1d9e75) 22%, transparent);
|
||||
}
|
||||
.iwb-mk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
|
||||
.iwb-mk-tags { gap: 4px; }
|
||||
.iwb-mk-tag { border-radius: 999px; background: var(--iwb-layer2); color: var(--iwb-text2); font-size: var(--iwb-font-xs); padding: 1px 7px; }
|
||||
.iwb-mk-actions { gap: 6px; }
|
||||
.iwb-mk-actions .iwb-btn { border: 0; background: var(--iwb-layer2); box-shadow: none; }
|
||||
.iwb-mk-subtitle { font-size: var(--iwb-font-sm); color: var(--iwb-text2); margin: 2px 0 10px; }
|
||||
.iwb-set-page-title { margin-bottom: var(--iwb-space-2); }
|
||||
|
||||
/* ── v3.26.25 插件市场二次优化:自适应全宽 + 淡描边 + 已安装徽标(去绿色底) ── */
|
||||
.iwb-set-page { max-width: none; }
|
||||
|
||||
.iwb-mk-card.is-installed { background: var(--iwb-panel); }
|
||||
.iwb-mk-badge {
|
||||
margin-left: 7px; padding: 0 7px; border-radius: 999px; font-size: var(--iwb-font-xs); line-height: 17px;
|
||||
background: color-mix(in srgb, var(--iwb-ok, #1d9e75) 14%, transparent);
|
||||
color: color-mix(in srgb, var(--iwb-ok, #1d9e75) 82%, var(--iwb-text));
|
||||
border: 1px solid color-mix(in srgb, var(--iwb-ok, #1d9e75) 32%, transparent);
|
||||
}
|
||||
.iwb-mk-grid { grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px; }
|
||||
.iwb-mk-toolbar { border: 1px solid color-mix(in srgb, var(--iwb-border) 45%, transparent); }
|
||||
/* 管理页:行块面化、宽度自适应、操作列右对齐 */
|
||||
.iwb-mk-list { display: flex; flex-direction: column; gap: 8px; }
|
||||
.iwb-mk-row-actions { gap: 6px; }
|
||||
|
||||
/* ── v3.26.26 插件市场:补回按钮/卡片的“浮动”触感 ───────────────── */
|
||||
|
||||
.iwb-mk-actions .iwb-btn { transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
|
||||
.iwb-mk-chip {
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
background: var(--iwb-layer);
|
||||
color: var(--iwb-text2);
|
||||
padding: 4px 12px;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
transition: transform .12s ease, background .12s ease, color .12s ease;
|
||||
}
|
||||
|
||||
/* ── v3.26.27 插件市场/管理:去掉浮动,只保留颜色反馈;移除按钮给浅底;管理页回到横线分隔 ── */
|
||||
.iwb-mk-card, .iwb-mk-card:hover, .iwb-mk-card:active { transform: none; }
|
||||
.iwb-mk-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 14px;
|
||||
padding: 14px;
|
||||
gap: 10px;
|
||||
min-height: 168px;
|
||||
background: var(--iwb-panel);
|
||||
border: 1px solid color-mix(in srgb, var(--iwb-border) 55%, transparent);
|
||||
transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
|
||||
box-shadow: none;
|
||||
}
|
||||
.iwb-mk-card:hover {
|
||||
background: color-mix(in srgb, var(--iwb-layer) 55%, var(--iwb-panel));
|
||||
border-color: color-mix(in srgb, var(--iwb-border2) 62%, transparent);
|
||||
box-shadow: none;
|
||||
}
|
||||
/* 操作按钮:默认给浅底,看起来像按钮 */
|
||||
.iwb-mk-actions .iwb-btn {
|
||||
transform: none; box-shadow: none;
|
||||
background: color-mix(in srgb, var(--iwb-tint) 6%, var(--iwb-panel));
|
||||
transition: background .12s ease, color .12s ease;
|
||||
}
|
||||
.iwb-mk-actions .iwb-btn:hover {
|
||||
transform: none; box-shadow: none;
|
||||
background: color-mix(in srgb, var(--iwb-tint) 11%, var(--iwb-panel));
|
||||
}
|
||||
.iwb-mk-actions .iwb-btn:active { transform: none; box-shadow: none; background: color-mix(in srgb, var(--iwb-tint) 16%, var(--iwb-panel)); }
|
||||
.iwb-mk-actions .iwb-btn-primary {
|
||||
background: var(--iwb-text); color: var(--iwb-layer);
|
||||
}
|
||||
.iwb-mk-actions .iwb-btn-primary:hover { background: color-mix(in srgb, var(--iwb-tint) 86%, var(--iwb-layer)); box-shadow: none; }
|
||||
.iwb-mk-chip, .iwb-mk-chip:hover, .iwb-mk-chip:active { transform: none; }
|
||||
/* 管理页:横线分隔 + 悬停变色,不浮动 */
|
||||
.iwb-mk-list { gap: 0; }
|
||||
.iwb-mk-row { display: flex; align-items: center; gap: 12px; background: transparent; border-radius: 0; padding: 12px 6px; border-bottom: 1px solid color-mix(in srgb, var(--iwb-border) 62%, transparent); transform: none; box-shadow: none; transition: background .12s ease; }
|
||||
.iwb-mk-row:last-child { border-bottom: 0; }
|
||||
.iwb-mk-row:hover { background: color-mix(in srgb, var(--iwb-tint) 3%, transparent); transform: none; box-shadow: none; }
|
||||
.iwb-mk-row-actions .iwb-btn { transform: none; box-shadow: none; transition: background .12s ease; }
|
||||
.iwb-mk-row-actions .iwb-btn:hover { transform: none; box-shadow: none; background: color-mix(in srgb, var(--iwb-tint) 10%, var(--iwb-panel)); }
|
||||
|
||||
/* v3.26.38:未进入编辑态的节点正文不参与指针/文本选择 —— 单击=选中节点,双击=编辑 */
|
||||
.iwb-node textarea[readonly], .iwb-node input[readonly] { pointer-events: none; }
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
// npx playwright test _visual-tokens --update-snapshots # 首次生成/确认变更
|
||||
// npx playwright test _visual-tokens # 比对(0 diff 才算过)
|
||||
//
|
||||
// 6 个场景 × 亮/暗 = 12 张,覆盖「壳层 / 画布 / 浮层 / 抽屉 / 插件面板 / 右键菜单」六类界面。
|
||||
// 8 个场景 × 亮/暗 = 16 张,覆盖「壳层 / 画布 / 浮层 / 抽屉 / 插件面板 / 右键菜单 /
|
||||
// 插件管理 / 插件市场」八类界面。⑦⑧ 是 M6 重做插件面板时补的:那一整段样式此前**没有基线**,
|
||||
// 六次叠加的改动全靠人眼看,等于最乱的地方最没保护。
|
||||
// 稳定化:固定 1280×800 + deviceScaleFactor 1、animations disabled、caret hide、等字体与两帧。
|
||||
|
||||
const { test, expect } = require('./_pw-coverage')
|
||||
@@ -110,6 +112,188 @@ async function openRightDock(page) {
|
||||
await page.waitForTimeout(400) // 插件面板挂载是异步的(pluginMount effect)
|
||||
}
|
||||
|
||||
// ── ⑦⑧ 组件夹具 ────────────────────────────────────────────────────────
|
||||
// 为什么不用整页截图:插件管理/市场这一屏由 DesktopPluginsTab 渲染,而它在
|
||||
// `isDesk()` 为 false 时(网页 e2e 环境)走的是另一条分支(.iwb-plugin-row 清单),
|
||||
// 这条最乱的样式反而截不到。夹具用同一套类名 + 真实 dist/style.css 渲染,
|
||||
// 覆盖「设置行 / 列表行 / 开关 / 工具条 / 筛选胶囊 / 卡片」六种形态。
|
||||
const PANEL_HTML = `
|
||||
<div id="stage" style="background:var(--iwb-bg);padding:20px 24px">
|
||||
<div class="iwb-modal-body" style="max-width:none">
|
||||
<div class="iwb-set-page">
|
||||
<div class="iwb-set-page-title">插件</div>
|
||||
<div class="iwb-mk-setrow">
|
||||
<div class="iwb-mk-setrow-main">
|
||||
<div class="iwb-mk-setrow-title">插件市场</div>
|
||||
<div class="iwb-hint">浏览并安装由官方 / 社区制作的插件</div>
|
||||
</div>
|
||||
<button class="iwb-btn iwb-btn-sm">浏览</button>
|
||||
</div>
|
||||
<div class="iwb-mk-setrow">
|
||||
<div class="iwb-mk-setrow-main">
|
||||
<div class="iwb-mk-setrow-title">插件安装情况</div>
|
||||
<div class="iwb-hint">你目前已经安装了 8 个插件,其中 2 个可更新</div>
|
||||
</div>
|
||||
<button class="iwb-btn iwb-btn-sm">检查更新</button>
|
||||
</div>
|
||||
<div class="iwb-mk-setrow">
|
||||
<div class="iwb-mk-setrow-main">
|
||||
<div class="iwb-mk-setrow-title">开发者模式</div>
|
||||
<div class="iwb-hint">加载 plugins/local/<id>/plugin.js(未签名,仅本地调试)</div>
|
||||
</div>
|
||||
<label class="iwb-switch"><input type="checkbox" checked><span class="iwb-switch-track"><span class="iwb-switch-dot"></span></span></label>
|
||||
</div>
|
||||
<div class="iwb-section-sub">已安装插件</div>
|
||||
<div class="iwb-mk-list">
|
||||
<div class="iwb-mk-row">
|
||||
<span class="iwb-mk-avatar" style="background:#dbeafe">✎</span>
|
||||
<div class="iwb-mk-row-main">
|
||||
<div class="iwb-mk-row-title">
|
||||
<span class="iwb-mk-row-name">标注 / 修图</span>
|
||||
<span class="iwb-mk-row-ver">v1.20.7</span>
|
||||
<span class="iwb-mk-row-author">官方</span>
|
||||
<span class="iwb-plugin-tag">已加载</span>
|
||||
</div>
|
||||
<div class="iwb-mk-row-desc">在图片上画箭头、文字、马赛克,支持批量导出</div>
|
||||
</div>
|
||||
<div class="iwb-mk-row-actions">
|
||||
<button class="iwb-btn iwb-btn-sm">设置</button>
|
||||
<button class="iwb-btn iwb-btn-sm">移除</button>
|
||||
<label class="iwb-switch"><input type="checkbox" checked disabled><span class="iwb-switch-track"><span class="iwb-switch-dot"></span></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-row">
|
||||
<span class="iwb-mk-avatar" style="background:#dcfce7">◈</span>
|
||||
<div class="iwb-mk-row-main">
|
||||
<div class="iwb-mk-row-title">
|
||||
<span class="iwb-mk-row-name">位图转矢量</span>
|
||||
<span class="iwb-mk-row-ver">v0.6.1</span>
|
||||
<span class="iwb-mk-row-author">官方</span>
|
||||
<span class="iwb-plugin-tag iwb-plugin-tag-warn">未加载</span>
|
||||
</div>
|
||||
<div class="iwb-mk-row-desc">把位图描成 SVG,可调颜色数量与平滑度</div>
|
||||
</div>
|
||||
<div class="iwb-mk-row-actions">
|
||||
<button class="iwb-btn iwb-btn-sm">设置</button>
|
||||
<button class="iwb-btn iwb-btn-sm">移除</button>
|
||||
<label class="iwb-switch"><input type="checkbox"><span class="iwb-switch-track"><span class="iwb-switch-dot"></span></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-row">
|
||||
<span class="iwb-mk-avatar" style="background:#fef3c7">⇩</span>
|
||||
<div class="iwb-mk-row-main">
|
||||
<div class="iwb-mk-row-title">
|
||||
<span class="iwb-mk-row-name">批量导出</span>
|
||||
<span class="iwb-mk-row-ver">v1.2.1</span>
|
||||
<span class="iwb-mk-row-author">官方</span>
|
||||
<span class="iwb-plugin-tag">可更新</span>
|
||||
</div>
|
||||
<div class="iwb-mk-row-desc">按预设尺寸批量导出,支持透明 PNG 与白底 JPG 双版本</div>
|
||||
</div>
|
||||
<div class="iwb-mk-row-actions">
|
||||
<button class="iwb-btn iwb-btn-sm">更新</button>
|
||||
<button class="iwb-btn iwb-btn-sm">设置</button>
|
||||
<button class="iwb-btn iwb-btn-sm">移除</button>
|
||||
<label class="iwb-switch"><input type="checkbox" checked><span class="iwb-switch-track"><span class="iwb-switch-dot"></span></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
const MARKET_HTML = `
|
||||
<div id="stage" style="background:var(--iwb-bg);padding:20px 24px">
|
||||
<div class="iwb-modal-body" style="max-width:none">
|
||||
<div class="iwb-set-page">
|
||||
<div class="iwb-set-page-title">插件市场</div>
|
||||
<div class="iwb-mk-subtitle">共 4 个插件 · 资料目录/plugins/</div>
|
||||
<div class="iwb-mk-toolbar">
|
||||
<input class="iwb-input iwb-grow" placeholder="搜索插件,例如:出图、抠图、矢量…">
|
||||
<div class="iwb-mk-filters">
|
||||
<button class="iwb-mk-chip on">标注</button>
|
||||
<button class="iwb-mk-chip">修图</button>
|
||||
<button class="iwb-mk-chip">矢量</button>
|
||||
<button class="iwb-mk-chip">导出</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-filters">
|
||||
<button class="iwb-mk-chip on">全部 4</button>
|
||||
<button class="iwb-mk-chip">已安装 2</button>
|
||||
<button class="iwb-mk-chip">未安装 2</button>
|
||||
</div>
|
||||
<div class="iwb-mk-grid">
|
||||
<div class="iwb-mk-card">
|
||||
<div class="iwb-mk-head">
|
||||
<span class="iwb-mk-avatar" style="background:#dbeafe">✎</span>
|
||||
<div class="iwb-mk-titles">
|
||||
<div class="iwb-mk-name">标注 / 修图<span class="iwb-mk-badge">已安装</span></div>
|
||||
<div class="iwb-mk-sub">官方 · v1.20.7 · 442 KB</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-desc">在图片上画箭头、文字、马赛克,支持批量导出</div>
|
||||
<div class="iwb-mk-foot">
|
||||
<div class="iwb-mk-tags"><span class="iwb-mk-tag">标注</span><span class="iwb-mk-tag">修图</span></div>
|
||||
<div class="iwb-mk-actions"><button class="iwb-btn iwb-btn-sm">移除</button></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-card">
|
||||
<div class="iwb-mk-head">
|
||||
<span class="iwb-mk-avatar" style="background:#dcfce7">◈</span>
|
||||
<div class="iwb-mk-titles">
|
||||
<div class="iwb-mk-name">位图转矢量</div>
|
||||
<div class="iwb-mk-sub">官方 · v0.6.1 · 143 KB</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-desc">把位图描成 SVG,可调颜色数量与平滑度</div>
|
||||
<div class="iwb-mk-foot">
|
||||
<div class="iwb-mk-tags"><span class="iwb-mk-tag">矢量</span></div>
|
||||
<div class="iwb-mk-actions"><button class="iwb-btn iwb-btn-sm iwb-btn-primary">安装</button></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-card">
|
||||
<div class="iwb-mk-head">
|
||||
<span class="iwb-mk-avatar" style="background:#fef3c7">⇩</span>
|
||||
<div class="iwb-mk-titles">
|
||||
<div class="iwb-mk-name">批量导出</div>
|
||||
<div class="iwb-mk-sub">官方 · v1.2.1 · 44 KB</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-desc">按预设尺寸批量导出,支持透明 PNG 与白底 JPG 双版本</div>
|
||||
<div class="iwb-mk-foot">
|
||||
<div class="iwb-mk-tags"><span class="iwb-mk-tag">导出</span><span class="iwb-mk-tag">批处理</span></div>
|
||||
<div class="iwb-mk-actions"><button class="iwb-btn iwb-btn-sm">移除</button></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-card">
|
||||
<div class="iwb-mk-head">
|
||||
<span class="iwb-mk-avatar" style="background:#f3e8ff">◐</span>
|
||||
<div class="iwb-mk-titles">
|
||||
<div class="iwb-mk-name">风格来源</div>
|
||||
<div class="iwb-mk-sub">社区 · v1.3.3 · 69 KB</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="iwb-mk-desc">从参考图提取配色与风格关键词</div>
|
||||
<div class="iwb-mk-foot">
|
||||
<div class="iwb-mk-tags"><span class="iwb-mk-tag">风格</span></div>
|
||||
<div class="iwb-mk-actions"><button class="iwb-btn iwb-btn-sm iwb-btn-primary">安装</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
async function bootPanel(page, theme, html) {
|
||||
await page.goto('about:blank')
|
||||
await page.setContent(html, { waitUntil: 'domcontentloaded' })
|
||||
await page.addStyleTag({ path: require('node:path').join(__dirname, '..', 'dist', 'style.css') })
|
||||
// 夹具里所有过渡必须彻底关掉:开关的 .15s 背景过渡在截图时可能停在最后一帧,
|
||||
// 两次截图差 1~3 级灰度、只有几个像素,却会让 threshold:0 的基线变成随机红灯。
|
||||
await page.addStyleTag({ content: '*,*::before,*::after{transition:none!important;animation:none!important}' })
|
||||
await page.evaluate((t) => { document.documentElement.classList.toggle('theme-dark', t === 'dark') }, theme)
|
||||
}
|
||||
|
||||
for (const theme of ['light', 'dark']) {
|
||||
test.describe('视觉基线 · ' + theme, () => {
|
||||
test('① 首页', async ({ page }) => {
|
||||
@@ -151,5 +335,15 @@ for (const theme of ['light', 'dark']) {
|
||||
await expect(page.locator('.iwb-ctxmenu').first()).toBeVisible()
|
||||
await shot(page, '06-ctxmenu-' + theme)
|
||||
})
|
||||
|
||||
test('⑦ 插件管理(设置行 + 列表 + 开关)', async ({ page }) => {
|
||||
await bootPanel(page, theme, PANEL_HTML)
|
||||
await shot(page, '07-plugins-manage-' + theme)
|
||||
})
|
||||
|
||||
test('⑧ 插件市场(工具条 + 筛选 + 卡片墙)', async ({ page }) => {
|
||||
await bootPanel(page, theme, MARKET_HTML)
|
||||
await shot(page, '08-plugins-market-' + theme)
|
||||
})
|
||||
})
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
Vendored
+7
-7
@@ -1,20 +1,20 @@
|
||||
{
|
||||
"_comment": "设计 token 棘轮基线(M5-T5.2)。数字只允许下降,不允许上升 —— 涨了就说明新代码写了裸值,改用 token 或(确有必要时)在 PR 里说明并下调别的项把总数补回来。口径来源:node scripts/token-audit.js --json",
|
||||
"measuredAt": "2026-11-23",
|
||||
"measuredVersion": "3.26.49",
|
||||
"measuredVersion": "3.26.51",
|
||||
"counts": {
|
||||
"undefinedRefs": 0,
|
||||
"deadTokens": 32,
|
||||
"hex": 84,
|
||||
"hex": 79,
|
||||
"rgb": 55,
|
||||
"fontSize": 170,
|
||||
"radius": 103,
|
||||
"spacing": 415,
|
||||
"fontSize": 159,
|
||||
"radius": 95,
|
||||
"spacing": 377,
|
||||
"zIndexDecl": 71,
|
||||
"fontSizeDistinct": 13,
|
||||
"radiusDistinct": 18,
|
||||
"radiusDistinct": 17,
|
||||
"spacingDistinct": 26,
|
||||
"zIndexDistinct": 31,
|
||||
"shadowDistinct": 45
|
||||
"shadowDistinct": 44
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,11 @@ for (const dark of [false, true]) {
|
||||
check(t, 'brandText', t.brandText, present, T.RATIO.text2, label)
|
||||
check(t, 'canvasText', t.canvasText, ['canvasBg'], T.RATIO.canvas, label)
|
||||
check(t, 'nodeText2', t.nodeText2, ['nodeBg', 'layer', 'panel'], T.RATIO.text2, label)
|
||||
// M6 补漏:状态色(ok/err/warn)在 .iwb-status-ok / .iwb-ratio.ok / 插件标签里是**直接当文字色**
|
||||
// 用的,M5 的 114 对只覆盖了 text/text2/dim/brandText,把它们漏了 —— 于是亮色 --iwb-ok
|
||||
// 长期是 #22c55e(对浅页面 2.13)也一路绿灯。状态文字同样按 AA 正文要求 ≥4.5。
|
||||
const STATUS_SURFACES = ['bg', 'panel', 'layer', 'layer2']
|
||||
for (const k of ['ok', 'err', 'warn']) check(t, k, t[k], STATUS_SURFACES, T.RATIO.text2, label)
|
||||
// 品牌底上的字:onBrand 是按对比度自动选的黑/白,选错了就会「主按钮白字压浅蓝」
|
||||
rows.push({
|
||||
name: 'onBrand × brand',
|
||||
|
||||
Reference in new issue
Block a user