From 45fec1ae262c50106eb43382454e419ee2d800de Mon Sep 17 00:00:00 2001 From: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Date: Tue, 18 Jul 2023 12:00:26 +0200 Subject: [PATCH] CommandPalette: Remove parent search and fuzzy search for pages (#71825) * user essentials mob! :trident: lastFile:public/app/features/commandPalette/useMatches.ts * user essentials mob! :trident: --------- Co-authored-by: Ashley Harrison Co-authored-by: joshhunt Co-authored-by: eledobleefe Co-authored-by: Joao Silva Co-authored-by: L-M-K-B <48948963+L-M-K-B@users.noreply.github.com> Co-authored-by: Roxana Turc --- public/app/features/commandPalette/useMatches.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/public/app/features/commandPalette/useMatches.ts b/public/app/features/commandPalette/useMatches.ts index 2e726326141..7c0456325c5 100644 --- a/public/app/features/commandPalette/useMatches.ts +++ b/public/app/features/commandPalette/useMatches.ts @@ -186,9 +186,7 @@ function useInternalMatches(filtered: ActionImpl[], search: string): Match[] { return throttledFiltered.map((action) => ({ score: 0, action })); } - const haystack = throttledFiltered.map(({ name, keywords, subtitle }) => - `${name} ${keywords ?? ''} ${subtitle ?? ''}`.toLowerCase() - ); + const haystack = throttledFiltered.map(({ name, keywords }) => `${name} ${keywords ?? ''}`.toLowerCase()); const results: Match[] = []; @@ -237,11 +235,9 @@ function useUfuzzy(): uFuzzy { if (!ref.current) { ref.current = new uFuzzy({ - intraMode: 1, - intraIns: 1, - intraSub: 1, - intraTrn: 1, - intraDel: 1, + // See https://github.com/leeoniya/uFuzzy#options + intraMode: 0, // don't allow for typos/extra letters + intraIns: 0, // require each term in the search to appear exactly }); }