Skip to content

feat: right-click working directory to open in IDE/Finder with configurable editor#279

Open
linjiejim wants to merge 1 commit intolukilabs:mainfrom
linjiejim:feat/open-directory-in-editor
Open

feat: right-click working directory to open in IDE/Finder with configurable editor#279
linjiejim wants to merge 1 commit intolukilabs:mainfrom
linjiejim:feat/open-directory-in-editor

Conversation

@linjiejim
Copy link
Copy Markdown

Summary

  • Right-click the working directory badge (below the input box) to show a context menu with Open in Editor and Show in Finder options
  • Add a Default Editor setting in Settings → App → Editor, supporting VS Code (default), Cursor, and Windsurf
  • The editor preference is persisted in ~/.craft-agent/config.json

Motivation

When working with a project directory, it's common to want to quickly open it in your preferred IDE or reveal it in Finder. Currently there's no way to do this directly from the working directory badge — users have to manually open their editor and navigate to the folder. This feature saves that friction.

Changes

Config storage layer

  • packages/shared/src/config/config-defaults-schema.ts — add defaultEditor: string to defaults type
  • apps/electron/resources/config-defaults.json — add "defaultEditor": "vscode" default
  • packages/shared/src/config/storage.ts — add defaultEditor to StoredConfig, add getDefaultEditor() / setDefaultEditor()

IPC channels

  • apps/electron/src/shared/types.ts — add OPEN_IN_EDITOR, EDITOR_GET_DEFAULT, EDITOR_SET_DEFAULT channels and ElectronAPI methods
  • apps/electron/src/preload/index.ts — add bridge methods

Main process

  • apps/electron/src/main/ipc.ts — add OPEN_IN_EDITOR handler (tries CLI first, macOS open -a fallback, 5s timeout), add editor settings handlers

Renderer

  • apps/electron/src/renderer/pages/settings/AppSettingsPage.tsx — add Editor section with SettingsMenuSelectRow
  • apps/electron/src/renderer/components/app-shell/input/FreeFormInput.tsx — wrap WorkingDirectoryBadge with Radix ContextMenu, add stopImmediatePropagation to prevent Electron dev menu override

Test plan

  • Set a working directory, right-click the badge → context menu appears with two options
  • Click "Open in Editor" → opens directory in configured IDE
  • Click "Show in Finder" → reveals directory in Finder
  • No working directory set → right-click does nothing
  • Settings → App → Editor → change editor, verify persistence after restart
  • Editor not installed → toast error shown

🤖 Generated with Claude Code

… in IDE/Finder

Add a configurable default editor setting (VS Code/Cursor/Windsurf) in
Settings → App → Editor, and a right-click context menu on the working
directory badge with "Open in Editor" and "Show in Finder" options.

The editor preference is persisted in ~/.craft-agent/config.json and
defaults to VS Code. The main process handler tries the editor CLI first,
then falls back to macOS `open -a` if the CLI is not in PATH.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linjiejim
Copy link
Copy Markdown
Author

linjiejim commented Feb 23, 2026

When using CraftAgents, I frequently need to open the editor to review real-time changes and confirm them. Therefore, I have added a feature to quickly open the editor, which I hope will be useful.

Right click actions for the opened directory
Screenshot 2026-02-23 at 22 01 48

Setting default IDE (vscode by default)
Screenshot 2026-02-23 at 22 02 01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant