fix(acp): pin @latest for all plugins and enable button when only floating versions exist
- install_missing_plugins now pins ALL @latest specs (not just newly installed) - When nothing is missing but @latest exists, the pin-only path runs - Modal button switches to 'Pin @latest Versions' when no missing plugins - Added pinVersions i18n key for 10 languages
This commit is contained in:
@@ -117,6 +117,10 @@ export function OpencodePluginsModal({
|
||||
|
||||
const missingCount =
|
||||
summary?.plugins.filter((p) => p.status === "missing").length ?? 0
|
||||
const floatingCount =
|
||||
summary?.plugins.filter((p) => p.declared_spec.endsWith("@latest"))
|
||||
.length ?? 0
|
||||
const hasActionablePlugins = missingCount > 0 || floatingCount > 0
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={handleClose}>
|
||||
@@ -209,7 +213,7 @@ export function OpencodePluginsModal({
|
||||
<div className="flex items-center justify-between">
|
||||
<Button
|
||||
size="sm"
|
||||
disabled={isOperating || missingCount === 0}
|
||||
disabled={isOperating || !hasActionablePlugins}
|
||||
onClick={handleInstallAll}
|
||||
>
|
||||
{stream.status === "running" ? (
|
||||
@@ -217,7 +221,9 @@ export function OpencodePluginsModal({
|
||||
) : (
|
||||
<Download className="h-3.5 w-3.5 mr-1.5" />
|
||||
)}
|
||||
{t("opencodePlugins.installAll")}
|
||||
{missingCount > 0
|
||||
? t("opencodePlugins.installAll")
|
||||
: t("opencodePlugins.pinVersions")}
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "غير مثبّت"
|
||||
},
|
||||
"installAll": "تثبيت جميع الإضافات المفقودة",
|
||||
"pinVersions": "تثبيت إصدارات @latest",
|
||||
"install": "تثبيت",
|
||||
"uninstall": "إزالة",
|
||||
"refresh": "تحديث",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "Nicht installiert"
|
||||
},
|
||||
"installAll": "Alle fehlenden installieren",
|
||||
"pinVersions": "@latest-Versionen fixieren",
|
||||
"install": "Installieren",
|
||||
"uninstall": "Deinstallieren",
|
||||
"refresh": "Aktualisieren",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "Missing"
|
||||
},
|
||||
"installAll": "Install All Missing",
|
||||
"pinVersions": "Pin @latest Versions",
|
||||
"install": "Install",
|
||||
"uninstall": "Uninstall",
|
||||
"refresh": "Refresh",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "No instalado"
|
||||
},
|
||||
"installAll": "Instalar todos los faltantes",
|
||||
"pinVersions": "Fijar versiones @latest",
|
||||
"install": "Instalar",
|
||||
"uninstall": "Desinstalar",
|
||||
"refresh": "Actualizar",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "Non installé"
|
||||
},
|
||||
"installAll": "Installer tous les manquants",
|
||||
"pinVersions": "Fixer les versions @latest",
|
||||
"install": "Installer",
|
||||
"uninstall": "Désinstaller",
|
||||
"refresh": "Actualiser",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "未インストール"
|
||||
},
|
||||
"installAll": "不足プラグインをすべてインストール",
|
||||
"pinVersions": "@latest バージョンを固定",
|
||||
"install": "インストール",
|
||||
"uninstall": "アンインストール",
|
||||
"refresh": "更新",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "미설치"
|
||||
},
|
||||
"installAll": "누락된 플러그인 모두 설치",
|
||||
"pinVersions": "@latest 버전 고정",
|
||||
"install": "설치",
|
||||
"uninstall": "제거",
|
||||
"refresh": "새로고침",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "Não instalado"
|
||||
},
|
||||
"installAll": "Instalar todos os ausentes",
|
||||
"pinVersions": "Fixar versões @latest",
|
||||
"install": "Instalar",
|
||||
"uninstall": "Desinstalar",
|
||||
"refresh": "Atualizar",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "未安装"
|
||||
},
|
||||
"installAll": "安装全部缺失插件",
|
||||
"pinVersions": "固定 @latest 版本",
|
||||
"install": "安装",
|
||||
"uninstall": "卸载",
|
||||
"refresh": "刷新",
|
||||
|
||||
@@ -695,6 +695,7 @@
|
||||
"missing": "未安裝"
|
||||
},
|
||||
"installAll": "安裝全部缺失外掛",
|
||||
"pinVersions": "固定 @latest 版本",
|
||||
"install": "安裝",
|
||||
"uninstall": "解除安裝",
|
||||
"refresh": "重新整理",
|
||||
|
||||
Reference in New Issue
Block a user