Repository navigation
feat(desktop): 连接 SSH 主机后选择文件夹并打开远程工作区,状态栏显示连接并自动重连 (#2231) - #2267
Merged
Merged
Conversation
- 远程开发窗口新增“连接”:连接后浏览主机文件夹(主目录起步、上一级、~ 和 / 路径跳转、最近文件夹),“返回”结束会话 - “打开”在新标签页打开远程工作区:项目树经 Core 列出主机目录,标题为“文件夹 [SSH: 连接名]”,最近项目和编辑器会话不记录 - 本机根是用户缓存目录下只读锚点文件之下的占位路径(remoteplaceholder),没走 Core 的本机文件调用一律失败 - 状态栏连接项:心跳往返时间、两次无响应提示、第三次断开后 1/2/4/8/16 秒退避重连(最多 6 次),连接关闭立即重连,菜单可重新连接、断开并关闭 - 打开文件、终端、信任项目在远程工作区里拒绝并说明,不回退本机;本机监听不建立;树右键只留复制路径和刷新 - 关闭没有文档的远程工作区时跳过 Core 保存批次(纯计算命令不带远程适配,会被拒绝导致关不掉) - 退出时 remote.closeAll;日志不含主机、用户名、主机路径和主目录 - 补齐中英文案、功能矩阵 remote-workspace、ci-builds 中的占位锚点说明和无头截图测试
#2265 把远程开发窗口改为概览加编辑表单。只有已保存且未编辑的连接能连接,所以“连接”放在概览底部;连接进行中概览的主机信息显示“正在连接”,编辑按钮禁用,测试按钮换成停止。测试结果的文字改用与状态栏菜单共用的 remoteFailureText。i18n 词条按 id 三方合并,重新生成截图。
xiaoyumuxi
marked this pull request as ready for review
November 21, 2026 07:01
11 of 14 tasks
This was referenced Nov 21, 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
PR 类型 / Type
改动说明 / What changes
背景 / Why
#2256 让“远程开发”窗口能保存 SSH 连接、测试连接,#2258 把远端服务嵌进客户端。但用户还不能真正打开主机上的项目。本 PR 接上这一段:选中连接点“连接”,在窗口里浏览主机文件夹并打开;工作区在新标签页里打开,项目树列出主机目录,状态栏显示连接状况,断线后自动重连。
还没迁到主机的功能(编辑器、终端、Git、监听、语言服务器、运行配置、插件)在远程工作区里一律拒绝并说明原因。它们不回退到本机:本机只有一个永远打不开的占位目录。
改动 / Changes
Core 客户端(
desktop/internal/core,第一个提交)remote.connect/remote.disconnect/remote.closeAll/remote.readDir/remote.serverState/remote.hostRequest的客户端调用。remote.connect带着嵌入远端服务的清单,SSH 询问沿用 feat(desktop): 远程开发窗口保存 SSH 连接并测试连接,SSH 的询问在窗口中回答 (#2231) #2256 的 AskPass 提问队列。core.RemoteWorkspace绑定和core.WithRemoteWorkspace(ctx, binding):remoteWorkspace(会话、本机占位根、主机根)。remote.*命令自己指定会话,不带绑定。connection_closed失败,不发给 Core。lost回调)。占位目录(新包
desktop/internal/remoteplaceholder)<UserCacheDir>/Lithe/remote-workspaces之下。锚点是只读的普通文件,所以本机任何没走 Core 的文件调用都会以 ENOTDIR 失败,不会读写一个看起来像项目的本机文件夹。连接与文件夹选择(
remote.go、remote_view.go、新增remote_browse.go、remote_browse_view.go)remoteFailureText。docs/assets/remote-connections的截图随之重新生成。~或/开头的路径跳转;远程工作区(新增
remote_workspace.go、remote_status_view.go)workspace.listDirectories列出主机目录。remote.closeAll,结束所有剩下的会话(App.Run)。远程工作区里拒绝的本机功能
remote_workspace为原因记录拒绝,并通知“远程工作区暂不支持此功能,项目工具窗口可以浏览主机上的文件”:openFile);newTerminalWith);askToTrustProject)。shell_view.go的editorArea拆出emptyEditorHints),空白区只提示 Search Everywhere。project.everywhereActionsOnly)。这些页的结果在远程工作区里打不开,主机搜索放在第 3 步。Find in Files 打开的查找工具窗口显示同一说明。filetree_watch.go),搜索也不启动本机监听(search.go)。documents.go)。远程工作区打不开文件,没有要保存的内容;保存批次是没有远程适配的纯计算命令,带着绑定会被 Core 以not_supported拒绝,工作区就关不掉了(新测试发现的)。工作区里有文档时仍然走 Core,失败会明确报出来。日志
remote.connect、remote.connect.stop;remote.browse.enter/up/go/refresh/recent/back;remote.workspace.open/reconnect/disconnect;workspace.tree.refresh。remote_connect、remote_read_dir、remote_workspace_open、remote_reconnect;remote_heartbeat、remote_session_lost、remote_disconnect、remote_close_all、remote_remember_folder。remote_workspace为原因。文案、矩阵与文档
shared/i18n/features/remote-connections.json补齐中英词条,生成结果已提交。remote-workspace两端从“未实现”改为“部分实现 / 待验证”,写明验证动作;remote-connections的备注改为指向remote-workspace。docs/ci-builds.md:不在本 PR 范围内 / Out of scope
getHostPaths的桌面端处理(等 Core 【功能建议】目录树展开逻辑优化 #151 合入)。类型专属:feat
多平台对齐
platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/remote-workspace.json:两端partial/pending,证据为本 PR 的文件,验证动作逐项写明;remote-connections.json备注同步./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(validated 221 platform capabilities)和verify-platform-feature-matrix-change.sh origin/main HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空UI 验证 / UI evidence
TestVisualRemoteWorkspace(-tags vivahead,lithevisual,1200×760,浅色英文、深色中文)。场景为文件夹选择、打开后的工作区、状态栏菜单;主机由测试内核模拟,其余是生产页面。TestVisualRemoteConnections也已重新生成,概览底部能看到“连接”docs/assets/remote-workspace/和docs/assets/remote-connections/并嵌入下方截图说明和复验命令见
docs/assets/remote-workspace/README.md。统一日志系统 / Structured logging
performed/operationFailed/backgroundFailed日志接口,没有新增事件类型、print或直接写 stderrremoteLogError只保留错误码,不记录 OpenSSH 诊断原文;主机、用户名、主机路径和主目录都不进日志,测试逐条检查界面文案 / i18n
shared/i18n/features/remote-connections.json,中英齐全,生成结果已提交;代码通过i18n.Shared/i18n.SharedFormat读取node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check逻辑归属 / Logic placement
crates/remote、crates/workspace和分发器);桌面端只做呈现、计时和把请求绑定到会话性能与内存 / Performance and memory
设置 / Settings
N/A:没有新增或修改设置项(设置 › 工具 › 远程工作区另开 PR)。
插件契约 / Plugin contract
N/A:没有修改插件契约、能力版本或宿主方法。
发行包与资源 / Bundle and resources
docs/ci-builds.md都写明了生命周期与归属;已运行./scripts/desktop/verify/verify-runtime-bundle-immutability.sh(通过)docs/ci-builds.md已写明锚点不跨工作树复制无用代码与重构 / Dead code and refactoring
editorArea里的提示列表拆成emptyEditorHint类型和emptyEditorHints,供远程分支复用验证 / Verification
scripts/desktop/desktop-go.sh test ./internal/workbench ./internal/core ./internal/remoteplaceholder -run 'Remote|Trust|SafeMode|WindowTitle|ProjectMenu|StatusBar|EditorSession|Welcome|Placeholder|Everywhere|Standalone|EmptyEditor' -count=1scripts/desktop/desktop-go.sh test ./internal/workbench ./internal/core ./internal/remoteplaceholder -count=1everywhereActionsOnly不看远程工作区后运行TestRemoteWorkspaceRefusesWhatRunsLocallySearch Everywhere searches the remote workspace's files),恢复后通过TestVisualRemoteWorkspace、TestVisualRemoteConnections(-tags vivahead,lithevisual)gofmt -l desktop/internalnode scripts/i18n/generate-i18n.mjs --check、node scripts/i18n/verify-app-language-localization.mjsverify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main HEADscripts/desktop/verify/verify-runtime-bundle-immutability.sh未能执行的检查和原因:
提交前确认 / Final checks
main创建,feat(desktop): 远程开发窗口改为分组列表加概览,连接可设颜色和分组 (#2231) #2265 合入后已 merge main d384819(不改写已推送历史);目标分支mainbuild.example和/home/dev