-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[polaris.shopify.com] Refactor site search (ready for review) #6502
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
Conversation
a3a40bb
to
0281d22
Compare
}, | ||
"intro": "Our mission is to make commerce better for _everyone_. Building products for everyone means creating inclusive content.", | ||
"section": "content" | ||
"category": "content" |
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.
Love the consolidation here. I was unsure why it's called content
but this is fine for now.
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.
The category maps to the folder that the foundations content lives in: foundations | design | content | patterns
.
components: "Components", | ||
foundations: "Foundations", | ||
tokens: "Tokens", | ||
icons: "Icons", |
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.
Do we need this? Could just be uppercase the key function
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.
I know, it was tempting to remove this very verbose part of the code. It just feels icky to hide the translations strings and make assumptions about language. If we add a more complex search result type like, GitHub repos
, it's nice to be able to be explicit about capitalization.
Cleans up the code that powers the global search. The new code is still complex, but less so. Implementing new types of search results is also easier thanks to the simpler
useGlobalSearchResults()
hook.UX updates
This refactor shouldn't change the search experience much. One update however, is that foundations results now render with the correct icon / color.
Related to #6529, this PR also increases the number of search results that are visible for each category, which fixes #6546.
Also fixes #6463.