-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[website] Implement algolia redesign #28252
Conversation
I think we should try the docsearch lib. https://autocomplete-experimental.netlify.app/docs/DocSearch cc @oliviertassinari what do you think between |
Agree 👍 |
5955fa4
to
04ab442
Compare
0bed37a
to
528dece
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
04b318b
to
6697fe2
Compare
const [focused, setFocused] = React.useState(false); | ||
const theme = useTheme(); | ||
useLazyCSS( | ||
'https://cdn.jsdelivr.net/npm/@docsearch/[email protected]/dist/style.min.css', |
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 you know why @docsearch/css
is a dependency of @docsearch/react
? Maybe we don't need this hook anymore.
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.
They just reexport from @docsearch/react/style
in here but I don't see it is using in their component.
What if we import the module like this? so that if the package version updated we don't need to update multiple places.
import "@docsearch/react/style" // equal to @docsearch/css
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.
What if we import the module like this? so that if the package version updated we don't need to update multiple places.
I am trying this
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.
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.
We need to keep this.
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.
We can go with the current approach and open another PR for improvement?
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.
This is looking awesome. Nice work @hbjORbj and @siriwatknp!
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.
It looks awesome! 🎉
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 new search UX feels much better! I have left a couple of notes so we can follow-up to polish:
- On mobile should we remove the border radius or add a little bit of margin to see the black overlay?
- On user agents with width scrollbar, the header moves:
Maybe an issue to open at https://github.com/algolia/docsearch or something for us to batch as we handle the Modal
'&::-webkit-scrollbar-thumb': { | ||
borderColor: | ||
theme.palette.mode === 'dark' | ||
? theme.palette.primaryDark[900] | ||
: theme.palette.background.paper, | ||
backgroundColor: | ||
theme.palette.mode === 'dark' | ||
? theme.palette.primaryDark[700] | ||
: theme.palette.grey[500], | ||
}, | ||
'&::-webkit-scrollbar-track': { | ||
backgroundColor: theme.palette.background.paper, | ||
}, |
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.
AFAIK, we could remove this, and use colorScheme: theme.palette.mode
at the root
'&::-webkit-scrollbar-thumb': { | |
borderColor: | |
theme.palette.mode === 'dark' | |
? theme.palette.primaryDark[900] | |
: theme.palette.background.paper, | |
backgroundColor: | |
theme.palette.mode === 'dark' | |
? theme.palette.primaryDark[700] | |
: theme.palette.grey[500], | |
}, | |
'&::-webkit-scrollbar-track': { | |
backgroundColor: theme.palette.background.paper, | |
}, |
addStartScreen(); | ||
} | ||
if (searchInput) { | ||
const handleInput = (e) => { |
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.
Please no shortcuts
const handleInput = (e) => { | |
const handleInput = (event) => { |
if (modal) { | ||
// fade out transition | ||
modal.style.opacity = 0; | ||
setTimeout(() => { |
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.
clearTimeout?
items: [ | ||
{ name: 'Material Icons', href: '/components/material-icons/' }, | ||
{ name: 'Text Fields', href: '/components/text-fields/' }, | ||
{ name: 'Button', href: '/components/buttons' }, |
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.
{ name: 'Button', href: '/components/buttons' }, | |
{ name: 'Button', href: '/components/buttons/' }, |
searchParameters={{ | ||
facetFilters: ['version:master', facetFilterLanguage], | ||
}} | ||
placeholder="Search..." |
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.
placeholder="Search..." | |
placeholder="Search…" |
We don't have search on mobile 😂 |
will batch some minor fixes from @oliviertassinari in another PR. |
close #26112
close #28415
close #28467
Summary
@docsearch/react, css
latest versionAppSearch.js
to use built-in keyboard handler from docsearch.Preview: https://deploy-preview-28252--material-ui.netlify.app/ (Try the search bar)