You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Add trunk branch selector for workspace creation
Adds ability to select a trunk/base branch when creating a new workspace.
When a trunk branch is selected, the new workspace branch is created from
that trunk instead of from HEAD or an existing remote branch.
UI Changes:
- Command palette: Added trunk branch selection field with fuzzy search
- Modal (CMD+N): Added dropdown to select trunk branch
- Both UIs load local branches and show them as options
- Trunk branch selection is optional (defaults to HEAD if not selected)
Backend Changes:
- Added listLocalBranches() to git.ts to enumerate local branches
- Updated createWorktree() to accept optional trunkBranch parameter
- New logic: if trunk is specified, always create new branch from trunk
- Ignores remote branches when trunk is explicitly selected
- Errors if local branch already exists (prevents overwrite)
- Without trunk: preserves existing behavior (checkout remote or create from HEAD)
IPC Layer:
- Added WORKSPACE_LIST_BRANCHES channel to fetch branches for a project
- Updated workspace.create to accept and pass through trunkBranch
- Wired through preload.ts, ipcMain.ts, and type definitions
Integration:
- Updated App.tsx to pass trunk branch from modal to backend
- Updated command palette prompts to collect trunk branch selection
- Added getBranchesForProject callback to command registry context
- Command palette supports async option loading with fuzzy filtering
This enables creating feature branches from any local branch, useful for:
- Creating branches from main instead of current HEAD
- Starting new work from a specific release branch
- Isolating work from unrelated changes on current branch
_Generated with `cmux`_
Change-Id: Ic2a710104f3a5925e0e6bdff1d0e5ed772bcf108
Signed-off-by: Thomas Kosiewski <tk@coder.com>
0 commit comments