fix(worktree): hide non-matching branches during search
This commit is contained in:
@@ -1142,7 +1142,7 @@ export function NewWorktreeDialog({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{existingBranchRankedGroups.otherLocal.length > 0 && (
|
{!hasExistingBranchQuery && existingBranchRankedGroups.otherLocal.length > 0 && (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="typography-small font-semibold text-foreground px-2">
|
<div className="typography-small font-semibold text-foreground px-2">
|
||||||
{hasExistingBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}
|
{hasExistingBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}
|
||||||
@@ -1174,7 +1174,7 @@ export function NewWorktreeDialog({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{existingBranchRankedGroups.otherRemote.length > 0 && (
|
{!hasExistingBranchQuery && existingBranchRankedGroups.otherRemote.length > 0 && (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="typography-small font-semibold text-foreground px-2">
|
<div className="typography-small font-semibold text-foreground px-2">
|
||||||
{hasExistingBranchQuery ? t('session.newWorktree.otherRemoteBranches') : t('session.newWorktree.remoteBranches')}
|
{hasExistingBranchQuery ? t('session.newWorktree.otherRemoteBranches') : t('session.newWorktree.remoteBranches')}
|
||||||
@@ -1401,7 +1401,7 @@ export function NewWorktreeDialog({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{sourceBranchRankedGroups.otherLocal.length > 0 && (
|
{!hasSourceBranchQuery && sourceBranchRankedGroups.otherLocal.length > 0 && (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="typography-small font-semibold text-foreground px-2">
|
<div className="typography-small font-semibold text-foreground px-2">
|
||||||
{hasSourceBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}
|
{hasSourceBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}
|
||||||
@@ -1428,7 +1428,7 @@ export function NewWorktreeDialog({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{sourceBranchRankedGroups.otherRemote.length > 0 && (
|
{!hasSourceBranchQuery && sourceBranchRankedGroups.otherRemote.length > 0 && (
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="typography-small font-semibold text-foreground px-2">
|
<div className="typography-small font-semibold text-foreground px-2">
|
||||||
{hasSourceBranchQuery ? t('session.newWorktree.otherRemoteBranches') : t('session.newWorktree.remoteBranches')}
|
{hasSourceBranchQuery ? t('session.newWorktree.otherRemoteBranches') : t('session.newWorktree.remoteBranches')}
|
||||||
@@ -1607,7 +1607,7 @@ export function NewWorktreeDialog({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{existingBranchRankedGroups.otherLocal.length > 0 && (
|
{!hasExistingBranchQuery && existingBranchRankedGroups.otherLocal.length > 0 && (
|
||||||
<>
|
<>
|
||||||
{hasExistingBranchQuery && <CommandSeparator />}
|
{hasExistingBranchQuery && <CommandSeparator />}
|
||||||
<CommandGroup heading={hasExistingBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}>
|
<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) && (
|
{(existingBranchRankedGroups.otherLocal.length > 0 || hasExistingBranchQuery) && (
|
||||||
<CommandSeparator />
|
<CommandSeparator />
|
||||||
@@ -1843,7 +1843,7 @@ export function NewWorktreeDialog({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{sourceBranchRankedGroups.otherLocal.length > 0 && (
|
{!hasSourceBranchQuery && sourceBranchRankedGroups.otherLocal.length > 0 && (
|
||||||
<>
|
<>
|
||||||
{hasSourceBranchQuery && <CommandSeparator />}
|
{hasSourceBranchQuery && <CommandSeparator />}
|
||||||
<CommandGroup heading={hasSourceBranchQuery ? t('session.newWorktree.otherLocalBranches') : t('session.newWorktree.localBranches')}>
|
<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) && (
|
{(sourceBranchRankedGroups.otherLocal.length > 0 || hasSourceBranchQuery) && (
|
||||||
<CommandSeparator />
|
<CommandSeparator />
|
||||||
|
|||||||
Reference in New Issue
Block a user