CommandPalette: Remove parent search and fuzzy search for pages (#71825)

* user essentials mob! 🔱

lastFile:public/app/features/commandPalette/useMatches.ts

* user essentials mob! 🔱

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
Co-authored-by: eledobleefe <laura.fernandez@grafana.com>
Co-authored-by: Joao Silva <joao.silva@grafana.com>
Co-authored-by: L-M-K-B <48948963+L-M-K-B@users.noreply.github.com>
Co-authored-by: Roxana Turc <anamaria-roxana.turc@grafana.com>
This commit is contained in:
Tobias Skarhed 2023-07-18 12:00:26 +02:00 committed by GitHub
parent 50f7937675
commit 45fec1ae26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
});
}