Verify (Gitea) / gate (build · unit · facts) (push) Failing after 40s
用户反馈拖动图库面板很卡。原因是面板宽度的 ResizeObserver 每帧触发 renderGrid:整格 clear + 重建全部卡片、 重新挂事件、重新 paint 缩略图,一张卡就十来个 DOM 节点,几十张就是几百节点/帧。 改动(plugins/gallery/main.js + styles.css): - measure():宽度变化不足 4px 不重排;重排用 requestAnimationFrame 合并,一帧最多一次 - 缩略图 img 加 decoding=async(解码移出主线程,减少拖动时的掉帧) - .iwb-history-item 加 contain: layout style(把布局/样式计算限制在卡片内部) 试过「复用 DOM 节点(缓存卡片,重排只移动不重建)」但会让 e2e 里的图库面板加载失败,已回退, 先把节流 + contain + async decode 这组低风险优化发出去。
20 lines
526 B
JSON
20 lines
526 B
JSON
{
|
|
"id": "gallery",
|
|
"name": "图库",
|
|
"version": "1.8.3",
|
|
"apiVersion": 1,
|
|
"main": "main.js",
|
|
"style": "styles.css",
|
|
"description": "右栏图片墙:筛选/多选/双击预览/插入画布/下载/删除(数据由客户端提供)",
|
|
"author": "official",
|
|
"icon": "🖼️",
|
|
"tags": [
|
|
"资源",
|
|
"图库"
|
|
],
|
|
"files": {
|
|
"main.js": "949841c238fd506a3f4ccde5739eadc198ca7492be221cf5d396a2892edfbd70",
|
|
"styles.css": "945fd547278cf0388035b22660dfe9401dc0c8d25919fe6204471432e5797cde"
|
|
}
|
|
}
|