From acbf31c26e1b6da3b5a0039f63de4075e4a40d71 Mon Sep 17 00:00:00 2001 From: qiqi Date: Sat, 21 Nov 2026 23:44:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(gallery):=201.6.7=20=E5=8F=AF=E8=A7=81?= =?UTF-8?q?=E5=90=8E=E9=87=8D=E6=B5=8B=20+=20=E5=BB=B6=E6=97=B6=E9=87=8D?= =?UTF-8?q?=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gallery/package.json | 2 +- gallery/src/index.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gallery/package.json b/gallery/package.json index 773d587..bf6e82a 100644 --- a/gallery/package.json +++ b/gallery/package.json @@ -1,7 +1,7 @@ { "name": "@iwb-plugin/gallery", "private": true, - "version": "1.6.6", + "version": "1.6.7", "description": "图库:右栏图片墙(筛选/多选/预览/插入画布/下载/删除),数据由宿主 gallery 能力提供", "ibwPlugin": { "id": "gallery", diff --git a/gallery/src/index.js b/gallery/src/index.js index 1c996d9..23de22c 100644 --- a/gallery/src/index.js +++ b/gallery/src/index.js @@ -467,6 +467,8 @@ if (gridW <= 0) global.requestAnimationFrame(retry) } global.requestAnimationFrame(retry) + // v1.6.7:再补几次延时重测(停靠栏展开动画、首帧布局未完成时能在 1s 内自愈) + ;[120, 400, 900].forEach(function (ms) { setTimeout(function () { try { measure(); if (gridW > 0) renderGrid() } catch (e) { /* ignore */ } }, ms) }) // v1.3.0:自动恢复 —— 面板重新可见(切回 tab / 窗口聚焦 / 后台回来)且距上次拉取 >5s 时重拉一次, // 这样图床恢复、后台补图后不必手动刷新;同时保留底部「刷新」按钮做即时重试。 @@ -478,7 +480,13 @@ try { if (typeof IntersectionObserver === 'function') { var io = new IntersectionObserver(function (entries) { - for (var i = 0; i < entries.length; i++) if (entries[i].isIntersecting) autoRefresh() + for (var i = 0; i < entries.length; i++) { + if (entries[i].isIntersecting) { + // v1.6.7:面板真正可见后再量一次宽度并重排(首帧可能还是 0 宽) + try { measure(); renderGrid() } catch (e) { /* ignore */ } + autoRefresh() + } + } }, { threshold: 0.15 }) io.observe(wrap) } @@ -505,7 +513,7 @@ global.IWBPluginHost.register({ id: 'gallery', name: '图库', - version: '1.6.6', + version: '1.6.7', apiVersion: 1, capabilities: ['panels', 'gallery'], data: { schemaVersion: 1, maxBytes: 65536 },