diff --git a/plugins/gallery/main.js b/plugins/gallery/main.js index 84bdcda..498c2be 100644 --- a/plugins/gallery/main.js +++ b/plugins/gallery/main.js @@ -10,7 +10,8 @@ var PANEL_ID = 'gallery-panel' var DEF = { insertK: '1k', tile: 110, range: '' } // v1.6.2:图幅=**实际显示宽度上限**(此前只当「算列数」用,独列时会被拉到撑满面板,选「小」也很大) - var TILES = [[80, '小'], [110, '中'], [150, '大'], [200, '特大']] + // v1.6.3:新增「极小」64px 档(面板窄时想一行看更多图) + var TILES = [[64, '极小'], [80, '小'], [110, '中'], [150, '大'], [200, '特大']] var KS = [['orig', '原图'], ['2k', '2K'], ['1k', '1K'], ['0.5k', '0.5K']] var RANGES = [['', '全部'], ['today', '今天'], ['7d', '7 天'], ['30d', '30 天']] @@ -487,7 +488,7 @@ global.IWBPluginHost.register({ id: 'gallery', name: '图库', - version: '1.6.2', + version: '1.6.3', apiVersion: 1, capabilities: ['panels', 'gallery'], data: { schemaVersion: 1, maxBytes: 65536 }, diff --git a/plugins/gallery/manifest.json b/plugins/gallery/manifest.json index 489e956..c75a178 100644 --- a/plugins/gallery/manifest.json +++ b/plugins/gallery/manifest.json @@ -1,7 +1,7 @@ { "id": "gallery", "name": "图库", - "version": "1.6.2", + "version": "1.6.3", "apiVersion": 1, "main": "main.js", "style": "styles.css", @@ -13,7 +13,7 @@ "图库" ], "files": { - "main.js": "da30d606598e9a6e6afd0fce845f937b23c7461938b5ca08623be32dcac9c23e", + "main.js": "6628f9aa5be68e0ed798244a1fd4405e50801181e6c0779b22a0723f84309865", "styles.css": "81b23c43b0308c678bf95e00d6663abcb8b300242ab952ca56b1390fd74bb53e" } } diff --git a/plugins/index.json b/plugins/index.json index 07bef30..3c24c76 100644 --- a/plugins/index.json +++ b/plugins/index.json @@ -22,9 +22,9 @@ "dir": "gallery", "main": "main.js", "style": "styles.css", - "version": "1.6.2", + "version": "1.6.3", "files": { - "main.js": "da30d606598e9a6e6afd0fce845f937b23c7461938b5ca08623be32dcac9c23e", + "main.js": "6628f9aa5be68e0ed798244a1fd4405e50801181e6c0779b22a0723f84309865", "styles.css": "81b23c43b0308c678bf95e00d6663abcb8b300242ab952ca56b1390fd74bb53e" } }, diff --git a/tests/plugin-gallery-recovery-test.js b/tests/plugin-gallery-recovery-test.js index 073af27..f3431fb 100644 --- a/tests/plugin-gallery-recovery-test.js +++ b/tests/plugin-gallery-recovery-test.js @@ -156,7 +156,7 @@ async function boot ({ items, thumb, clock }) { // 改图幅 → 落盘 + 重排 btn.dispatchEvent(new env.window.MouseEvent('click', { bubbles: true })) const tileSel = Array.from(panel.querySelectorAll('select'))[1] - tileSel.value = '150' // v1.6.2 图幅档位:80 小 / 110 中 / 150 大 / 200 特大 + tileSel.value = '150' // v1.6.3 图幅档位:64 极小 / 80 小 / 110 中 / 150 大 / 200 特大 tileSel.dispatchEvent(new env.window.Event('change')) await wait(320) assert.ok(env.patched, '改设置应通过 ctx.data 落盘') diff --git a/tests/plugin-gallery-ux-test.js b/tests/plugin-gallery-ux-test.js index 4db2cee..1987cb3 100644 --- a/tests/plugin-gallery-ux-test.js +++ b/tests/plugin-gallery-ux-test.js @@ -135,7 +135,7 @@ async function boot (opts) { assert.strictEqual(env.calls.insert[0][0].length, 2, '批量插入应含 2 张,实际 ' + env.calls.insert[0][0].length) } - // ---------- ⑤ 图幅=显示宽度上限(v1.6.2:不再被拉满面板)---------- + // ---------- ⑤ 图幅=显示宽度上限(v1.6.2 不再拉满面板;v1.6.3 新增极小 64)---------- { const env = await boot({ items: Array.from({ length: 6 }, (_, i) => ({ name: 'p' + i + '.png', w: 200, h: 300 })), @@ -155,7 +155,14 @@ async function boot (opts) { tileSel.dispatchEvent(new env.window.Event('change')) await wait(60) assert.ok(widths().every((w) => w === '200px'), '切到特大后列宽应为 200px,实际 ' + widths().join(',')) + + // v1.6.3 新增「极小」=64px:列宽 64,且列数比「特大」更多(图幅小 = 一行看更多) + tileSel.value = '64' + tileSel.dispatchEvent(new env.window.Event('change')) + await wait(60) + assert.ok(widths().every((w) => w === '64px'), '切到极小后列宽应为 64px,实际 ' + widths().join(',')) + assert.ok(env.host.querySelectorAll('.iwb-history-col').length > cols, '极小的列数应多于默认列数') } - console.log('gallery ux checks passed(失败统计+全部重试 / 右键菜单 5 项 / 多选拖拽批量插入 / 图幅列宽上限)') + console.log('gallery ux checks passed(失败统计+全部重试 / 右键菜单 5 项 / 多选拖拽批量插入 / 图幅列宽上限含 64 档)') })().catch((e) => { console.error(e); process.exit(1) }) \ No newline at end of file