From 94d0764243d4b01b4355ff2a4ce6a1ef42bb0a05 Mon Sep 17 00:00:00 2001 From: yaoweiprc <6896642+yaoweiprc@users.noreply.github.com> Date: Tue, 23 Dec 2025 15:30:16 +0800 Subject: [PATCH] Support fuzzy match when picking repo [INS-1460] (#9504) * tmp * Fuzzy match for selecting branch --- .../git-credentials/git-remote-branch-select.tsx | 6 +++++- .../git-credentials/github-repository-select.tsx | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/insomnia/src/ui/components/git-credentials/git-remote-branch-select.tsx b/packages/insomnia/src/ui/components/git-credentials/git-remote-branch-select.tsx index da223b6bc1..333d965d52 100644 --- a/packages/insomnia/src/ui/components/git-credentials/git-remote-branch-select.tsx +++ b/packages/insomnia/src/ui/components/git-credentials/git-remote-branch-select.tsx @@ -3,6 +3,7 @@ import { Button, ComboBox, Input, Label, ListBox, ListBoxItem, Popover } from 'r import * as reactUse from 'react-use'; import { z } from 'zod/v4'; +import { fuzzyMatch } from '~/common/misc'; import type { GitCredentials } from '~/models/git-repository'; import { useGitRemoteBranchesActionFetcher } from '~/routes/git.remote-branches'; @@ -66,11 +67,14 @@ export const GitRemoteBranchSelect = ({ className="w-full" defaultSelectedKey={remoteBranches[0]} isDisabled={isComboboxDisabled} - items={remoteBranches.map(branch => ({ + defaultItems={remoteBranches.map(branch => ({ id: branch, name: branch, }))} menuTrigger="focus" + defaultFilter={(branch: string, inputValue: string) => + Boolean(fuzzyMatch(inputValue, branch, { splitSpace: true, loose: false })?.indexes) + } >