Skip to content
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

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

wesbillman
Copy link
Member

  • Fixes issues with CommandPallete erroring when typeAlias is used since we had typealias in the icons list
  • Fixes issues with urls that have module/typealias/declName in them vs. module/typeAlias/declName
  • Performance improvements on CommandPallete searching/filtering.

See also #3146

@wesbillman wesbillman requested a review from a team as a code owner October 17, 2024 16:20
@wesbillman wesbillman requested review from deniseli and removed request for a team October 17, 2024 16:20
This was referenced Oct 17, 2024
@wesbillman wesbillman merged commit f09e9da into main Oct 17, 2024
99 checks passed
@wesbillman wesbillman deleted the fix-typealias-casing-issues branch October 17, 2024 16:31
Comment on lines +28 to +32
const fuseOptions = {
keys: ['title', { name: 'subtitle', weight: 1 }],
minMatchCharLength: 2,
fieldNormWeight: 2,
}
Copy link
Contributor

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

Copy link
Member Author

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
Copy link
Contributor

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}`)
Copy link
Contributor

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!

@deniseli deniseli added the approved Marks an already closed PR as approved label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Marks an already closed PR as approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants