Let users override the new worktree's name and parent directory#351
Merged
Conversation
Add a default-collapsed "Advanced" section to the New Worktree dialog with two optional overrides: the worktree folder name (placeholder is the computed name, the branch name) and the parent directory it is created in (placeholder is the resolved default base). Both empty keeps the default `base/<branch>` placement. The first section's footer shows the full resolved destination path, or the validation error when one is present. The same overrides are available outside the dialog: `supacode repo worktree-new` gains `--name` / `--location`, and the `repo/<id>/worktree/new` deeplink gains `name` / `location` query params. The folder-name override is a single leaf, so slashes, dot segments, and `.git` are rejected with an inline message; the check runs in the shared create path so the CLI and deeplink entry points are guarded too. Overrides flow through to `wt sw --path`, leaving the branch as the positional argument so the sidebar name still tracks the branch.
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.
Adds control over where a new worktree lands and what its folder is called, both in the New Worktree dialog and from the CLI / deeplinks.
Dialog
A default-collapsed "Advanced" section with two optional fields:
Leaving both empty preserves the existing
base/<branch>placement exactly. The first section's footer shows the full resolved destination path, or the validation error when one is present.CLI and deeplinks
supacode repo worktree-newgains--name <folder>and--location <dir>.supacode://repo/<id>/worktree/newdeeplink gainsnameandlocationquery params.Behavior
.gitare rejected with an inline message. The check runs in the shared create path, so the CLI and deeplink entry points are guarded the same way as the dialog.~-relative, and repo-relative paths.wt sw --path, leaving the branch as the positional argument, so the sidebar name still tracks the branch.Close #303