Commit Graph
5 Commits
Author SHA1 Message Date
qiqi fd9575a96e chore(plugins): 两仓同步 + 一致性守卫 + 插件规范(gallery 1.9.6 / promptlib 1.14.9 / sticky 1.0.8)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m0s
插件源码改回源仓(iwb-plugins-desktop),桌面仓 plugins/ 只作产物:
- 源仓侧:把 11-28 直接改在产物层的图库/提示词库改动回写为源码;修 validate 的字段扫描(先扫 register 块,
  找不到再回退整份文件,避免被业务代码 id: 'q' 误命中、也兼顾 __IWB_*_MANIFEST__ 构建产物);
  gallery 1.9.6 修「全部重试无效」与「量不到宽度时塌成 1 列」,promptlib 1.14.9
- 本仓侧:node scripts/sync-plugins-from-repo.js 重新生成 plugins/(gallery 1.9.6 / promptlib 1.14.9 / sticky 1.0.8)

新增机制:
- scripts/check-plugins-sync.js:逐插件比对产物与源仓(main.js/styles.css 的 sha256 + manifest/index 版本),
  不一致列出清单并给出修复命令;源仓不存在时跳过(CI/别人机器不阻塞)
- gen-market.js 开头调用该守卫:两仓不一致直接中止,不允许发市场
- package.json: npm run check:plugins
- docs/standards/plugin-source-of-truth.md:两仓职责、目录对照、三条红线、日常流程、应急回写步骤、常见错误对照

验证:源仓 npm run validate 15/15、npm test 全绿;桌面仓 verify:ci 32 passed。
2026-11-29 12:30:01 +08:00
qiqi 8f8de1cd26 fix(plugin): 便利贴产物改为内容寻址文件名(内容已变,哈希名必须跟着变)
plugins/runtime 的单文件插件按 plugin-<id>.<sha256前12位>.js 命名(内容寻址 + CDN immutable 缓存)。
上一轮改内容时只更新了 index.json 的 integrity、没改文件名 ⇒ 市场索引指向旧名,
而旧名在 CDN 上是 immutable 的,会出现「清单写新哈希、取到旧字节」。

改名 plugin-sticky.f5f77ac81467.js → plugin-sticky.f3b835f60b8a.js(实算哈希一致),
plugins/index.json 的 file 字段同步。
2026-11-27 09:03:03 +08:00
qiqi e02c3b66e9 chore(plugin): 清掉便利贴的面板专用样式;补 side 字段文档
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 39s
便利贴面板移除后,ensureStyle 里 9 条只服务面板的 CSS(iwb-sticky-panel* / iwb-sticky-add* /
iwb-sticky-list / iwb-sticky-row* / iwb-sticky-go*)成为死代码,一并删除;
节点本身的样式(iwb-sticky-node*)保持不变。index.json 的 SRI 同步更新。

文档:docs/standards/plugin-development.md 的面板章节补 icon / side 字段,
并写明「side 只决定首次回填、用户摆放优先」「纯节点插件不必注册面板」。

验证:npm run verify:ci 全绿(含 e2e 冒烟 31 条 / 45s)。
2026-11-27 08:53:59 +08:00
qiqi c313a11f3e fix(plugin): 移除便利贴的停靠栏面板,版本升至 1.0.9
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 49s
便利贴是纯画布节点(plugin:sticky:sticky),不需要边栏面板 —— 面板里的「插入便利贴 /
列表 / 定位」与节点本身重复,且此前被误用作 side 偏好的验证对象。

改动:
- 删除整段面板实现(registerPanel / mountPanel / refreshList / insertNote / ctxForPanel / noteList,85 行)
- capabilities: ['panels','nodeTypes','canvas'] → ['nodeTypes','canvas']
- 版本 1.0.8 → 1.0.9(能力面变更,需高于外部已装副本才会覆盖)
- plugins/index.json 同步 version 与 SRI integrity(已校验哈希一致)

节点类型注册不受影响(渲染 / 高度 / 端口配置原样保留)。
验证:npm run verify:ci 全绿(含 e2e 冒烟 31 条)。
2026-11-27 08:51:22 +08:00
qiqi f3c16803a3 fix(plugin): sticky 1.0.8 便利贴宽度变化后不算高度(文字下面多一行空白)
fitBody 的高度缓存只比 text/fontSize:宿主拖宽节点、侧栏开合、首帧 clientWidth=0
时都会沿用旧行数的高度,文字少一行时正好空出一整行;scrollHeight 的取整误差还会叠半行。
现在把 clientWidth 纳入缓存键、高度按「行高 × 整数行 + padding」对齐,并加 ResizeObserver。

源仓 iwb-plugins-desktop sticky/src/index.js + 契约测试 harness 两条新断言;
本仓 artifacts 由 scripts/sync-plugins-from-repo.js 生成(内容寻址 + SRI)。
2026-11-26 12:46:02 +08:00