feat(files): add Show in Finder to file tree context menu#2869
Conversation
Adds a platform-aware "Show in Finder" / "Show in File Explorer" / "Show in File Manager" item to the Files tab right-click menu. The renderer resolves the absolute path through the workspace-scoped getAbsolutePath RPC, then a new app.showItemInFolder RPC calls Electron's shell.showItemInFolder behind the same home-jail path validation as openPath. Hidden for SSH workspaces since the file does not exist on the local disk. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Greptile SummaryThis PR adds a file-manager reveal action to the file tree context menu. The main changes are:
Confidence Score: 4/5The new reveal flow needs a validation fix before merging.
apps/emdash-desktop/src/main/core/app/service.ts
|
| Filename | Overview |
|---|---|
| apps/emdash-desktop/src/main/core/app/controller.ts | Adds a new showItemInFolder RPC handler with the same result shape as nearby app handlers. |
| apps/emdash-desktop/src/main/core/app/service.ts | Adds the Electron shell reveal call, but applies home-scoped validation to a workspace-scoped UI flow. |
| apps/emdash-desktop/src/main/core/app/service.test.ts | Adds service tests for revealing a home path and rejecting a path outside home. |
| apps/emdash-desktop/src/renderer/features/tasks/editor/editor-file-tree.tsx | Adds the context-menu item, platform label, SSH guard, and async reveal flow. |
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
apps/emdash-desktop/src/main/core/app/service.ts:227-228
**Workspace Paths Outside Home Fail**
When a local workspace lives outside the user's home directory, `workspace.files.getAbsolutePath` can resolve a valid workspace file, but this new service path rejects it with `Path must be inside the user home directory`. The context-menu action then shows a failure toast instead of revealing a valid local file.
### Issue 2 of 2
apps/emdash-desktop/src/main/core/app/service.ts:227-228
**Reveal Scope Is Home-Wide**
This RPC accepts any renderer-supplied path and only checks that the real path is under the user's home directory. If renderer code calls `rpc.app.showItemInFolder` directly with a home path unrelated to the current workspace, Electron will reveal it, so the new shell capability is broader than the workspace-scoped file-tree action that reaches it.
Reviews (1): Last reviewed commit: "feat(files): add Show in Finder to file ..." | Re-trigger Greptile
| const realPath = await resolveHomeJailedPath(rawPath); | ||
| shell.showItemInFolder(realPath); |
There was a problem hiding this comment.
Workspace Paths Outside Home Fail
When a local workspace lives outside the user's home directory, workspace.files.getAbsolutePath can resolve a valid workspace file, but this new service path rejects it with Path must be inside the user home directory. The context-menu action then shows a failure toast instead of revealing a valid local file.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/emdash-desktop/src/main/core/app/service.ts
Line: 227-228
Comment:
**Workspace Paths Outside Home Fail**
When a local workspace lives outside the user's home directory, `workspace.files.getAbsolutePath` can resolve a valid workspace file, but this new service path rejects it with `Path must be inside the user home directory`. The context-menu action then shows a failure toast instead of revealing a valid local file.
**Context Used:** AGENTS.md ([source](https://app.greptile.com/emdash/github/generalaction/emdash/-/custom-context?memory=c9624c9f-4bb0-42b3-aa19-4ea456b59255))
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
This was a deliberate consistency choice rather than an oversight: showItemInFolder reuses the exact home-jail policy that openPath already applies (terminal file links have the same limitation today), so this PR doesn't introduce a new restriction, it inherits an existing one.
| const realPath = await resolveHomeJailedPath(rawPath); | ||
| shell.showItemInFolder(realPath); |
There was a problem hiding this comment.
This RPC accepts any renderer-supplied path and only checks that the real path is under the user's home directory. If renderer code calls rpc.app.showItemInFolder directly with a home path unrelated to the current workspace, Electron will reveal it, so the new shell capability is broader than the workspace-scoped file-tree action that reaches it.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/emdash-desktop/src/main/core/app/service.ts
Line: 227-228
Comment:
**Reveal Scope Is Home-Wide**
This RPC accepts any renderer-supplied path and only checks that the real path is under the user's home directory. If renderer code calls `rpc.app.showItemInFolder` directly with a home path unrelated to the current workspace, Electron will reveal it, so the new shell capability is broader than the workspace-scoped file-tree action that reaches it.
**Context Used:** AGENTS.md ([source](https://app.greptile.com/emdash/github/generalaction/emdash/-/custom-context?memory=c9624c9f-4bb0-42b3-aa19-4ea456b59255))
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
This doesn't widen the renderer's existing capability surface: rpc.app.openPath already accepts any home-jailed path and opens the file with its default handler, which is strictly more powerful than revealing it in Finder, and readUserFile can already read any file under home. showItemInFolder follows the same established policy and is the least powerful of the three.
There was a problem hiding this comment.
That's a fair and correct point. openPath is indeed strictly more powerful — it can trigger execution via the OS default handler — and readUserFile can exfiltrate content. showItemInFolder is read-only metadata exposure at most, and the home-jail policy is consistently applied across all three. The new RPC doesn't expand the attack surface beyond what's already present.
I'll withdraw the concern.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

Description
Adds a platform-aware "Show in Finder" / "Show in File Explorer" / "Show in File Manager" item to the Files tab right-click menu. The renderer resolves the absolute path through the workspace-scoped getAbsolutePath RPC, then a new app.showItemInFolder RPC calls Electron's shell.showItemInFolder behind the same home-jail path validation as openPath. Hidden for SSH workspaces since the file does not exist on the local disk.
This feature is a nice have. I'm often creating report files in md formats and this change allows me to quickly show them in finder allowing for copying, sending them to someone etc.
Related issues
No issue related
Testing
vitest run src/main/core/app/service.test.ts— 6 tests passed, including the 2 newshowItemInFolderones@emdash/emdash-desktoptest target (node, main-db, migrations, browser, scripts projects) — 315/315 test files passedpnpm run test— all packages green except 5 pre-existing failures that also exist onmainand are unrelated to this change (@emdash/runtimesession-manager ×2,@emdash/uiserialize ×1,@emdash/pluginsClaude ACP ×2)pnpm run typecheck— 9 projectspnpm run lint— 9 projectspnpm run format— 9 projectsScreenshot/Recording (if applicable)
Checklist
messages and, when possible, the PR title