Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/web/src/components/BranchToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import { observeResize } from "~/lib/observeResize";
export interface BranchToolbarHandle {
openBranchPicker: () => void;
usePreviousWorktree: () => void;
selectNewWorktree: () => void;
}

interface BranchToolbarProps {
Expand Down Expand Up @@ -652,10 +653,17 @@ export const BranchToolbar = memo(function BranchToolbar({
onUsePreviousWorktree();
onComposerFocusRequest?.();
},
selectNewWorktree: () => {
if (!showGitControls || envModeLocked || forceNewWorktree) return;
onEnvModeChange("worktree");
},
}),
[
canUsePreviousWorktree,
envModeLocked,
forceNewWorktree,
onComposerFocusRequest,
onEnvModeChange,
onUsePreviousWorktree,
previousWorktreeSeed,
showGitControls,
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/components/chat/composerShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ export function composerShortcutCommands(
"composer.previousWorktree": ({ event }) => {
if (!event.repeat) branchToolbarRef.current?.usePreviousWorktree();
},
"composer.newWorktree": ({ event }) => {
if (!event.repeat) branchToolbarRef.current?.selectNewWorktree();
},
} satisfies ChatShortcutCommands;
}
2 changes: 2 additions & 0 deletions docs/user/keybindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Use `mod+shift+e` for effort, `mod+shift+a` for permissions, `mod+shift+x` for t
workspace, and `mod+shift+g` for the Git branch. The workspace menu includes the
current checkout, a new worktree, and the previous worktree when available.
Use `mod+shift+l` to reuse the previous worktree directly.
To select a new worktree directly, bind **Composer: New Worktree** in Keybindings.
It has no default shortcut and uses the same rules as the workspace menu.

To change effort one step without opening the picker, bind
**Composer: Increase Effort** and **Composer: Decrease Effort** in Keybindings.
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/keybindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export const STATIC_KEYBINDING_COMMANDS = [
"composer.decreaseEffort",
"composer.mode",
"composer.workspace",
"composer.newWorktree",
"composer.previousWorktree",
"composer.branch",
"chat.new",
Expand Down
Loading