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
+1
View File
@@ -185,6 +185,7 @@ export const settingsApi = {
version: string | null;
latest_version: string | null;
error: string | null;
installed_but_broken: boolean;
env_type: "windows" | "wsl" | "macos" | "linux" | "unknown";
wsl_distro: string | null;
}>