mirror of
https://github.com/stablyai/orca
synced 2026-04-21 14:17:16 +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:
parent
10f8ce1a55
commit
8d6caa1f11
1 changed files with 4 additions and 3 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue