feat(tokens): M4-B1 壳层收敛 —— 标签唯一一套 + 尺度接口落地
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 44s

- 标签:5 套变体 → 1 套。其中 3 套是死代码(iwb-drawer-tab / iwb-rail-tab /
  iwb-res-tab 在 dist/app.js 里出现 0 次:抽屉已被停靠栏取代、右竖栏只剩手势
  排除列表里的名字、资源中心的 e2e 点的是不存在的元素),直接删除;活着的
  那一套收敛激活态为唯一一条:品牌 14% 底 + brand-text + 600(暗色 22%),
  亮/暗与底色的差分别是 17 / 16 级
- 新增可迁移的尺度接口(B1 的前提:原 SCALE 里的 @deprecated 注释指向
  --iwb-space-* / --iwb-radius-* / --iwb-font-*,那些名字当时并不存在):
  间距 13 档(像素命名)、圆角 6 档、字号 6 档、组件尺寸 3 个
  (--iwb-chrome-h / --iwb-tab-h / --iwb-tab-radius)
- 36px 收口 6 处到 --iwb-chrome-h:标签条高度 + dockarea / home-panel /
  landing-panel / canvas-topbar / wsrail 的让位 top(原来各写一遍,改高度必漏)
- dock / toolbar / statusbar 14 处圆角与字号等值换 token;阴影与 z-index 留 B2
- 4 处单测的「.iwb-res-tabs 必须存在」断言改成「不得复活」——其中两处注释
  早就写着「已下线,钉点移除」,断言却还在钉它存在,死 CSS 才一直不敢删
- 12 张视觉基线 10 变 2 不变,diff 只在顶部激活标签与设置侧栏选中项;
  节点/控件/工具栏零 diff(D10 未被带坏);verify:ci 全绿
This commit is contained in:
qiqi committed 2026-11-23 15:04:43 +08:00
1 parent 846a59b4c2
commit 015e427627
22 files changed
+251 -85

No files matched your search

+21 -1
View File
@@ -131,13 +131,33 @@
| 批次 | 范围 | 关键动作 | 预估 | 验收 |
|---|---|---|---|---|
| **B1 壳层** | `.iwb-tabstrip/.iwb-tab`(5 套)、`.iwb-dock-*`、`.iwb-toolbar*`、`.iwb-statusbar` | 页签收敛为 1 套(单框扁平 + 品牌高亮 + `--iwb-tab-height`);字号/圆角/间距换 token | 0.5d | 首页/画布截图;5 套类名只留 1 套 |
| **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-*` | 间距归并(就近下取)、字号 8 档 | 0.5d | 首页截图;文案换行逐条看 |
| **B4 设置/外观** | `.iwb-settings-modal/.iwb-appear-*/.iwb-setcell` | 控件统一 `pad-control` / `control-height` | 0.5d | 设置页截图 |
| **B5 节点** | `.iwb-node*/.iwb-gen-*/.iwb-port` | 节点内字号 12/15 归口;圆角走 `--iwb-node-radius`;端口/小标签换 `bg-chip` | 1d | 画布截图(最复杂,单独一轮) |
| **B6 插件** | `plugins/**` + 插件源码仓库 | 硬编码 → `--iwb-*`;`ALLOW_FILES` 逐项清零 | 0.5d | 契约测试白名单 4 → 0 |
**B1 执行结果(v3.26.44,2026-11-23)**:
| 项 | 计划 | 实际 | 说明 |
|---|---|---|---|
| 5 套 tab → 1 套 | 合并 5 份实现 | **3 套是死代码,直接删**;活着的只有 1 套 | `iwb-drawer-tab` / `iwb-rail-tab` / `iwb-res-tab` 在 `dist/app.js` 里出现 **0 次**(抽屉已被停靠栏取代、右竖栏只剩手势排除列表里的名字、资源中心的 e2e 用例点的是不存在的元素)。收敛动作因此变成「删死规则 + 统一活着的一套」,零行为风险 |
| 激活态 | 1 条 | 1 条:品牌 14% 底 + brand-text + 600(暗色加深到 22%) | 原为 tint 9% 中性底 + text;改后亮色 `#d2d3d5` 落在 `#e3e3e3` 上(差 17 级)、暗色 `#2e3033` 落在 `#1e1e1e` 上(差 16 级),两侧一致 |
| 尺度 token | 新增 | 间距 13 档(px 命名)+ 圆角 6 档 + 字号 6 档 + 组件尺寸 3 个 | 砍掉计划里的 L2 别名层(`gap-*` / `pad-*`)与 8 档字号语义名,理由记在 `design-tokens.md` §3.2/§3.3 |
| 36px 收口 | 3 处 | **6 处** | `tabstrip` 高度 + `dockarea`/`home-panel`/`landing-panel`/`canvas-topbar`/`wsrail` 的 `top`,全部改 `--iwb-chrome-h`。这条是本批最实在的收益:改标签条高度不会再漏改让位层 |
| 壳层换 token | dock/toolbar/statusbar | 14 处(圆角/字号,等值) | 阴影与 z-index 留给 B2(B1 只做等值替换,避免和浮层那批混在一起) |
**验收**:12 张视觉基线 10 张变化、2 张(右键菜单)零 diff;diff 逐张看过,**只有顶部激活标签与设置侧栏选中项**,
节点/控件/工具栏/状态栏全部零 diff(说明 D10 的卡片内控件面没被这次改动带坏)。`verify:ci` 全绿。
**踩到的三个坑**:
1. `gen-tokens.js` 的块注释里写了 `--sp-*/--rd-*`,`*/` 提前闭合注释导致语法错误 —— 注释里别让 `*` 紧挨 `/`。
2. 三处单测(`page-chrome` / `single-canvas-shell` / `left-resource-layout` / `three-page-layout`)都**钉着已删除的
`.iwb-res-tabs` 存在**,其中两处注释还写着「已下线,钉点移除」—— 注释和断言互相矛盾,导致死 CSS 谁也不敢删。
已全部改成「不得复活」的反向断言。
3. 新增 token 后审计里的「定义但未引用」从 25 涨到 35:多出的 10 个是给 B2–B5 备的接口,不是死变量。
**每批三条硬验收**:
1. 亮/暗两张截图 `0 diff`(B1 例外:允许 tab 视觉变化,需人工确认)
2. `token-audit.js` 对应计数下降
+1 -1
View File
@@ -1,7 +1,7 @@
# 现状架构与性能事实基线(image-workbench-web)
> **本文档是什么**:现状**事实快照**,不是规范。用途:任何性能 / 内存 / 存储相关改动,先对齐这里的现实,避免把已经调好的东西改坏。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 2b8e337`(线上 `v3.26.41+2b8e337` —— 2026-11-23 发**正式线**:继承态提示词把上游文案与参考图交给组合/连接节点(来源判定加 `(edges, nodes)`,组合拼接逻辑零改动));上一条 `v3.26.40+d9e3d84`:左右停靠栏配色对齐主色调(新增 `--iwb-dock-bg` 进灰阶 ramp + 头部深一档 + `.iwb-pcard` 补白底)+ 修 `Cargo.toml`/`Cargo.lock` 版本漂移,四处统一到 3.25.58)。上一条 3.25.30:线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
> 日期 **2026-10-20**(**2026-11-16 复算 · v3.24.85**)| 基线(**最近一次 bump 版本的提交**,不是主干 HEAD)`main = 846a59b`(线上 `v3.26.44+846a59b` —— 2026-11-23 **设计 token 体系重建**:D1–D9 色彩模型改为真正的深色(#121212 底 / 正文 #e3e3e3、13 个表面逐层相对派生 + 对比度生成期夹紧)、D10 新增 `--iwb-field` 卡片内控件面(暗色不再在灰卡上挖黑洞)、M3 单一源(`derive()` → `design-tokens.css` + `tokens.json`,`tokens:check` 进 CI);**安装包已本地构建,NAS 尚未上传**);上一条 `v3.26.41+2b8e337`:继承态提示词把上游文案与参考图交给组合/连接节点(来源判定加 `(edges, nodes)`,组合拼接逻辑零改动);再上一条 `v3.26.40+d9e3d84`:左右停靠栏配色对齐主色调(新增 `--iwb-dock-bg` 进灰阶 ramp + 头部深一档 + `.iwb-pcard` 补白底)+ 修 `Cargo.toml`/`Cargo.lock` 版本漂移,四处统一到 3.25.58)。上一条 3.25.30:线上实际运行提交是 docs 提交 `7df9dc4`,bump 提交为 `4be78c0`;2026-11-16 已发**测试站 + 正式站**,三地址一致 + `IWB_VERIFY_STRICT=1` 通过。v3.24.85 是「代码体检收口」(棘轮收回 Workbench 3090→2998 + 图库索引 4 条绕过锁的写路径收口到 `mutate` + 文档数字校准),`stable` / `stable-v3.24.85` / `stable-verified-2026-11-16` 均指向 `7df9dc4`。上一条 —— 2026-11-14 发**测试站 + 正式站** `https://test.image-workbench-web.pages.dev`:**v3.24.84 修「生图节点连了 3 条上游只出 1 个任务」**(任务 id 与去重基准改用新字段 `ownerNodeId`=本节点自己,不再用随继承冒泡的 `sourceNodeId` ⇒ 连几条线就几个任务;`relay` 仍归约到真实文本来源,同一来源多路径抵达只算一次)。上一条 v3.24.83:**修「插件节点冷启动退化成一段文本」**(插件节点体是异步注册的,`registerNodeType` 在 `render` 由无变有时自增 `NODE_TYPES_REV`,`NodeCard` 比它 ⇒ 注册那一刻重建一次;`canvas-normalize` 按命名规则把 `plugin:<id>:<variant>` 认作已知类型,不再降级成 `plugin` 并写回存档);配套插件 `style-source` 1.3.2 把节点体样式改为**脚本执行时注入**(此前只在面板 `mount()` 注入 ⇒ 从存档直接进画布时节点无样式、缩略图按原图铺满)。上一条 v3.24.82 同批:提示词/文本节点**显示上游继承文本**(自己 `data.text` 为空时把上游那段话显示在框里,改一个字即接管,另有「恢复跟随」清空回跟随;多路上游按 Y 轴取第一条)+ 修 `nodeRefsOf` 的 textout 分支只认 llm/batch/combine 上游导致「样式 → 文本 → 分层」丢参考图;再上一条 v3.24.81:① 插件节点可自定义节点体(`render(node, props, host)` 画真实 DOM,宿主不每帧重建 ⇒ 输入框不失焦);② 节点自带参考图(`data.refOn/refUrl` ⇒ 任务图里补伪参考图,坐标取节点自身 ⇒ 仍参与「图片按 X 轴排序」);③ 连线白名单按 `data.outKind === 'prompt'` 归一化,7 条规则一次放行,内置节点行为逐字不变。上一条 v3.24.80 = 离开页面的兜底保存不递增 rev(2026-11-14 07:20 补发 —— 首发 11-13 23:25 撞 Cloudflare Workers API 事故 `503 no healthy upstream`,期间正式站保持在 `v3.24.79+8598a57` 未动)。v3.24.83 的 bump 提交即 `0a27a42`(v3.24.82 为 `ef6cf42`、v3.24.81 为 `dba71e3`);主干 HEAD 会继续前进,见 [`RELEASES.md`](../RELEASES.md))| 历史分支 `refactor/architecture` / `feat/multi-canvas-tabs` / `refactor/state-store` 已于 2026-10-20 清理(内容均已并入 main,归档标签 `archive/*`),本文**计数类事实**已按 main HEAD 复算。
<!-- 2026-10-28 P1 拆分批 1:新增 src/generation-task-graph.js(5 个任务图纯函数自 app.js 迁出)
⇒ 模块数 60→61、耦合面 51→52、sourceModules 60→61。耦合面只**新增** IWBWTaskGraph,无删除。
2026-10-28 P1 拆分批 2:新增 src/storage-config-shape.js(9 个配置形状纯函数自 app.js 迁出)
+40 -27
View File
@@ -329,9 +329,9 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
现状 66 个平铺名保留为 legacy;下表是**新代码必须使用**的名字。`外观面板` 列标「可覆盖」的,用户在「外观」里能改,改完仍走同一条 `derive → overrides` 管线。
> ⚠ **下表是目标名(M4 迁移后才全部存在)**。当前真正生效的仍是平铺 legacy 名(`--iwb-bg` / `--iwb-text` …),
> 它们是 `src/theme-tokens.js` 的产物,落在 `src/design-tokens.css`,要查当前值请看那里或 `dist/tokens.json`,
> 不要照抄本表的默认值(表是计划书,不是快照)。
> ✅ **下表的名字自 v3.26.44 起全部存在**(`src/theme-tokens.js` 的 `derive()` 生成,实际值见
> `src/design-tokens.css` 或 `dist/tokens.json`)。颜色仍以 `--iwb-*` 平铺名为主 —— legacy 长期保留,
> **插件契约引用它们,不能删**;尺度层新代码用 §3.2–§3.5 的语义名,不要再新增平铺名。
| L2 token | 亮色默认 | 暗色默认 | 用在哪 | 外观面板 |
|---|---|---|---|---|
@@ -378,44 +378,57 @@ L3 Contract ── 组件整体换肤时才加,能不建就不建
### 3.2 间距
L1 闭集(14 档,多余一律不加):
**已落地(v3.26.44,M4-B1)**:13 档闭集,变量名直接用像素值 —— `--iwb-space-12` 一眼知道是 12px;
序号命名(`--iwb-space-3`)得背表,所以不采用。
```
--iwb-space-0:0 2:2px 4:4px 6:6px 8:8px 10:10px 12:12px
--iwb-space-16:16px 20:20px 24:24px 32:32px 40:40px 48:48px 64:64px
--iwb-space-2:2px 4:4px 6:6px 8:8px 10:10px 12:12px 16:16px
--iwb-space-20:20px 24:24px 32:32px 40:40px 48:48px 64:64px
```
L2 **只准这 8 个**(防止语义名爆炸):
值来自 `scripts/gen-tokens.js` 的 `SCALE` 表(改值改那里,再 `npm run tokens:write`)。
`0` 直接写 `0`,不设 token。
| L2 | = L1 | 典型用途 |
|---|---|---|
| `--iwb-gap-2xs` | 2px | 图标与文字、紧邻按钮 |
| `--iwb-gap-xs` | 4px | 行内元素、tab 之间 |
| `--iwb-gap-sm` | 6px | 列表项内部 |
| `--iwb-gap-md` | 8px | 卡片内边距、默认 gap |
| `--iwb-gap-lg` | 12px | 分区间隔 |
| `--iwb-gap-xl` | 16px | 页面级分块 |
| `--iwb-pad-control` | `6px 10px` | 按钮/输入框 |
| `--iwb-pad-panel` | `12px 14px` | 面板/抽屉 |
> **与初版计划的偏差(砍掉 L2 别名层)**:原计划还有 `--iwb-gap-2xs/xs/sm/md/lg/xl` +
> `--iwb-pad-control/panel` 八个语义别名。落地时**没做** —— 每个尺寸多一个别名意味着查一次要跳两层,
> 而本仓库已经在维护 66 个 legacy 平铺名,再加 8 个只会更难记。语义留给**组件级** token
> (`--iwb-tab-h` / `--iwb-chrome-h`),那才是真正会复用的东西;`pad-control / pad-panel`
> 等到 B4 做设置页控件时再评估(那时才知道真实的内边距分布)。
**归并映射**(S2 迁移时照这张表替换,规则:**就近下取**,避免布局变大):
**归并映射**(迁移时照这张表替换,规则:**就近下取**,避免布局变大):
`1→2` `3→4` `5→6` `7→6` `9→8` `11→12` `14→12` `18→16` `22→24` `26→24` `31→32` `42→40` `52→48` `72→64`
> `90/92/96/116/120` 不是间距,是**布局尺寸**(侧栏宽、面板高)。它们不进 token,归 `--iwb-layout-*` 且必须写明「为什么是这个数」。
#### 3.2.1 组件级尺寸(B1 新增)
这类 token 不属于「间距/字号」通用尺度,而是**某个组件的固有尺寸**。它们存在的理由只有一个:
**同一个数被多处写死过,漏改一处就错位**。
| token | 值 | 谁在用 | 为什么必须共享 |
|---|---|---|---|
| `--iwb-chrome-h` | 36px | `.iwb-tabstrip` 高度;`.iwb-dockarea`/`.iwb-home-panel`/`.iwb-landing-panel`/`.iwb-canvas-topbar`/`.iwb-wsrail` 的 `top` | 标签条高度一变,**6 处让位层**必须同时变,否则内容被标签条压住或露出空隙 |
| `--iwb-tab-h` | 28px | `.iwb-tab` 高度 | 标签高度 |
| `--iwb-tab-radius` | 7px | `.iwb-tab`、`.iwb-dock-btn`、`.iwb-dock-ghost` 圆角 | 小控件统一的圆角档 |
### 3.3 字号 / 行高 / 字重
| L2 | 值 | 归并掉 | 用途 |
**已落地(v3.26.44,M4-B1)**:6 档。
| token | 值 | 归并掉 | 用途 |
|---|---|---|---|
| `--iwb-font-caption` | 10px | 8, 10.5 | 角标、极小说明 |
| `--iwb-font-label` | 11px | 11.5 | 标签、按钮小字、状态栏 |
| `--iwb-font-body` | 12px | 12.5 | **默认正文**(UI 里 76 处) |
| `--iwb-font-body-lg` | 13px | 13.5 | 面板正文、toast |
| `--iwb-font-title-sm` | 14px | — | 小标题 |
| `--iwb-font-title` | 15px | 17 | 区块标题、节点参数输入(画布可读性) |
| `--iwb-font-heading` | 18px | — | 页面标题 |
| `--iwb-font-display` | 22px | 26, 28, 30, 34 | 仅首页/落地页 |
| `--iwb-font-xs` | 11px | 10, 11.5 | 状态栏、徽标、辅助信息 |
| `--iwb-font-sm` | 12px | 12.5 | **默认正文 / 标签**(UI 里出现最多) |
| `--iwb-font-md` | 13px | 13.5 | 面板正文、工具栏标题 |
| `--iwb-font-lg` | 15px | 14, 15.5 | 小标题、节点标题 |
| `--iwb-font-xl` | 17px | 16, 17.5 | 面板标题 |
| `--iwb-font-2xl` | 20px | 18, 19, 22 | 页面大标题 |
> **与初版计划的偏差**:原计划 8 档语义名(`caption/label/body/body-lg/title-sm/title/heading/display`)。
> 落地改为 6 档 + 短名,原因同上(两层名字增加查找成本)。原计划里 14px 与 18px 两档在实际代码中
> 出现次数很少,B3(首页/库)与 B4(设置)归并时再决定要不要补;`16px` 目前散落在设置页标题等处,
> 归到 `font-lg(15)` 还是 `font-xl(17)` 会产生可见变化,留到那两批单独确认。
- 行高:`--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`
+45 -4
View File
@@ -89,6 +89,41 @@ const SCALE = [
['--tr-fast', '0.1s ease-out', null],
['--tr-base', '0.2s ease-out', '@deprecated tr-base/tr-slow → M3 的 --iwb-motion-*(tr-fast 仍被引用)'],
['--tr-slow', '0.3s ease-out', null],
/* ── M4 公共接口(2026-11-23)─────────────────────────────────────────
* 上面那批平铺名(`--sp-1` 这类、rd / fs 同)是 legacy,长期保留给插件与既有代码。
* 新代码只用下面这组**语义名**:改一档就全局一致,不用再猜「这处 12px 是间距还是字号」。
*/
/* 命名用**像素值**而不是序号:`--iwb-space-12` 一眼知道是 12px,`--iwb-space-3` 得背。
* 14 档与规范 §3.2 一致;不加 L2 语义别名层(gap-*),避免每个尺寸多一个没人用的名字。 */
['--iwb-space-2', '2px', null],
['--iwb-space-4', '4px', null],
['--iwb-space-6', '6px', null],
['--iwb-space-8', '8px', null],
['--iwb-space-10', '10px', null],
['--iwb-space-12', '12px', null],
['--iwb-space-16', '16px', null],
['--iwb-space-20', '20px', null],
['--iwb-space-24', '24px', null],
['--iwb-space-32', '32px', null],
['--iwb-space-40', '40px', null],
['--iwb-space-48', '48px', null],
['--iwb-space-64', '64px', null],
['--iwb-radius-chip', '6px', 'M4 圆角:胶囊/标签'],
['--iwb-radius-control', '8px', '输入框/按钮'],
['--iwb-radius-card', '10px', '卡片/分组'],
['--iwb-radius-panel', '12px', '面板/工具栏'],
['--iwb-radius-popover', '14px', '浮层/菜单/右键'],
['--iwb-radius-full', '999px', '圆形/药丸'],
['--iwb-font-xs', '11px', 'M4 字号:状态栏/徽标'],
['--iwb-font-sm', '12px', '标签/次要正文'],
['--iwb-font-md', '13px', '正文/工具栏标题'],
['--iwb-font-lg', '15px', '小标题/节点标题'],
['--iwb-font-xl', '17px', '面板标题'],
['--iwb-font-2xl', '20px', '页面大标题'],
['--iwb-chrome-h', '36px', '顶部标签条高度:tabstrip / dockarea / home-panel 三处共用(原来各写一遍 36px)'],
['--iwb-tab-h', '28px', '标签高度'],
['--iwb-tab-radius', '7px', '标签圆角'],
]
/* 只在亮色出现的结构/契约声明(暗色由 :root 的 color-mix 在 html 上重新求值,或单独覆盖) */
@@ -248,13 +283,16 @@ function inferType (value, name) {
// 变量名 → DTCG 分组
function groupOf (name) {
const n = name.replace(/^--(?:iwb-)?/, '')
if (/^sp-/.test(n)) return 'space'
if (/^rd(-|$)/.test(n)) return 'radius'
if (/^fs-/.test(n)) return 'font.size'
if (/^sp-/.test(n)) return 'legacy.space'
if (/^space-/.test(n)) return 'space'
if (/^rd(-|$)/.test(n)) return 'legacy.radius'
if (/^radius-/.test(n)) return 'radius'
if (/^fs-/.test(n)) return 'legacy.font'
if (/^font-/.test(n)) return 'font.size'
if (/^tr-/.test(n)) return 'motion'
if (/^sh-/.test(n)) return 'shadow'
if (n === 'grid-dot') return 'color'
if (/^(grid-|nav-|node-radius|node-sel-w|edge-w|edge-dash)/.test(n)) return 'layout'
if (/^(grid-|nav-|node-radius|node-sel-w|edge-w|edge-dash|chrome-h|tab-h|tab-radius)/.test(n)) return 'layout'
if (/^plugin-/.test(n)) return 'color.plugin'
return 'color'
}
@@ -262,10 +300,13 @@ function groupOf (name) {
function dtcgKey (name) {
const n = name.replace(/^--(?:iwb-)?/, '')
if (/^sp-/.test(n)) return n.slice(3)
if (/^space-/.test(n)) return n.slice(6)
if (/^radius-/.test(n)) return n.slice(7)
if (n === 'rd-sm') return 'sm'
if (n === 'rd') return 'base'
if (/^rd-/.test(n)) return n.slice(3)
if (/^fs-/.test(n)) return n.slice(3)
if (/^font-/.test(n)) return n.slice(5)
if (/^tr-/.test(n)) return n.slice(3)
if (/^sh-/.test(n)) return n.slice(3)
if (/^plugin-/.test(n)) return n.slice(7)
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
# 打包 dmg 的兜底实现(2026-11-23 新增)
#
# 为什么需要:`tauri build --bundles dmg` 在本机会失败在最后一步 bundle_dmg.sh:
# grep: bad regex '/dev/disk1Xs': brackets ([ ]) not balanced
# 根因是上游脚本第 431 行 `hdiutil attach | grep '^/dev/' | awk '{print $1}'`:
# 新版 macOS 的 attach 输出会同时给出 Apple_partition_scheme 与 Apple_HFS 两行,
# 两行被一起收进 DEV_NAME,拼出畸形模式后 grep 直接报错退出。
# 此时 **app 本体已经构建成功**,只是封装失败 —— 没必要重跑几分钟的 release 编译。
#
# 本脚本只做打包:复制 .app → 建 Applications 快捷方式 → hdiutil create。
# 产物名与 tauri 一致(image-workbench_<版本>_<arch>.dmg),release.sh 可直接接手。
#
# 用法:bash scripts/make-dmg.sh
set -euo pipefail
cd "$(dirname "$0")/.."
VERSION=$(node -e "console.log(require('./src-tauri/tauri.conf.json').version)")
case "$(uname -m)" in
arm64) ARCH=aarch64 ;;
x86_64) ARCH=x64 ;;
*) ARCH=$(uname -m) ;;
esac
BUNDLE_DIR="src-tauri/target/release/bundle"
APP="$BUNDLE_DIR/macos/image-workbench.app"
OUT="$BUNDLE_DIR/dmg/image-workbench_${VERSION}_${ARCH}.dmg"
if [ ! -d "$APP" ]; then
echo "✗ 找不到 $APP —— 先跑一次构建(npx tauri build),本脚本只负责封装" >&2
exit 1
fi
BIN="$APP/Contents/MacOS/image-workbench"
if [ ! -x "$BIN" ]; then
echo "✗ $APP 里没有可执行文件,产物不完整" >&2
exit 1
fi
APP_VER=$(plutil -extract CFBundleShortVersionString raw "$APP/Contents/Info.plist" 2>/dev/null || echo "?")
if [ "$APP_VER" != "$VERSION" ]; then
echo "✗ 产物版本 $APP_VER ≠ 配置版本 $VERSION(app 是旧的,先重新构建)" >&2
exit 1
fi
# 历史中断的打包会留下 rw.*.dmg 的挂载卷,它们会让下一次 hdiutil 复用设备号。
# 只卸载 /Volumes 下的临时名(dmg.XXXXXX),不动用户自己的磁盘。
for v in /Volumes/dmg.*; do
# set -e 下必须显式吞掉失败:卷可能正被占用,卸载不了也不该让打包停下
if [ -d "$v" ] && hdiutil detach "$v" -quiet 2>/dev/null; then
echo " 已卸载残留卷 $v"
fi
done || true
mkdir -p "$BUNDLE_DIR/dmg"
STAGE=$(mktemp -d "${TMPDIR:-/tmp}/iwb-dmg.XXXXXX")
trap 'rm -rf "$STAGE"' EXIT
cp -R "$APP" "$STAGE/"
ln -s /Applications "$STAGE/Applications"
hdiutil create -volname "image-workbench" -srcfolder "$STAGE" -ov -format UDZO -fs HFS+ "$OUT" >/dev/null
hdiutil verify "$OUT" >/dev/null
SIZE=$(stat -f%z "$OUT")
SHA=$(shasum -a 256 "$OUT" | awk '{print $1}')
echo "✓ $OUT"
echo " 版本 $VERSION / 大小 $((SIZE / 1048576))MB / sha256 $SHA"
+7 -1
View File
@@ -23,7 +23,13 @@ echo "版本:$VERSION"
if [ "$SKIP_BUILD" -eq 0 ]; then
echo "→ 构建 dmg…"
npx tauri build --bundles dmg
# tauri 的 bundle_dmg.sh 在新版 macOS 上会因设备名解析 bug 失败
# (grep: bad regex '/dev/disk1Xs': brackets ([ ]) not balanced,详见 scripts/make-dmg.sh 头注释)。
# 那一刻 app 本体已经构建成功,只是封装失败 —— 降级到 hdiutil 兜底,不重跑几分钟的 release 编译。
if ! npx tauri build --bundles dmg; then
echo "⚠ tauri 封装 dmg 失败,改用 hdiutil 兜底(app 已构建成功)"
bash scripts/make-dmg.sh
fi
fi
DMG=$(ls -t src-tauri/target/release/bundle/dmg/*.dmg 2>/dev/null | head -1 || true)
+28
View File
@@ -90,6 +90,34 @@
--tr-fast: 0.1s ease-out;
--tr-base: 0.2s ease-out; /* @deprecated tr-base/tr-slow → M3 的 --iwb-motion-*(tr-fast 仍被引用) */
--tr-slow: 0.3s ease-out;
--iwb-space-2: 2px;
--iwb-space-4: 4px;
--iwb-space-6: 6px;
--iwb-space-8: 8px;
--iwb-space-10: 10px;
--iwb-space-12: 12px;
--iwb-space-16: 16px;
--iwb-space-20: 20px;
--iwb-space-24: 24px;
--iwb-space-32: 32px;
--iwb-space-40: 40px;
--iwb-space-48: 48px;
--iwb-space-64: 64px;
--iwb-radius-chip: 6px; /* M4 圆角:胶囊/标签 */
--iwb-radius-control: 8px; /* 输入框/按钮 */
--iwb-radius-card: 10px; /* 卡片/分组 */
--iwb-radius-panel: 12px; /* 面板/工具栏 */
--iwb-radius-popover: 14px; /* 浮层/菜单/右键 */
--iwb-radius-full: 999px; /* 圆形/药丸 */
--iwb-font-xs: 11px; /* M4 字号:状态栏/徽标 */
--iwb-font-sm: 12px; /* 标签/次要正文 */
--iwb-font-md: 13px; /* 正文/工具栏标题 */
--iwb-font-lg: 15px; /* 小标题/节点标题 */
--iwb-font-xl: 17px; /* 面板标题 */
--iwb-font-2xl: 20px; /* 页面大标题 */
--iwb-chrome-h: 36px; /* 顶部标签条高度:tabstrip / dockarea / home-panel 三处共用(原来各写一遍 36px) */
--iwb-tab-h: 28px; /* 标签高度 */
--iwb-tab-radius: 7px; /* 标签圆角 */
/* —— 阴影 —— */
--sh-sm: 0 2px 8px rgba(0, 0, 0, 0.12); /* @deprecated → M3 的 --iwb-elevation-1 */
--sh-md: 0 6px 20px rgba(0, 0, 0, 0.16);
+26 -45
View File
@@ -172,10 +172,10 @@ button { font-family: inherit; }
.iwb-out-img { width: 100%; border-radius: 8px; border: 1px solid var(--iwb-border); }
.iwb-out-meta { font-size: 10px; color: var(--iwb-text2); margin-top: 3px; }
.iwb-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.iwb-toolbar { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; flex-wrap: wrap; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 12px; padding: 8px 10px; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.iwb-toolbar-title { font-weight: 700; font-size: 13px; margin-right: 2px; }
.iwb-toolbar { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; flex-wrap: wrap; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-panel); padding: 8px 10px; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.iwb-toolbar-title { font-weight: 700; font-size: var(--iwb-font-md); margin-right: 2px; }
.iwb-toolbar-sep { width: 1px; height: 18px; background: var(--iwb-border2); margin: 0 2px; }
.iwb-statusbar { position: absolute; top: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; max-width: calc(100vw - 60px); justify-content: flex-end; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 10px; padding: 6px 12px; z-index: 10; font-size: 11px; color: var(--iwb-text2); box-shadow: 0 4px 16px rgba(0,0,0,0.12); transition: right 0.15s; }
.iwb-statusbar { position: absolute; top: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; max-width: calc(100vw - 60px); justify-content: flex-end; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-card); padding: 6px 12px; z-index: 10; font-size: var(--iwb-font-xs); color: var(--iwb-text2); box-shadow: 0 4px 16px rgba(0,0,0,0.12); transition: right 0.15s; }
.iwb-status-err { color: var(--iwb-err); }
.iwb-status-ok { color: var(--iwb-ok); }
/* 生成中状态:直接附着在顶部计时/状态背景,确保不依赖画布节点可见性 */
@@ -356,10 +356,6 @@ button { font-family: inherit; }
.iwb-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--iwb-text); }
.iwb-hdrbox { min-height: 54px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; resize: vertical; }
/* ---- v2 P3:4-Tab 设置 ---- */
.iwb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--iwb-border); padding: 8px 12px 0; }
.iwb-tab { border-bottom: none; }
.iwb-tab-active { border-color: var(--iwb-border); }
.iwb-addrrow { gap: 6px; margin-bottom: 6px; }
.iwb-speed { border: 1px solid var(--iwb-border); border-radius: 8px; padding: 6px 8px; margin: 6px 0; background: var(--iwb-layer); }
.iwb-speed-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 11px; }
@@ -424,7 +420,6 @@ button { font-family: inherit; }
.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-tabs { padding: 8px 20px 0; }
.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); }
/* 设置弹窗固定高度:切换 Tab 不改变窗口大小;内容区内部滚动 */
@@ -470,7 +465,7 @@ button { font-family: inherit; }
@keyframes iwb-fadein { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* ---- v3:左侧多工作台 ---- */
.iwb-wsrail { position: absolute; left: 0; top: 36px; bottom: 0; width: 52px; background: var(--iwb-panel); border-right: 1px solid var(--iwb-border); z-index: 25; display: flex; flex-direction: column; align-items: stretch; transition: width 0.15s; }
.iwb-wsrail { position: absolute; left: 0; top: var(--iwb-chrome-h); bottom: 0; width: 52px; background: var(--iwb-panel); border-right: 1px solid var(--iwb-border); z-index: 25; display: flex; flex-direction: column; align-items: stretch; transition: width 0.15s; }
.iwb-wsrail-title { align-items: center; gap: 4px; padding: 14px 12px; font-weight: 800; font-size: 18px; color: var(--iwb-text); border-bottom: 1px solid var(--iwb-border); cursor: default; user-select: none; white-space: nowrap; flex: 0 0 auto; justify-content: center; }
.iwb-wsrail-title:hover { background: var(--iwb-hover); }
/* 展开态标题行右侧 ⋯ 三点菜单(Portal 挂 body + fixed 定位:右侧展开不切割、层级高于画布) */
@@ -533,10 +528,6 @@ button { font-family: inherit; }
/* ---- 右侧统一面板抽屉(提示词库 / 节点组 / 图片历史) ---- */
.iwb-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 330px; background: var(--iwb-panel); border-left: 1px solid var(--iwb-border); z-index: 22; display: flex; flex-direction: column; }
.iwb-drawer-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--iwb-border); flex: 0 0 auto; }
.iwb-drawer-tab { background: none; border: 1px solid transparent; border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--iwb-text2); cursor: pointer; white-space: nowrap; }
.iwb-drawer-tab:hover { color: var(--iwb-text); }
.iwb-drawer-tab-active { background: var(--iwb-layer); border-color: var(--iwb-border); color: var(--iwb-brand-text, var(--iwb-brand)); font-weight: 700; }
.iwb-drawer-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.iwb-drawer-toggle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 21; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-right: none; border-radius: 8px 0 0 8px; padding: 12px 5px; cursor: pointer; font-size: 12px; color: var(--iwb-text2); box-shadow: -4px 0 12px rgba(0,0,0,0.1); letter-spacing: 2px; }
.iwb-drawer-toggle:hover { color: var(--iwb-brand-text, var(--iwb-brand)); }
@@ -569,7 +560,7 @@ button { font-family: inherit; }
.iwb-history-manage-tools { display: inline-flex; align-items: center; gap: 4px; }
/* 工具栏放大 */
.iwb-toolbar-bottom { position: static; padding: 10px 14px; gap: 8px; width: auto; max-width: 100%; pointer-events: auto; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.iwb-toolbar-bottom { position: static; padding: 10px 14px; gap: 8px; width: auto; max-width: 100%; pointer-events: auto; background: var(--iwb-panel); border: 1px solid var(--iwb-border); border-radius: var(--iwb-radius-panel); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.iwb-toolbar-bottom .iwb-btn { padding: 7px 10px; background: transparent !important; border: none !important; color: var(--iwb-text2); opacity: 0.75; transition: opacity 0.12s, color 0.12s; }
.iwb-toolbar-bottom .iwb-btn:hover { opacity: 1; color: var(--iwb-text); }
.iwb-toolbar-bottom .iwb-btn:active { opacity: 1; color: var(--iwb-text); }
@@ -579,7 +570,7 @@ button { font-family: inherit; }
**从 fork 快照起就没有任何 JS 生产者**(git log -S 可查),是上游遗留的死选择器,
所以不是「按钮高亮失效的 bug」,而是「永不生效的规则」。要真做工具栏选中态请显式加类并走 token。 */
.iwb-toolbar-bottom .iwb-ic { width: 18px; height: 18px; }
.iwb-toolbar-bottom .iwb-tgroup { padding: 4px 8px; font-size: 11px; background: transparent !important; color: var(--iwb-text2); }
.iwb-toolbar-bottom .iwb-tgroup { padding: 4px 8px; font-size: var(--iwb-font-xs); background: transparent !important; color: var(--iwb-text2); }
/* ---- 统一悬停说明(data-tip 自定义 tooltip) ---- */
[data-tip] { position: relative; }
@@ -683,7 +674,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-num { width: 76px; min-width: 76px; flex: none; }
.iwb-keyname { flex: 0 0 110px; min-width: 110px; }
.iwb-addr-tag { flex: 0 0 26px; text-align: right; }
.iwb-drawer-tab { display: inline-flex; align-items: center; gap: 5px; }
.iwb-wsrail-title-text { display: inline-flex; align-items: center; gap: 6px; }
.iwb-wsrail-title .iwb-ic { width: 20px; height: 20px; }
.iwb-wsrail-label { display: flex; align-items: center; gap: 5px; }
@@ -700,11 +690,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* ---- 右侧竖向面板栏(与左侧栏统一:无阴影) ---- */
.iwb-rightrail { position: absolute; right: 0; top: 0; bottom: 0; width: 48px; background: transparent; z-index: 24; display: flex; flex-direction: column; align-items: center; padding: 12px 4px; gap: 8px; }
.iwb-rail-tab { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 40px; padding: 9px 2px; border-radius: 8px; background: var(--iwb-layer); border: 1px solid var(--iwb-border); color: var(--iwb-text2); font-size: 12px; cursor: pointer; }
.iwb-rail-tab:hover { border-color: var(--iwb-brand); color: var(--iwb-brand-text, var(--iwb-brand)); }
.iwb-rail-tab-active { border-color: var(--iwb-brand); background: color-mix(in srgb, var(--iwb-brand) 14%, transparent); color: var(--iwb-text); font-weight: 700; }
.iwb-rail-tab .iwb-ic { width: 16px; height: 16px; }
.iwb-rail-tab .iwb-btn-text { writing-mode: vertical-rl; font-size: 11px; letter-spacing: 2px; }
.iwb-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--iwb-border); flex: 0 0 auto; }
.iwb-drawer-toggle { display: none; }
@@ -1172,14 +1157,18 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-canvas-meta .iwb-status-err { color: var(--iwb-err); }
.iwb-canvas-topbar .iwb-top-nav-icon { width: 30px; height: 30px; }
/* S12:顶部标签条(浏览器式多画布标签)——UX_SPEC §4 单框扁平 token(容器透明、active 品牌色扁平高亮、只用 CSS 变量) */
.iwb-tabstrip { position: absolute; left: 0; right: 0; top: 0; height: 36px; z-index: 36; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--iwb-chrome); box-sizing: border-box; border-bottom: 1px solid var(--iwb-border); overflow-x: auto; scrollbar-width: none; pointer-events: none; }
.iwb-tabstrip { position: absolute; left: 0; right: 0; top: 0; height: var(--iwb-chrome-h); z-index: 36; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--iwb-chrome); box-sizing: border-box; border-bottom: 1px solid var(--iwb-border); overflow-x: auto; scrollbar-width: none; pointer-events: none; }
.iwb-tabstrip .iwb-tab { pointer-events: auto; }
.iwb-tabstrip::-webkit-scrollbar { display: none; }
.iwb-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--iwb-text2); font-size: 12px; cursor: pointer; white-space: nowrap; max-width: 190px; transition: background .15s ease, color .15s ease; }
.iwb-tab:hover { background: var(--iwb-layer2); color: var(--iwb-text); }
.iwb-tab-active { background: color-mix(in srgb, var(--iwb-tint) 9%, transparent); color: var(--iwb-text); font-weight: 600; }
/* 暗色下标签条本身是中灰:用「近黑 9%」叠上去几乎看不出选中 ⇒ 改为**提亮**一档(2026-11-01 用户反馈) */
.theme-dark .iwb-tabstrip .iwb-tab-active { background: var(--iwb-hover); }
/* 标签:**全项目只有这一套**(v3.27.1 收敛)。高度/圆角/字号/内距走 token,改一档全局一致。
* 激活态只有一条规则:品牌淡底 + 品牌字 + 600。此前 5 套变体里的抽屉 / 右竖栏 / 资源中心
* 三套已被新 UI 取代且无任何生产者(dist 里搜不到类名),规则连同父容器一并删除;
* 设置侧栏原先单独写了一份激活态,现在直接继承这一条。 */
.iwb-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: var(--iwb-tab-h); padding: 0 var(--iwb-space-12); border: 0; border-radius: var(--iwb-tab-radius); background: transparent; color: var(--iwb-text2); font-size: var(--iwb-font-sm); cursor: pointer; white-space: nowrap; max-width: 190px; transition: background .15s ease, color .15s ease; }
.iwb-tab:hover { background: var(--iwb-hover); color: var(--iwb-text); }
.iwb-tab-active { background: color-mix(in srgb, var(--iwb-brand) 14%, transparent); color: var(--iwb-brand-text, var(--iwb-brand)); font-weight: 600; }
/* 暗色下品牌 14% 叠在 #121212 上几乎看不出 ⇒ 加深到 22%;文字走 brand-text 保证对比度 */
.theme-dark .iwb-tab-active { background: color-mix(in srgb, var(--iwb-brand) 22%, transparent); }
.iwb-tab:focus-visible { outline: var(--iwb-focus-ring); outline-offset: 1px; }
/* 首页激活胶囊走灰阶(首页整体灰色系;画布标签仍用品牌色) */
.iwb-tab-home.iwb-tab-active { background: transparent; color: var(--iwb-text); }
@@ -1190,9 +1179,9 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 标签条完成态圆点:生成完成=绿、失败/中断=红(运行中为默认品牌色) */
.iwb-tab-dot-ok { background: var(--iwb-ok); }
.iwb-tab-dot-err { background: var(--iwb-err); }
.iwb-tab-new { color: var(--iwb-text2); font-weight: 700; padding: 0 10px; font-size: 15px; line-height: 1; }
.iwb-tab-new { color: var(--iwb-text2); font-weight: 700; padding: 0 var(--iwb-space-8); font-size: var(--iwb-font-lg); line-height: 1; }
.iwb-tab-new:hover { background: color-mix(in srgb, var(--iwb-brand) 12%, transparent); color: var(--iwb-brand-text, var(--iwb-brand)); }
.iwb-tab-close { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 31px; /* 与标签名留约 3 个字的间距(gap 5px + 31px ≈ 36px) */ border: 0; border-radius: 4px; background: transparent; color: var(--iwb-text2); cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0; }
.iwb-tab-close { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 31px; /* 与标签名留约 3 个字的间距(gap 5px + 31px ≈ 36px) */ border: 0; border-radius: var(--iwb-radius-chip); background: transparent; color: var(--iwb-text2); cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0; }
.iwb-tab:hover .iwb-tab-close { opacity: 1; }
.iwb-tab-close:hover { background: color-mix(in srgb, var(--iwb-text2) 16%, transparent); color: var(--iwb-text); }
.iwb-tab-close .iwb-ic { width: 12px; height: 12px; }
@@ -1214,13 +1203,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* 顶栏资源按钮激活态 */
.iwb-top-nav-icon-active { background: var(--iwb-layer2); color: var(--iwb-text); }
/* 资源中心(全屏版三 tab)—— 单框扁平设计:容器透明无边框,active 用品牌色扁平高亮(统一设计语言) */
.iwb-res-tabs { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; flex: 0 0 auto; }
.iwb-res-tab { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--iwb-text2); cursor: pointer; font-size: 12px; white-space: nowrap; transition: background .15s, color .15s; }
.iwb-res-tab:hover { color: var(--iwb-text); background: color-mix(in srgb, var(--iwb-text2) 10%, transparent); }
.iwb-res-tab-active { color: var(--iwb-text); background: color-mix(in srgb, var(--iwb-panel) 55%, transparent); font-weight: 600; }
.iwb-res-tab .iwb-ic { width: 14px; height: 14px; }
.iwb-fullpanel .iwb-res-tabs { margin-left: 12px; }
/* 资源中心非提示词库 tab 内容撑满容器 */
.iwb-full-main > .iwb-groups-embedded, .iwb-full-main > .iwb-history-embedded { width: 100%; flex: 1 1 auto; }
@@ -1678,8 +1660,8 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
}
/* S13:统一标签栏——首页/landing 面板下移 36px 让出常驻标签条 */
.iwb-overlay .iwb-home-panel { top: 36px; }
.iwb-overlay .iwb-landing-panel { top: 36px; }
.iwb-overlay .iwb-home-panel { top: var(--iwb-chrome-h); }
.iwb-overlay .iwb-landing-panel { top: var(--iwb-chrome-h); }
.iwb-plugin-row { padding: 8px 0; border-bottom: 1px solid var(--iwb-border); }
.iwb-plugin-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border: 1px solid var(--iwb-border); border-radius: 999px; font-size: 11px; color: var(--iwb-text2); background: var(--iwb-layer2); }
@@ -1689,7 +1671,6 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.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-nav-item.iwb-tab-active { background: color-mix(in srgb, var(--iwb-brand) 16%, transparent); color: var(--iwb-text); font-weight: 600; }
.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; }
@@ -2053,7 +2034,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* ===== 左右停靠栏(v3.25.35,Obsidian 式) =====
* 画布始终 inset:0 不动;只有工具栏/小地图/提示条按 --iwb-dock-l/--iwb-dock-r 让位。
*/
.iwb-dockarea { position: absolute; left: 0; right: 0; bottom: 0; top: 36px; z-index: 24; pointer-events: none; }
.iwb-dockarea { position: absolute; left: 0; right: 0; bottom: 0; top: var(--iwb-chrome-h); z-index: 24; pointer-events: none; }
/* 左右栏只在画布视图出现:首页/落地页必须整块隐藏(网页面板是原生子 webview,盖在 DOM 之上,
只有让它 rect 归零被 park,才不会把首页糊住) */
.iwb-overlay.iwb-view-home .iwb-dockarea,
@@ -2073,7 +2054,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-dock.right .iwb-dock-head { justify-content: flex-start; }
.iwb-dock-btn {
width: 30px; height: 28px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
border: 0; border-radius: 7px; background: transparent; color: var(--iwb-text2); cursor: pointer;
border: 0; border-radius: var(--iwb-tab-radius); background: transparent; color: var(--iwb-text2); cursor: pointer;
position: relative; padding: 0;
}
.iwb-dock-btn:hover { background: color-mix(in srgb, var(--iwb-tint) 4%, transparent); color: var(--iwb-text); }
@@ -2084,7 +2065,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-dock-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; overscroll-behavior: contain; }
.iwb-dock-body > * { min-height: 0; }
.iwb-dock-plugin { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.iwb-dock-empty { padding: 16px; font-size: 12px; color: var(--iwb-text2); }
.iwb-dock-empty { padding: var(--iwb-space-16); font-size: var(--iwb-font-sm); color: var(--iwb-text2); }
.iwb-dock-resize { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 3; }
.iwb-dock.left .iwb-dock-resize { right: -4px; }
.iwb-dock.right .iwb-dock-resize { left: -4px; }
@@ -2100,12 +2081,12 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
.iwb-dock-drop { position: absolute; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--iwb-brand); pointer-events: none; }
.iwb-dock-ghost {
position: fixed; z-index: 1000; pointer-events: none; display: inline-flex; align-items: center; gap: 6px;
height: 26px; padding: 0 10px; border-radius: 7px; font-size: 12px;
height: 26px; padding: 0 var(--iwb-space-8); border-radius: var(--iwb-tab-radius); font-size: var(--iwb-font-sm);
background: var(--iwb-panel); color: var(--iwb-text); border: 1px solid var(--iwb-border2);
box-shadow: 0 8px 24px rgba(0,0,0,.18); white-space: nowrap;
}
/* 顶栏与标签条随左右栏内缩(标题跟着缩进;画布仍不动) */
.iwb-canvas-topbar { padding-left: 10px; padding-right: 14px; box-shadow: none !important; background: transparent !important; height: 56px; border-bottom: 0 !important; padding: 0 14px; gap: 8px; top: 36px; pointer-events: none; left: var(--iwb-dock-l, 0px) !important; right: var(--iwb-dock-r, 0px) !important; }
.iwb-canvas-topbar { padding-left: 10px; padding-right: 14px; box-shadow: none !important; background: transparent !important; height: 56px; border-bottom: 0 !important; padding: 0 14px; gap: 8px; top: var(--iwb-chrome-h); pointer-events: none; left: var(--iwb-dock-l, 0px) !important; right: var(--iwb-dock-r, 0px) !important; }
.iwb-tabstrip { left: 0 !important; right: 0 !important; }
.iwb-tab-spacer { flex: 1 1 auto; }
.iwb-tab-actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; pointer-events: auto; }
@@ -2133,7 +2114,7 @@ html { scrollbar-width: thin; scrollbar-color: var(--iwb-border2) color-mix(in s
/* ── 一级导航(v3.25.59):最左 52px 纯图标栏 ─────────────────────────── */
.iwb-navrail {
position: absolute; left: 0; top: 36px; bottom: 0; width: 52px; z-index: 27;
position: absolute; left: 0; top: var(--iwb-chrome-h); bottom: 0; width: 52px; z-index: 27;
display: flex; flex-direction: column; align-items: center; gap: 6px;
padding: 10px 0 12px; background: var(--iwb-home-bg);
border-right: 1px solid var(--iwb-border); box-sizing: border-box;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

+4 -2
View File
@@ -30,7 +30,9 @@ assert.ok(source.includes("inst[id].version"), '应比较 inst[id].version')
// v3.25.57:宿主提示词界面下线(改由 promptlib 插件提供),资源中心浮层的 resourceTab 钉点随组件删除
assert.ok(!source.includes("resourceTab === 'prompts'"), '宿主不应再保留资源中心提示词 tab 实现')
assert.ok(!css.includes('.iwb-leftrail'))
assert.ok(css.includes('.iwb-res-tabs {'))
assert.ok(css.includes('.iwb-res-tab-active {'))
// v3.27.1(M4-B1):这两条与上一行注释矛盾 —— 注释说「随组件删除」,断言却还要求存在。
// 现在反过来钉「不得复活」:标签统一到 .iwb-tab / .iwb-tab-active 一套。
assert.ok(!css.includes('.iwb-res-tabs {'))
assert.ok(!css.includes('.iwb-res-tab-active {'))
assert.ok(css.includes('.iwb-overlay.drawer-open .iwb-canvas { left: 0 !important;'))
console.log('left resource layout checks passed')
+9 -2
View File
@@ -42,7 +42,11 @@ assert.ok(source.includes('if (!homeManage) openCanvasEditor(w.id)'))
assert.ok(source.includes("iwb-rename-input"))
assert.ok(source.includes("'确定彻底删除画布「' + (w.name || '未命名画布') + '」?此操作不可恢复。'"))
assert.ok(!source.includes('Codex 未连接'))
assert.ok(css.includes('.iwb-res-tabs'))
// v3.27.1(M4-B1):标签收敛为唯一一套。资源中心的三段式页签已随新 UI 下线(dist 里
// iwb-res-tab 出现 0 次,只剩 e2e 里的过时 locator),这里反过来断言它不得复活。
assert.ok(!css.includes('.iwb-res-tabs'), 'v3.27.1:资源中心旧页签已删除,统一到 .iwb-tab')
assert.ok(!css.includes('.iwb-drawer-tab'), 'v3.27.1:抽屉页签已删除(已被停靠栏取代)')
assert.ok(!css.includes('.iwb-rail-tab'), 'v3.27.1:右竖栏页签已删除(无生产者)')
assert.ok(css.includes('.iwb-home-card-title strong { font-size: 15px;'))
// v3.1.0 首页灰色系:蓝 accent 清零(激活项/胶囊/chip/星标全走墨色或灰阶)
assert.ok(/\.iwb-tab-home\.iwb-tab-active \{[^}]*background: transparent/.test(css)) // 首页按钮无选中底色
@@ -65,7 +69,10 @@ assert.ok(css.includes('--iwb-brand: #6b7280'), 'v3.26.44:品牌色恢复为
assert.ok(css.includes('--iwb-brand-text:'), '品牌色的文字版必须独立存在(暗色下填充色当文字只有 3.9:1)')
// v3.26.42:半透明底色的基色由 --iwb-text 换成 --iwb-tint(tint 默认 = 派生文字色,视觉不变;
// 分离的目的:外观面板调字体颜色时,悬停/标签/分隔底色不被连带改掉)
assert.ok(/\.iwb-tab-active \{ background: color-mix\(in srgb, var\(--iwb-tint\) 9%, transparent\)/.test(css))
// v3.27.1(M4-B1):激活态收敛为唯一一条 —— 品牌淡底 + 品牌字 + 600。
// 此前是 tint 9% 中性底,与「选中=品牌高亮」的设计语言不一致;5 套变体各写一份也已删除。
assert.ok(/\.iwb-tab-active \{ background: color-mix\(in srgb, var\(--iwb-brand\) 14%, transparent\); color: var\(--iwb-brand-text/.test(css), 'v3.27.1:标签激活态应为品牌淡底')
assert.ok(/\.iwb-tab \{[^}]*height: var\(--iwb-tab-h\)[^}]*border-radius: var\(--iwb-tab-radius\)/.test(css), 'v3.27.1:标签高度/圆角必须走 token')
assert.ok(!/(#4f6ef7|#6366f1|#3b82f6|#0ea5e9|#8b5cf6)/i.test(css))
assert.ok(!/(#4f6ef7|#6366f1|#3b82f6|#0ea5e9|#8b5cf6|#f59e0b|#10b981)/i.test(source))
// v3.1.0 资源中心面板灰阶化:选中分类胶囊=浅白灰、标签/星标/页签/高亮全去蓝;首页改名按钮去底色
+3 -1
View File
@@ -31,7 +31,9 @@ assert.ok(fs.readFileSync(path.join(__dirname, '..', 'src', 'ui-dock-panels.js')
assert.ok((source + dockPanelsSrc).includes("pluginId: 'gallery'"))
assert.ok((source + dockPanelsSrc).includes("图库插件未安装"))
assert.ok(!source.includes("dockGalleryEl"))
assert.ok(css.includes('.iwb-res-tabs {'))
// v3.27.1(M4-B1):这条断言原先自相矛盾 —— 注释从 v3.25.57 起就说「已下线、钉点移除」,
// 但断言一直要求 .iwb-res-tabs 存在,于是这组死 CSS 谁也不敢删。现在反过来钉「不得复活」。
assert.ok(!css.includes('.iwb-res-tabs {'), '资源中心旧页签已删除(统一到 .iwb-tab)')
assert.ok(source.includes("'无限画布'"))
assert.ok(source.includes("className: 'iwb-canvas' + (shellView !== 'canvas' ? ' iwb-canvas-hidden'"))
assert.ok(css.includes('.iwb-canvas-hidden { visibility: hidden; pointer-events: none; }'))
+1 -1
View File
@@ -19,6 +19,6 @@ assert.ok(!source.includes("railBtn('groups'"))
assert.ok(!source.includes("railBtn('history'"))
assert.ok(css.includes('.iwb-product-nav'))
assert.ok(css.includes('.iwb-landing-panel'))
assert.ok(css.includes('.iwb-res-tabs'))
assert.ok(!css.includes('.iwb-res-tabs'), 'v3.27.1:资源中心旧页签已删除(统一到 .iwb-tab)')
assert.ok(!css.includes('.iwb-left-drawer'))
console.log('three page layout checks passed')