feat(desktop): hook up Open in Finder for v2 sidebar projects

Merged
SA
3mo ago
+20-2

Summary

  • Replace the "Open in Finder is coming soon" stub in the v2 dashboard sidebar's project context menu with a working implementation, matching what workspaces already do.

How It Works

The project-section actions hook already queries useHostProjects() (for the rename flow), and those rows carry each project's repoPath, with the local host's replica winning that field in the merge. The handler looks up the project's row and only proceeds when the local machine is among the hosts serving it — guaranteeing repoPath is a path on this machine — then calls the existing external.openInFinder electron tRPC procedure (shell.showItemInFolder), same as the v2 workspace context menu. Remote-only projects get a "Project folder is not on this machine" error toast.

Like workspaces and the v1 project header, this reveals the project folder highlighted inside its parent directory rather than opening the folder itself.

Testing

  • bun run typecheck
  • bun run lint
  • Manual: not exercised in the running app — the wiring mirrors the adjacent workspace-item handler verbatim. Worth a quick click-through: right-click a local project → Open in Finder reveals the repo folder; a remote-only project shows the error toast.

https://claude.ai/code/session_013TPMhwhzMEe5RLShvs7Y5w


Open in Stage

Summary by cubic

Enables Open in Finder in the v2 dashboard sidebar project menu, matching workspace behavior. Opens the local project folder and shows a clear error for remote-only projects.

  • New Features
    • Uses useHostProjects() to resolve a local repoPath and only proceeds if the current machine serves the project, then calls electronTrpcClient.external.openInFinder.
    • Shows toast errors when the project folder isn’t on this machine or if the open action fails.

Summary by CodeRabbit

  • New Features

    • Added the ability to open locally hosted project repositories directly in Finder.
  • Bug Fixes

    • Replaced the “coming soon” notification with actionable error messages when a project path is unavailable or the operation fails.
    • Prevented Finder access for projects that aren’t hosted locally.