feat(select): add Alt-C to create worktree from query#933
Merged
Conversation
Add keybinding to the interactive picker (`wt switch`) that creates a new worktree using the current query text as the branch name. Users can now browse existing worktrees, then decide whether to switch (Enter) or create (Alt-C). Suggested by @wklimowicz in #518. Closes #518 Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Test the new Alt-C keybinding that creates a worktree from the query: - test_select_create_worktree_with_alt_c: verifies worktree creation - test_select_create_with_empty_query_fails: verifies error handling Co-Authored-By: Claude <noreply@anthropic.com>
Covers the "switch to existing worktree" code path (lines 224-227) that wasn't exercised by existing tests which all abort with Escape. Co-Authored-By: Claude <noreply@anthropic.com>
Replace `else if let Some(selected) ... else { return Ok(()) }` with
`else { ... .expect(...) }` to improve coverage. The defensive return
was unreachable because skim's accept action always includes a selection.
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Alt-Ckeybinding to the interactive picker (wt switch) that creates a new worktree using the current query text as the branch nameSuggested by @wklimowicz in #518 (comment).
Test plan
wt switch, type a branch name, press Alt-C to create🤖 Generated with Claude Code
This was written by Claude Code on behalf of @max-sixty