mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
fix: show create-worktree action in jump palette only on empty results (#611)
The "Create worktree" item in Cmd+J now only appears when the search query produces no matching worktrees, keeping the list uncluttered when existing worktrees already satisfy the search.
This commit is contained in:
@@ -99,9 +99,10 @@ export default function WorktreeJumpPalette(): React.JSX.Element | null {
|
||||
[sortedWorktrees, query, repoMap, prCache, issueCache]
|
||||
)
|
||||
const createWorktreeName = query.trim()
|
||||
// Why: only surface the create-worktree action after the user has typed a query,
|
||||
// so it doesn't clutter the default (empty-query) list of recent worktrees.
|
||||
const showCreateAction = canCreateWorktree && createWorktreeName.length > 0
|
||||
// Why: only surface the create-worktree action when the query yields no matches,
|
||||
// so it doesn't clutter the list when existing worktrees already satisfy the search.
|
||||
const showCreateAction =
|
||||
canCreateWorktree && createWorktreeName.length > 0 && matches.length === 0
|
||||
|
||||
// Build a map of worktreeId -> Worktree for quick lookup
|
||||
const worktreeMap = useMemo(() => {
|
||||
|
||||
Reference in New Issue
Block a user