Commit Graph
5 Commits
Author SHA1 Message Date
qiqi 2cd52d1d4e refactor(promptlib): 收藏入口归插件(宿主不再自带,随插件启停)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 43s
按项目所有人要求:提示词库插件负责「管理与收集」的完整能力,宿主只保留基础接口。

宿主侧移除(全部 4 处入口 + 实现):
- 节点气泡星标(app.js 单选气泡的「添加到提示词库」)
- 「选中操作 ▸ 添加到提示词库」、「该节点 ▸ 添加该提示词」
- 提示词节点标题栏星标(src/ui-node-card.js)
- src/runtime-workbench-logic.js 的 addPromptToLibrary(约 45 行)与 ui-canvas-nodes 的 onFavorite 注入

宿主侧保留:promptlib 能力(list/save/insert/copy/notify/onChanged/file*)、prompts 状态与 api('prompts')(备份/迁移)、插件数据通道。

宿主侧补回(此前缺失):右键菜单重新渲染 ctx.commands 注册的插件命令(「插件命令」分区)。

插件 promptlib 1.13.1 → 1.14.0:
- capabilities 增 nodeActions / commands
- nodeActions「收藏为提示词」:仅对 type=prompt 且 text 非空的节点出现(气泡按钮)
- commands「收藏选中的提示词」:右键「插件命令」入口
- 收藏写入插件数据 plugin-data/promptlib.json(以现有数据为基底,保留 cover:{img} 与分组),
  新条目 group:'' 即未分组,并 notify 回执

测试:
- tests/iwb-prompt-collect.spec.js 改为 3 条新契约:插件提供气泡入口 + 宿主无自带入口;
  右键插件命令可用且宿主旧条目已移除;插件停用后两个入口同时消失
- canvas-meta-notice 的旧「点按钮报错回执」用例改为「宿主不得再渲染该入口」
- tests/_helpers/wait.js openDockPanel 加固(等插件宿主初始化,修并行偶发)
- 棘轮下调:app.js 8324 / Workbench 2178

验证:npm run verify:ci 全绿(含 e2e 冒烟 31 条)。
2026-11-27 10:06:03 +08:00
qiqi 8d7ebb298f test(e2e): 新增停靠栏面板 helper(openDockPanel/openGallery),3 个 spec 改用图库面板入口
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m35s
2026-11-26 23:53:36 +08:00
qiqi 735522e487 test(e2e): 收口画布打开/安全区 helper,修掉已改名的导航锚点
背景:v3.25.6x 起旧类名 .iwb-top-nav-icon 已拆成一级导航 .iwb-nav-item 与画布工具条
.iwb-product-icon,一批 spec 还在点旧选择器 ⇒ 全部 click 超时(表现为「功能坏了」)。

改动:
1. tests/_helpers/wait.js 新增 openCanvas / canvasSafeRect / waitViewportSettled / NAV_ITEM / PRODUCT_ICON:
   统一「打开画布 → 等视口稳定 → 返回扣除停靠栏与工具条的安全区」,避免各 spec 自己算
   canvas.width * 0.75 落到侧栏上。
2. 7 个 spec 的锚点改为现名:
   - .iwb-top-nav-icon[title="服务与 Key 设置"] → .iwb-product-icon[...]
   - .iwb-top-nav-icon[title="切换主题样式"] → .iwb-navrail .iwb-nav-item[title="切换主题"]
   - 左右栏开关 → .iwb-navrail .iwb-nav-item[title="显示 / 隐藏左栏|右栏"]

仍未处理(下一轮):11 处 .iwb-top-nav-icon[title*="资源中心"] —— 资源中心已被停靠栏插件面板取代,
需要改为打开 .iwb-dock-btn[data-panel="gallery"] 并适配面板内的新 DOM。
2026-11-26 23:23:51 +08:00
qiqi 746fbc1e5e test(e2e): 修 8 个 spec 的失效选择器 .iwb-tab-home(v3.25.62 已删元素)→ 统一走导航「首页」;清死 CSS 与钉点 2026-11-24 22:16:17 +08:00
qiqi 0c7850c478 chore: fork snapshot of image-workbench-web@d5f9945 (上游文件原样,未做任何修改) 2026-11-16 18:33:00 +08:00