fix(settings): surface "installed but not runnable" state in tool cards

After an install/update command succeeds, re-probe the tool version: if it
still can't be detected the tool is installed-but-unrunnable (e.g. Node too
old), so report a warning toast and show "installed · can't run" with the
cause, instead of a misleading "success" plus a stale version number.

Read the backend `installed_but_broken` flag rather than matching error
text; the card's current-version line, action button (no useless "install"
for a broken tool), and a "check environment" hint all key off it. Drop the
now-redundant version-clearing setState (the refresh merge already nulls it),
flatten the action ternary, and use extractErrorMessage in the catch path.

Adds toolNotRunnable / toolActionInstalledNotRunnable / installedNotRunnable
/ toolCheckEnv i18n keys (zh/en/ja).
This commit is contained in:
Jason
2026-05-22 16:19:43 +08:00
parent 768c5f9f39
commit ea604a1827
5 changed files with 74 additions and 16 deletions
+4
View File
@@ -672,6 +672,10 @@
"toolActionDone": "{{action}} completed for {{count}} tool(s)",
"toolActionPartial": "{{action}} succeeded for {{succeeded}}, failed for {{failed}}",
"toolActionFailed": "Install/update command failed",
"toolNotRunnable": "Installed but not runnable (no version detected)",
"toolActionInstalledNotRunnable": "Installed, but it can't run in the current environment — please check",
"installedNotRunnable": "Installed · can't run",
"toolCheckEnv": "Check environment",
"envBadge": {
"wsl": "WSL",
"windows": "Win",
+4
View File
@@ -672,6 +672,10 @@
"toolActionDone": "{{count}} 個のツールの{{action}}が完了しました",
"toolActionPartial": "{{succeeded}} 個成功、{{failed}} 個失敗({{action}}",
"toolActionFailed": "インストール/更新コマンドの実行に失敗しました",
"toolNotRunnable": "インストール済みですが実行できません(バージョン未検出)",
"toolActionInstalledNotRunnable": "インストールされましたが、現在の環境では実行できません。確認してください",
"installedNotRunnable": "インストール済み・実行不可",
"toolCheckEnv": "実行環境を確認",
"envBadge": {
"wsl": "WSL",
"windows": "Win",
+4
View File
@@ -672,6 +672,10 @@
"toolActionDone": "{{count}} 个工具{{action}}完成",
"toolActionPartial": "{{succeeded}} 个{{action}}成功,{{failed}} 个失败",
"toolActionFailed": "安装/升级命令执行失败",
"toolNotRunnable": "已安装但无法运行(未探测到版本)",
"toolActionInstalledNotRunnable": "已安装,但当前环境无法运行,请检查",
"installedNotRunnable": "已安装·无法运行",
"toolCheckEnv": "请检查运行环境",
"envBadge": {
"wsl": "WSL",
"windows": "Win",