Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Feature]: Dedicated "Projects Directory" setting for the Create-project default Location (decoupled from Workspace Directory) #20475

Description

@alienmonk09

Problem or use case

"Create new project" defaults its Location to ~/orca/projects. Since #14776 (fixes #14767) the default follows Settings → Workspace Directory instead, but only once that setting has been changed from its seeded ~/orca/workspaces value.

That couples two directories that many users deliberately keep apart:

  • Workspace Directory is where Orca creates worktrees (nestWorkspaces puts them under <workspaceDir>/<repo>/<branch>).
  • The folder where I keep projects (~/dev/<project>/... in my case).

Pointing Workspace Directory at ~/dev to fix the Create-project default would move every new worktree into ~/dev/<repo>/<branch>, right next to my project folders. So today the only options are: retype the Location on every new project, or a symlink/junction hack (~/orca/projects → ~/dev), which then makes Orca record paths under ~/orca/projects/... that differ from the real path every other tool sees.

The resolver's own comment acknowledges the tension:

Treating that seeded value as a choice would silently relocate every existing user's projects into the worktree root, where each project would then host its own worktrees inside its working tree.

(src/main/ipc/repos/repo-creation-handlers.ts, getDefaultCreateProjectParent)

Proposed solution

Add a dedicated, optional Projects Directory setting (client default, local host):

  • New GlobalSettings.projectsDir?: string, unset by default.
  • getDefaultCreateProjectParent resolution order becomes:
    1. projectsDir when non-blank;
    2. otherwise the existing behaviour (configured Workspace Directory, else ~/orca/projects).
  • Settings → General → a "Projects Directory" field right below Workspace Directory, with Browse, placeholder showing the effective fallback, and a short description ("Default parent folder for Create new project. Leave empty to use Workspace Directory / ~/orca/projects").

No behaviour change for anyone who leaves the field empty. Remote/SSH/runtime hosts keep resolving ~/orca/projects from the host home as they do now (a per-host override can follow later if there is demand; keeping HostSettingOverrides narrow as its docblock asks).

I have the change ready and will open a PR referencing this issue.

Alternatives or additional context

Orca 1.4.200, macOS (arm64).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions