fix(settings): 插件全部误报「可更新」(对象比字符串)v3.25.48
- 3.25.47 把已安装映射改为 {version,dir,file},但 newer 仍用 m.version !== inst[id] ⇒ 恒 true
- 改比 inst[id].version,并统一用 compareVersions(a,b) > 0(市场回退也不误报)
- 加源文本回归钉点:禁止 m.version !== inst[id]
This commit is contained in:
1 parent
fb8d13bf5c
commit
a21a73b370
7 files changed
+25
-7
No files matched your search
@@ -14,6 +14,15 @@
|
||||
> 3. 核验正式地址版本 → 之后才移动 `stable` / `stable-verified-<日期>` 标签、更新本 CHANGELOG、写 GitHub Release(`gh release create`)。
|
||||
> 测试发现问题 → 改 → 再 `deploy:test`,正式环境不受影响。回滚点 `git reset --hard stable`。
|
||||
|
||||
## v3.25.48(2026-11-20)修:插件全部误报「可更新」
|
||||
|
||||
- 症状:3.25.47 里 7 个已装插件全部显示「可更新」,点「更新」其实没有新版本。
|
||||
- 原因:v3.25.47 为区分「旧格式」把已安装映射从「版本字符串」改成 `{version, dir, file}`,
|
||||
但「可更新」判断仍写 `m.version !== inst[id]` —— 拿字符串比对象,恒为 true。
|
||||
- 修复:比较 `inst[id].version`,并统一改用 `IWBRuntimePluginLoader.compareVersions(a,b) > 0`,
|
||||
市场版本回退时也不会误报。
|
||||
- 回归钉点:`tests/left-resource-layout-test.js` 禁止再出现 `m.version !== inst[id]`。
|
||||
|
||||
## v3.25.47(2026-11-20)插件市场:可「转为新格式」重装(单文件 → 目录)
|
||||
|
||||
- 症状:已装 1.7.0(单文件)后,市场里同一版本只显示「移除外部副本」,**没有入口装成新的目录格式**;市场卡片页更是只剩「移除」。
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-workbench-web",
|
||||
"private": true,
|
||||
"version": "3.25.47",
|
||||
"version": "3.25.48",
|
||||
"description": "Browser-based node canvas image workbench",
|
||||
"scripts": {
|
||||
"build": "node scripts/build.js && node scripts/copy-plugins.js",
|
||||
|
||||
Generated
+1
-1
@@ -1983,7 +1983,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "image-workbench"
|
||||
version = "3.25.47"
|
||||
version = "3.25.48"
|
||||
dependencies = [
|
||||
"arboard",
|
||||
"base64 0.22.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "image-workbench"
|
||||
version = "3.25.47"
|
||||
version = "3.25.48"
|
||||
description = "无限画布 · 生图工作台桌面版"
|
||||
authors = ["malongan"]
|
||||
license = ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "image-workbench",
|
||||
"version": "3.25.47",
|
||||
"version": "3.25.48",
|
||||
"identifier": "com.malongan.imageworkbench",
|
||||
"build": {
|
||||
"frontendDist": "../dist",
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
return {
|
||||
id: id,
|
||||
name: m.name || (reg && reg.name) || id,
|
||||
version: m.version || inst[id] || (reg && reg.version) || '',
|
||||
version: m.version || (inst[id] && inst[id].version) || (reg && reg.version) || '',
|
||||
desc: m.desc || '',
|
||||
author: m.author || '',
|
||||
icon: m.icon || '◻',
|
||||
@@ -214,16 +214,22 @@
|
||||
enabled: reg ? !!reg.enabled : true,
|
||||
compatible: reg ? !!reg.compatible : true,
|
||||
registered: !!reg,
|
||||
newer: !!(m.version && inst[id] && m.version !== inst[id]),
|
||||
newer: !!(m.version && inst[id] && inst[id].version && cmpV(m.version, inst[id].version) > 0),
|
||||
}
|
||||
}).filter(function (row) { return hit(row.name, row.desc) })
|
||||
const availRows = mList.filter(function (m) { return !(m.id in inst) && !regById[m.id] && hit(m.name, m.desc) })
|
||||
const updatable = Object.keys(inst).filter(function (id) { const m = findM(id); return m.version && m.version !== inst[id] }).length
|
||||
const updatable = Object.keys(inst).filter(function (id) { const m = findM(id); const iv = inst[id] && inst[id].version; return !!(m.version && iv && cmpV(m.version, iv) > 0) }).length
|
||||
const dirHint = (function () {
|
||||
const F = (typeof window !== 'undefined') ? window.IWBStorageFile : null
|
||||
return (F && F.dir && F.dir()) ? (F.dir() + '/plugins/') : '资料目录/plugins/'
|
||||
})()
|
||||
const kb = function (n) { return !n ? '' : (n >= 1048576 ? (n / 1048576).toFixed(1) + ' MB' : Math.max(1, Math.round(n / 1024)) + ' KB') }
|
||||
// 版本比较统一走 loader.compareVersions(>0 才算有更新;避免「对象 vs 字符串」误判、也避免市场回退版本时误报)
|
||||
const cmpV = function (a, b) {
|
||||
const L = (typeof window !== 'undefined') ? window.IWBRuntimePluginLoader : null
|
||||
if (L && typeof L.compareVersions === 'function') return L.compareVersions(a, b)
|
||||
return String(a) === String(b) ? 0 : 1
|
||||
}
|
||||
|
||||
// ── 管理页:横向列表(名称/版本/作者 + 描述 + 操作 + 开关),像 Obsidian「第三方插件」 ──
|
||||
const manageView = function () {
|
||||
|
||||
@@ -24,6 +24,9 @@ assert.ok(!source.includes("className: 'iwb-left-drawer'"))
|
||||
assert.ok(!source.includes("className: 'iwb-canvas-expand'"))
|
||||
assert.ok(!source.includes("className: 'iwb-resource-float'"))
|
||||
assert.ok(source.includes("onRightOpen: (v) => setDrawerOpen(v)"))
|
||||
// v3.25.48 回归钉点:插件「可更新」必须比较版本字段,不能拿已安装条目(对象)与版本字符串直接比 —— 那会让全部插件永远显示可更新
|
||||
assert.ok(!source.includes("m.version !== inst[id]"), '不得直接比较 inst[id](它是 {version,dir,file} 对象)')
|
||||
assert.ok(source.includes("inst[id].version"), '应比较 inst[id].version')
|
||||
assert.ok(source.includes("resourceTab === 'prompts'"))
|
||||
assert.ok(!css.includes('.iwb-leftrail'))
|
||||
assert.ok(css.includes('.iwb-res-tabs {'))
|
||||
|
||||
Reference in new issue
Block a user