Skip to content

New-worktree base-branch selector is empty for multi-repo projects (reads the anchor, not the repo roots) #113

Description

The "From <branch>" selector in the new-worktree flow is empty for a .code-workspace project, so no base branch can be chosen.

BranchToolbarBranchSelector.tsx:139-140 sets branchCwd = activeWorktreePath ?? activeProject.workspaceRoot. For a workspace-file project workspaceRoot is the anchor — the directory holding the .code-workspace — which is usually not a git repo, so listBranches returns isRepo: false and the list is empty. (Same root cause shape as #112: a call site still reading workspaceRoot where multi-repo needs repoRoots.)

Beyond the empty list, there's a design question: one selector can't really serve N repos. My three roots have three different defaults — master, dev, and main — and the branch I actually want to base on exists in two of the three. A per-root base selection (defaulting each root to its own origin/HEAD) seems like what's needed, though I appreciate that's a bigger UX change than a one-line cwd fix.

WorktreeFanoutTarget already carries baseRef per target, so the fan-out layer looks like it supports this already — it's the UI that collapses it to a single value.

Version: multi-repo-workspaces @ 92de5d9a, macOS arm64, dev build.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions