Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions patches/@deepseek-ai+dsh-client-ui-workspace+0.1.0-rc.8.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
diff --git a/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js b/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js
index 7ca5fd3..4bba9a6 100644
--- a/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js
+++ b/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js
@@ -456,7 +456,14 @@ window.__ModuleLoader__.load({
const label = row.workspaceId === void 0 ? t("group.ungrouped") : row.label;
const active = group.expanded && group.containsCurrent;
const [menuOpen, setMenuOpen] = (0, react.useState)(false);
- const workspaceMenuItems = [{
+ const canOpenInFinder = typeof window !== "undefined" && typeof window.dshDesktop?.openInFinder === "function";
+ const workspaceMenuItems = [];
+ if (canOpenInFinder) workspaceMenuItems.push({
+ id: "openInFinder",
+ label: t("menu.openInFinder"),
+ icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconFolderOpen16, {})
+ });
+ workspaceMenuItems.push({
id: "rename",
label: t("rename"),
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, {})
@@ -465,7 +472,7 @@ window.__ModuleLoader__.load({
label: t("delete.workspace"),
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, {}),
danger: true
- }];
+ });
const ownRow = (0, react_jsx_runtime.jsxs)("div", {
className: clsx(Rows_module_css_default.projectRow, menuOpen && Rows_module_css_default.menuOpen),
role: "treeitem",
@@ -504,7 +511,14 @@ window.__ModuleLoader__.load({
items: workspaceMenuItems,
onSelect: (id) => {
setMenuOpen(false);
- /* v8 ignore next -- workspaceMenuItems carries exactly these two rows today. */
+ if (id === "openInFinder") {
+ if (row.cwd !== void 0 && typeof window.dshDesktop?.openInFinder === "function") {
+ window.dshDesktop.openInFinder(row.cwd).catch((reason) => {
+ console.warn("open in finder rejected:", reason);
+ });
+ }
+ return;
+ }
if (id !== "rename" && id !== "delete") return;
if (id === "rename") actions.rename();
else actions.delete();
@@ -2212,6 +2226,7 @@ window.__ModuleLoader__.load({
"search.noMatches": "无匹配会话",
"search.hasMore": "仅显示前 {n} 条结果,请缩小搜索范围。",
"menu.addWorkspace": "添加工作区…",
+ "menu.openInFinder": "在 Finder 中打开",
"picker.loading": "正在加载工作区…",
"conflict.named": "已存在名为“{name}”的工作区。",
"folderError.title": "无法打开文件夹",
@@ -2277,6 +2292,7 @@ window.__ModuleLoader__.load({
"search.noMatches": "No matching sessions",
"search.hasMore": "Showing the first {n} results. Narrow your search.",
"menu.addWorkspace": "Add workspace…",
+ "menu.openInFinder": "Open in Finder",
"picker.loading": "Loading workspaces…",
"conflict.named": "A workspace named “{name}” already exists.",
"folderError.title": "Couldn’t open folder",
9 changes: 9 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,15 @@ async function bootstrap(): Promise<void> {
ipcMain.handle('harness:show-log', () => {
shell.showItemInFolder(join(app.getPath('logs'), 'harness.log'))
})
ipcMain.handle('harness:open-in-finder', async (event, path?: unknown) => {
assertTrustedMainWindowEvent(event)
if (typeof path !== 'string' || path.length === 0) {
throw new Error('A directory path is required.')
}
const errorMessage = await shell.openPath(path)
if (errorMessage) throw new Error(errorMessage)
return { ok: true }
})
ipcMain.removeHandler('harness:open-recovery')
ipcMain.handle('harness:open-recovery', async (event, frontendErrorMessage?: unknown) => {
assertTrustedMainWindowEvent(event)
Expand Down
3 changes: 2 additions & 1 deletion src/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ window.addEventListener('unhandledrejection', (event) => {
contextBridge.exposeInMainWorld(
'dshDesktop',
Object.freeze({
restartHarness: (): Promise<{ ok: boolean }> => ipcRenderer.invoke('harness:restart')
restartHarness: (): Promise<{ ok: boolean }> => ipcRenderer.invoke('harness:restart'),
openInFinder: (path: string): Promise<{ ok: boolean }> => ipcRenderer.invoke('harness:open-in-finder', path)
})
)

Expand Down