Repository navigation
feat(desktop): 远程工作区按 Zed 方式打开主机上的文件,工作区外只读 (#2231) - #2292
Merged
Merged
Conversation
- 状态栏连接菜单新增“打开主机上的文件…”:顶部路径框默认 ~/,经 remote.readDir 逐层列出、按名称开头筛选、文件夹在前、“.” 开头才列隐藏条目;上下键、Tab 补全、 回车进入文件夹或打开文件,Esc 关闭 - 工作区文件夹里的文件照常可编辑;文件夹外的文件用 Core 的占位路径 (.lithe-remote-host)只读打开(S25),不能切换为可编辑,保存/新建被拒绝 - 状态栏导航路径显示 ~ 开头的主机路径,复制路径菜单不给相对路径 - 远程工作区不再显示必然失败的“在文件浏览器中显示”(标签页、Search Everywhere、Git 变更) - remoteplaceholder.Outside、TestRemoteOpenFileOnHost、无头截图、功能矩阵、Agent Note
Resolve the feature matrix.
xiaoyumuxi
marked this pull request as ready for review
November 22, 2026 01:15
…ide-files # Conflicts: # shared/platform-feature-matrix/features/remote-workspace.json
1 task done
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
#2231 的 R0 要求远程工作区能打开工作区文件夹以外的主机文件,例如
~/.bashrc、/etc/hosts;用户定为“对标 Zed”。在这之前没有任何入口能打开这类文件:项目树只列工作区文件夹,Search Everywhere 只搜工作区,编辑器遇到文件夹外的路径直接拒绝。设计 S25 规定,信任边界只覆盖打开的文件夹,文件夹以外的主机文件只读。改动 / Changes
打开主机上的文件(新增
workbench/remote_host_files.go、remote_host_files_view.go)~/。remote.readDir列出路径最后一个“/”之前的那一层,按其后的文字筛选:/或~/开头时,就地说明要输入什么。名称里含“\”的路径在 Windows 上无法作为本机键,会说明原因。工作区外的文件只读(
workbench/documents.go、remote_documents.go、status_items.go)remoteplaceholder.LocalPath):.lithe-remote-host/<主机路径>下,和 Git 返回的工作区外路径用同一个键。remoteplaceholder.Outside,判断一个本机键是否代表工作区以外的主机文件。hostOutside标记。这类文档打开时就是只读:toggle_read_only/remote_outside_folder;remoteDocuments.save、create返回新的errRemoteReadOnly,不发任何写请求,保存失败的提示说明“该文件在工作区文件夹以外,只能以只读方式打开”。状态栏导航路径(
workbench/status_path.go)~开头的主机路径(如~/notes.txt),不暴露本机占位目录。右键菜单(
workbench/tab_menu.go、search_everywhere_view.go、gitreview_actions.go)文案、截图、矩阵与 Note
shared/i18n/features/remote-connections.json新增 9 个中英词条,已重新生成。docs/assets/remote-workspace/:remote-workspace.json:implemented/feature/2026-11-22-remote-host-files-outside-workspace.md,记录以下几项和被否的方案:/前缀已被“操作”页签占用;测试
workbench/remote_host_files_test.go的TestRemoteOpenFileOnHost,从菜单打开,覆盖:~/notes.txt;remoteplaceholder的TestHostAndLocalPathsMapBothWays补了Outside的断言。TestVisualRemoteWorkspace新增host-file、host-file-readonly两个场景。不在本 PR 范围内 / Out of scope
类型专属:feat
多平台对齐
范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/remote-workspace.json,改了能力描述、两端证据和验证动作。原生窗口验收没做,验证状态保持pending。./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(221 项通过)和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD(通过).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空shared/i18n/;没有写插件的构建步骤或资源路径UI 验证 / UI evidence
LITHE_VISUAL_OUTPUT_DIR=<仓库>/docs/assets/remote-workspace ../scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/workbench -run '^TestVisualRemoteWorkspace$' -count=1/home/dev。状态栏连接菜单(新增“打开主机上的文件…”)
按路径打开主机上的文件(默认
~/,文件夹在前,隐藏条目不列,无法读取的条目说明数量)工作区以外的
~/notes.txt只读打开(状态栏是锁,导航路径是主机路径)统一日志系统 / Structured logging
operationRejected(remote_open_host_file的path_not_absolute/path_unrepresentable,toggle_read_only的remote_outside_folder);operationFailed("remote_read_dir", …);performed。print,也没有直接写 stderr。loggedAny检查。界面文案 / i18n
shared/i18n/features/remote-connections.json新增 9 个中英词条,运行了node scripts/i18n/generate-i18n.mjs并提交了生成结果node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,都通过逻辑归属 / Logic placement
remoteplaceholder是它的镜像(已有测试对照);目录列出走 Core 的remote.readDir,写入的版本检查在主机。桌面端只做三件事:性能与内存 / Performance and memory
设置 / Settings
N/A:没有新增或修改设置项。
插件契约 / Plugin contract
N/A:不涉及插件契约,也没有新增或修改宿主方法、宿主通知。
发行包与资源 / Bundle and resources
os.Lstat失败)。已运行scripts/desktop/verify/verify-runtime-bundle-immutability.sh,通过无用代码与重构 / Dead code and refactoring
remoteHostPathBelow已删除验证 / Verification
scripts/desktop/desktop-go.sh test ./internal/... -count=1scripts/desktop/desktop-go.sh test ./internal/workbench -run '^TestRemoteOpenFileOnHost$'scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/workbench -run '^TestVisualRemoteWorkspace$'go vet、gofmt -lnode scripts/i18n/generate-i18n.mjs --check、node scripts/i18n/verify-app-language-localization.mjs./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main HEAD./scripts/agent-notes/verify-agent-notes.shscripts/desktop/verify/verify-runtime-bundle-immutability.sh未能执行的检查和原因:
提交前确认 / Final checks
main(994b67331)创建,目标分支main