-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: typealias case issues in icons and urls #3147
Conversation
const fuseOptions = { | ||
keys: ['title', { name: 'subtitle', weight: 1 }], | ||
minMatchCharLength: 2, | ||
fieldNormWeight: 2, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nitty optimization but we could pull this out of the function/component now that it's just a constant to avoid it getting reinstantiated every call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we probably have a few places like this 😬
|
||
useEffect(() => { | ||
if (query === '') { | ||
setFilteredItems([]) | ||
} else { | ||
const results = fuse.search(query).map((result) => result.item) | ||
setFilteredItems(results) | ||
|
||
// only show first 25 results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
niiiiiiice!
|
||
const normalizedDeclCase = declCase?.toLowerCase() | ||
if (!normalizedDeclCase || !declIcons[normalizedDeclCase]) { | ||
console.warn(`No icon for decl case: ${declCase}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is way better! Thanks!
CommandPallete
erroring whentypeAlias
is used since we hadtypealias
in the icons listmodule/typealias/declName
in them vs.module/typeAlias/declName
CommandPallete
searching/filtering.See also #3146