Repository navigation
Conversation
…nPath
「打开当前工作位置」和创建卡片里的 workspace 路径都调用
services.workspaces.openPath(),而 Workspace 控制器的客户端服务从来没有
这个方法,调用同步抛出 TypeError;菜单在此之前已关闭,所以用户侧完全
静默,只在控制台留下一条异常。
改为走官方 Session Remote 的桌面交付面:
- canOpenHostPath() 探测 remote.session.canOpenWorkspacePath(),方法缺失、
抛错或 ok=false 一律按不可用处理;
- openHostPath() 调用 remote.session.openWorkspacePath({ path }),不传
reveal,因为对目录来说直接 open 才指向 managed root;
- 宿主没有桌面打开能力时两个入口都不再渲染(创建卡片降级为纯文本),
与官方 open-in-app 的 available 隐藏语义一致;
- 运行期失败复用 primitives 的 Toast 作为可见横幅,不再静默。
同时删掉 ClientWorkspaces.openPath 的错误假设,新增 ClientWorkspaceDesktop
声明 remote.session 上的这两个方法,并在 inject 里补入 remote 与
remote.session。
Closes wloops#14
wloops
added a commit
that referenced
this pull request
Nov 2, 2026
Integrate PR #15 directory opening fix with bounded capability recovery. Preserve Project Skills preflight diagnostics without unrelated retries, isolate derived Workspace CSS ownership, and clarify restart/version troubleshooting. Validation: build, typecheck, Workspace SHA gates and package checks passed; 45 test files passed, 634 tests passed and 1 skipped. Original issue #11 duplicate-provider trigger remains unconfirmed; no automatic issue closure. Co-authored-by: jssda <jssdjing@gmail.com>
Owner
|
感谢这份修复!方案已整合进master提交a2865d9,并在提交中保留Co-authored-by: jssda jssdjing@gmail.com。在原PR基础上补了能力查询失败的有限恢复(共享请求、最多三次含首次、卸载清理、不持续轮询),详见提交。维护者已反馈打开目录功能实测正常。 由于已直接整合而非GitHub merge,本PR按已整合关闭,避免重复合入。#14 已按源码修复关闭;尚未发布新的npm版本。感谢对真实Host API和失败交互的完整排查。 |
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.
Closes #14
问题
「打开当前工作位置」(会话头部「⋯」菜单)与创建卡片里可点击的 workspace 路径都调用
services.workspaces.openPath(...)。客户端workspaces服务只有一个提供者,方法清单里没有openPath(0.2.0-rc.2 与 0.2.1-rc.2 均如此),调用同步抛TypeError;setMenuOpen(false)排在它前面、.catch()也挂不上,所以用户侧完全静默,只在控制台留一条异常。改动
src/client/actions.tsClientWorkspaces.openPath的错误声明;新增ClientWorkspaceDesktop描述remote.session;新增canOpenHostPath()/openHostPath()src/client/workspace-desktop.tsx(新增)WeakMap缓存 + boot 预热)、useHostDesktopAvailable()、useOpenFailureToast()src/client/target-console/TargetStatusAction.tsxreveal()改走openHostPath();菜单项增加desktopAvailable === true条件src/client/WorktreeCreateRow.tsxdsh-wt-path的按钮语义src/client/index.tsxinject补入remote、remote.session;boot 时预热能力读取src/client/harness-platform.d.tsToast的运行时模块声明src/i18n/client-messages.tsopen.workspace.path.failed/open.workspace.path.unavailable(zh/en)tests/*行为
DISPLAY/WAYLAND_DISPLAY)openWorkspacePath打开 managed root选择隐藏而不是置灰,是照官方
dsh-client-ui-open-in-app的做法:它用remote.session.canOpenWorkspacePath()取可用性,组件里if (!props.available) return null,README 也写明「主机没有这项能力时,这些控件一个都不渲染」。不传
action: 'reveal':对目录来说直接 open 才指向 managed root,reveal会打开父目录。验证
pnpm typecheck✅pnpm build✅(client bundle 1073 kB)pnpm run check:publish:release✅ 全部通过pnpm test✅ 43 文件、618 passed / 1 skipped(改动前基线 607 passed)备注
inject增加remote+remote.session,与官方 open-in-app 的注入列表一致;这使插件在客户端硬依赖 Session Remote 面。