fix(worktree): hide non-matching branches during search

This commit is contained in:
Leonid Skorobogatyy
2026-06-24 03:26:26 +11:00
parent 43f677d56d
commit 1ad470cead
@@ -1142,7 +1142,7 @@ export function NewWorktreeDialog({
</div>
)}
{existingBranchRankedGroups.otherLocal.length > 0 && (
{!hasExistingBranchQuery && existingBranchRankedGroups.otherLocal.length > 0 && (
<div className="space-y-2">
<div className="typography-small font-semibold text-foreground px-2">
{hasExistingBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}
@@ -1174,7 +1174,7 @@ export function NewWorktreeDialog({
</div>
)}
{existingBranchRankedGroups.otherRemote.length > 0 && (
{!hasExistingBranchQuery && existingBranchRankedGroups.otherRemote.length > 0 && (
<div className="space-y-2">
<div className="typography-small font-semibold text-foreground px-2">
{hasExistingBranchQuery ? t('session.newWorktree.otherRemoteBranches') : t('session.newWorktree.remoteBranches')}
@@ -1401,7 +1401,7 @@ export function NewWorktreeDialog({
</div>
)}
{sourceBranchRankedGroups.otherLocal.length > 0 && (
{!hasSourceBranchQuery && sourceBranchRankedGroups.otherLocal.length > 0 && (
<div className="space-y-2">
<div className="typography-small font-semibold text-foreground px-2">
{hasSourceBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}
@@ -1428,7 +1428,7 @@ export function NewWorktreeDialog({
</div>
)}
{sourceBranchRankedGroups.otherRemote.length > 0 && (
{!hasSourceBranchQuery && sourceBranchRankedGroups.otherRemote.length > 0 && (
<div className="space-y-2">
<div className="typography-small font-semibold text-foreground px-2">
{hasSourceBranchQuery ? t('session.newWorktree.otherRemoteBranches') : t('session.newWorktree.remoteBranches')}
@@ -1607,7 +1607,7 @@ export function NewWorktreeDialog({
</div>
)}
{existingBranchRankedGroups.otherLocal.length > 0 && (
{!hasExistingBranchQuery && existingBranchRankedGroups.otherLocal.length > 0 && (
<>
{hasExistingBranchQuery && <CommandSeparator />}
<CommandGroup heading={hasExistingBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}>
@@ -1632,7 +1632,7 @@ export function NewWorktreeDialog({
</>
)}
{existingBranchRankedGroups.otherRemote.length > 0 && (
{!hasExistingBranchQuery && existingBranchRankedGroups.otherRemote.length > 0 && (
<>
{(existingBranchRankedGroups.otherLocal.length > 0 || hasExistingBranchQuery) && (
<CommandSeparator />
@@ -1843,7 +1843,7 @@ export function NewWorktreeDialog({
</div>
)}
{sourceBranchRankedGroups.otherLocal.length > 0 && (
{!hasSourceBranchQuery && sourceBranchRankedGroups.otherLocal.length > 0 && (
<>
{hasSourceBranchQuery && <CommandSeparator />}
<CommandGroup heading={hasSourceBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}>
@@ -1863,7 +1863,7 @@ export function NewWorktreeDialog({
</>
)}
{sourceBranchRankedGroups.otherRemote.length > 0 && (
{!hasSourceBranchQuery && sourceBranchRankedGroups.otherRemote.length > 0 && (
<>
{(sourceBranchRankedGroups.otherLocal.length > 0 || hasSourceBranchQuery) && (
<CommandSeparator />