fix: keep custom tool environments selectable

The custom Node.js and Python choices could appear unavailable until a candidate was already discovered, and selecting the source implicitly adopted the first candidate. The chooser now stays operable, waits for an explicit validated path, keeps cancellation quiet, and shows validation errors beside the affected runtime.

Candidate discovery now prioritizes active virtual environments and Conda before bounded user/system PATH and common Node/Python locations, while preserving canonical validation and deduplication.

Release note: 修复自定义 Node.js/Python 环境入口不可用的问题,并增加对 PATH、venv、Conda 和常见安装位置的解释器检测。
This commit is contained in:
mesalogo
2026-09-02 16:29:55 +08:00
parent be39665ca9
commit 4d9ab72778
12 changed files with 530 additions and 129 deletions
@@ -131,8 +131,12 @@
验收:
- “自定义环境”入口始终可操作,不因尚无候选而禁用
- 点击“自定义环境”只展开选择流程,不自动采用第一个候选
- 候选覆盖启动时继承的用户/系统 PATH、当前虚拟环境、Conda 环境和常见安装位置
- 候选经过真实版本和架构诊断
- 相同真实路径不重复显示
- 用户必须明确选择一个候选后才保存并切换来源
- 保存后状态显示实际生效来源
- PATH 后续变化不会自动替换选择
@@ -143,7 +147,10 @@
验收:
- 文件选择由 Main 管理
- 没有候选时仍可从“自定义环境”流程直接打开文件选择器
- 取消文件选择不报错、不保存,也不改变当前来源
- 保存前验证 Python 3、版本和架构
- 验证失败在 Python 卡片的路径操作附近显示,并保留原设置
- GoodBuddy 不安装、升级或删除该环境
- 路径失效时不静默回退