diff --git a/src/renderer/src/components/WorktreeJumpPalette.tsx b/src/renderer/src/components/WorktreeJumpPalette.tsx index 5c807ae8..9566d62b 100644 --- a/src/renderer/src/components/WorktreeJumpPalette.tsx +++ b/src/renderer/src/components/WorktreeJumpPalette.tsx @@ -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(() => {