Repository navigation
feat(desktop): 远程开发窗口列出本机 WSL 发行版并作为远程工作区打开 (#2231) - #2288
Merged
Merged
Conversation
- 已保存的连接之后以 WSL 分组列出 Core remote.listWslDistributions 返回的发行版,每次打开窗口读取一次;搜索时不列出,分组可折叠;没有 WSL 时不显示 - 发行版页显示 wsl:[用户@]发行版、经本机 wsl.exe 打开的说明和可选的 Linux 用户,打开文件夹/连接走 remote.connect 的 wsl 参数 - 步骤跳过读取配置和身份验证,连接一步改名为启动发行版;失败用 WSL 自己的说明,不显示 SSH 提示和编辑连接;Core 拒绝的用户/发行版字段就地说明 - remoteHost 在 SSH 连接与 WSL 发行版之间二选一,步骤、文件夹选择、信任、工作区和重连共用同一流程;窗口标题和状态栏的 SSH/WSL 由同一参数给出 - 发行版不写入已保存的连接,文件夹不记入最近文件夹;日志不含发行版名、用户名或主机路径 - 固定 Core 5c163e9(Lithe-core-rust#157 WSL 连接) - 截图、功能矩阵和 i18n 词条同步
xiaoyumuxi
marked this pull request as ready for review
November 21, 2026 15:47
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
remote.listWslDistributions,已合入 5c163e9)PR 类型 / Type
改动说明 / What changes
背景 / Why
#2231 要求远程工作区兼容 WSL。原来的远程开发窗口只能连已保存的 SSH 主机,Windows 用户想在本机的 WSL 发行版里开文件夹,只能自己在发行版里跑 sshd 再按 SSH 主机连。Core #157 已经能经
wsl.exe --distribution … --exec启动同一个远端服务,这个 PR 在桌面端接上它:窗口直接列出本机的发行版,选中后就能打开里面的文件夹,后面的流程和 SSH 一样(选文件夹、信任、工作区、心跳与重连)。改动 / Changes
列表与发行版页(
remote_wsl.go、remote_list.go、remote_view.go、remote_shell_view.go)remote.listWslDistributions,超时 20 秒;Core 自己给 wsl.exe 留了 15 秒,因为开机后第一次启动 WSL 服务可能要这么久。wsl:[用户@]发行版地址,并说明经本机 wsl.exe 打开、不保存任何信息;连接(
remote.go、remote_steps.go、remote_detail_view.go、remote_browse*.go、remote_trust.go、remote_workspace.go)remoteHost,二选一地装 SSH 连接或 WSL 发行版:request()拼出remote.connect的参数:WSL 时只带wsl,不带connection;remoteHost,不再直接用core.SSHConnection。invalid_request的field/reason),在发行版页上就地说明。标题与状态栏(
window_title.go、remote_status_view.go)desktop.remote.kind.ssh),显示效果不变。Core 客户端(
internal/core/remote_session.go、remote_helpers.go)RemoteConnectRequest新增WSL *WSLConnection;新增WSLConnection.Identity(),与 Core 给出的会话身份wsl:[用户@]发行版一致。RemoteListWSLDistributions和RemoteWSLDistributions{Available, Distributions, Diagnostics}。固定 Core 修订(
scripts/desktop/build-desktop-core.sh)PINNED_CORE_REVISION升到 5c163e9,即包含 Core fix(windows): 修复 Git 记录鼠标滚轮偶发无法滚动 #157 的 main。日志
remote.wsl.select动作,复用现有的performed。remote_wsl_list,复用现有的backgroundFailed,错误只带命令和错误码(remoteLogError)。文案、截图与矩阵
shared/i18n/features/remote-connections.json补齐 WSL 相关的中英词条,包括标题、说明、用户栏、失败说明、字段拒绝、“启动发行版”和 SSH/WSL 种类名,并已重新生成。docs/assets/remote-connections/新增两个场景的截图:WSL 发行版页和 WSL 连接失败,各有浅色英文和深色中文两版;README 补了这两个场景的说明和表格行。remote-workspace.json补了 WSL 的能力描述、证据、验证动作和说明。测试
remote_wsl_test.go里有 3 个测试:internal/core新增两个测试:TestRemoteConnectSendsWSLAloneAndCoreRefusesItByField和TestRemoteListWSLDistributionsIsUnavailableOutsideWindows。remoteHost。不在本 PR 范围内 / Out of scope
--exec的标准输入输出能不能原样透传二进制;--user时会怎样。类型专属:feat
多平台对齐
platform-specific),理由:WSL 只存在于 Windows。代码是两端共用的 Viva 桌面代码,macOS 上 Core 返回不可用,窗口不显示 WSL 分组。所属的remote-workspace条目两端共用,不单独标platform-specific;矩阵里已写明 WSL 只在 Windows 显示。范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/remote-workspace.json:补了 WSL 的能力描述、证据(两端都有remote_wsl.go,macOS 还有remote_wsl_test.go)、验证动作和说明;Windows 真机验收写明待完成,验证状态没有提前改成通过./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(validated 221 platform capabilities)和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD(passed).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空remoteHostKernel、remoteHostWSL),不涉及任何插件shared/i18n/;没有写插件的构建步骤或资源路径UI 验证 / UI evidence
LITHE_VISUAL_OUTPUT_DIR=… scripts/desktop/desktop-go.sh test -tags 'vivahead lithevisual' ./internal/workbench/ -run 'TestVisualRemoteConnections$' -count=1,提交 0238651。新增两个场景:wsl(Ubuntu-24.04,用户 dev)和wsl-failed(Debian 没能启动,日志面板展开)。每个场景都有浅色英文和深色中文两版,尺寸与已有的远程开发窗口截图相同。WSL 发行版页(填写 Linux 用户)
连接 WSL 发行版失败(步骤从“启动发行版”开始,没有 SSH 提示和“编辑连接”)
统一日志系统 / Structured logging
performed(remote.wsl.select),列表读取失败走现有的backgroundFailed(remote_wsl_list);没有print或直接写 stderrTestRemoteWSLOpensAFolderInADistribution断言日志里没有这些内容界面文案 / i18n
shared/i18n/features/remote-connections.json补了中英词条,运行了node scripts/i18n/generate-i18n.mjs并提交了生成结果node scripts/i18n/verify-app-language-localization.mjs(passed)和node scripts/i18n/generate-i18n.mjs --check(en-US、zh-CN 都是 12330/12330)逻辑归属 / Logic placement
crates/remote);桌面端只负责调用、呈现,以及把 Core 拒绝的字段对应到文案性能与内存 / Performance and memory
设置 / Settings
N/A:没有新增或修改设置项;Linux 用户栏只对这一次连接生效,不保存。
插件契约 / Plugin contract
N/A:只依赖 Core 的远程连接 API(
remote.connect、remote.listWslDistributions),不涉及插件契约、能力版本或宿主方法。PINNED_CORE_REVISION已升到 5c163e9。发行包与资源 / Bundle and resources
./scripts/desktop/verify/verify-runtime-bundle-immutability.sh(passed)无用代码与重构 / Dead code and refactoring
core.SSHConnection的地方都已改用remoteHost验证 / Verification
scripts/desktop/desktop-go.sh test ./internal/core/... ./internal/remoteconn/... ./internal/workbench/... -count=1scripts/desktop/desktop-go.sh vet ./internal/workbench/ ./internal/core/ ./internal/remoteconn/,以及带-tags 'vivahead lithevisual'的 workbenchgofmt -l desktop/internal/{workbench,core,remoteconn}TestVisualRemoteConnections(vivahead lithevisual)node scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --check./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main HEAD./scripts/desktop/verify/verify-runtime-bundle-immutability.shrg未能执行的检查和原因: 还没在 Windows 上实际运行。WSL 只在 Windows 上有,本机测试用的是 Core 替身,所以真实的 wsl.exe 列表、连接、失败输出和结束进程的行为都没有验证。要在 Windows 虚拟机上确认“不在本 PR 范围内”列出的四点,并做原生窗口验收。
提交前确认 / Final checks
main(f025a72be)创建,目标分支main