Repository navigation
fix(client): keep the host workspace explorer for local sessions - #176
Merged
Merged
Conversation
routeWorkspaceFiles() sent every session that resolves to a local workspace to this plugin's explorer as well, not just mirror-backed ones. Only a mirror path needs that explorer; for a plain local project it is a straight loss: same rows, but the host's file actions (reveal in file manager, open with, upload, new folder/file, archive download) are gone from the context menu. A plugin explorer is only a benefit where the host cannot address the path at all. Keep the host pane for local projects and leave the mirror routing untouched. test/client-lifecycle.test.js asserted the old local behaviour; it now asserts that the local case keeps kind "files" and its own session.
Owner
|
验证通过:CI 与 Agent native/PTC(0.2.0/0.2.1/0.2.2)、macOS、Windows 全绿。 额外做了负对照:把 方向也认同:本地项目用宿主自己的资源管理器,才能保留 reveal/open-with/upload/create/archive 这些本插件没实现的动作;镜像会话仍走共享 explorer。这同时部分回应了 #172(本地项目不再被插件的文件样式接管)。 感谢 @wsmrock 定位到 |
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.
这是什么
纯本地会话的「工作区文件」面板被本插件接管了:
routeWorkspaceFiles()用remote || localWorkspaceSession(sessionId)决定是否改道到NATIVE_EXPLORER,于是本地项目看到的是插件 explorer。插件菜单只有「展开/收起、打开文件、下载到本地镜像、复制相对/绝对地址、重命名、删除」,宿主面板原本的「在文件管理器中显示、在应用中打开、上传到此处、新建文件夹/文件、压缩并下载」全没了。本 PR 把条件收成
remote:镜像(远程)会话仍走插件 explorer,纯本地项目回到宿主面板。没有关联 issue:仓库里没搜到同题报告,也没有另开(若需要我先补一个 issue 再挂
Fixes #,说一声)。自检清单
npm test全绿(含改写后的回归测试,见下)node check.mjs通过git diff --check干净,两个文件均为 LF)package.json仍为 1.2.1)验证
test/client-lifecycle.test.js+test/local-workspace-client.test.js+test/native-explorer-autoopen.test.js→ 37 pass。npm test(改动基于当前maina012941验证):1539 tests / 1516 pass / 23 skipped / 0 fail;node check.mjs→check.mjs OK: no framework-constraint violations.lib/client.js那一行改回旧写法,test/client-lifecycle.test.js立即红 ——AssertionError [ERR_ASSERTION]: a local project keeps the host explorer, so its context menu keeps reveal/upload/create;改回新写法 22/22 绿。files面板的路由与一条断言,未触碰 Agent 循环、原生工具、PTC 或会话协议;上述均为脚本模型 + 测试夹具与真机手测,无真实模型结果需要区分,CI 里的 agent 验收矩阵(native/PTC × 0.2.0/0.2.1/0.2.2)只作回归跑,本 PR 全绿。dsh-client-ui-file-actions调ctx.remote.session.openWorkspacePath({ path, action: 'reveal' })(宿主侧dsh-host-open-in-app/dsh-native-command的revealNativePath),所以只要files面板还是宿主那个,菜单项自然回来;NATIVE_EXPLORER = 'dsh-remote/explorer'见lib/client.js:6060。备注
385fa95(上一发布提交)而不是a012941,因为我的 token 没有workflowscope,推同时带上游.github/workflows/*提交的分支会被 GitHub 拒。同一 hunk 在该基点test/client-lifecycle.test.js22/22 通过,与当前main仍 MERGEABLE / CLEAN;需要 rebase 到a012941的话我可以另推。dsh-remote/explorer仍注册、仍渲染);新开的files面板才走宿主面板。如果你更想保留统一 explorer、改为往插件菜单补宿主那几项动作,我可以按那个方向重做本 PR。