-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[docs] Improve in-site search #17450
Conversation
Details of bundle changes.Comparing: 1a480fe...a2ad77c
|
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.
Sweet :)!
apiKey: '1d8534f83b9b0cfea8f16498d19fbcab', | ||
indexName: 'material-ui', | ||
inputSelector: '#docsearch-input', | ||
algoliaOptions: { | ||
facetFilters: ['version:master', `language:${userLanguage}`], | ||
hitsPerPage: 40, |
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.
Random thought: I'm wondering if it's not too many options 🤔?
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.
Why would it be too many?
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 initial thought comes from the tradeoff Algolia took in the default value of this option. Aside from that, I can only guess and make inaccurate reasoning.
We can take the query "modal", let's say we are looking for the API, with 40 results, we have to scroll 10 results, with the default value, we can see it without scrolling.
https://www.smartinsights.com/search-engine-optimisation-seo/seo-analytics/comparison-of-google-clickthrough-rates-by-position/ could be an interesting resource. Seems that most people stop looking after 10 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.
We can take the query "modal", let's say we are looking for the API, with 40 results, we have to scroll 10 results, with the default value, we can see it without scrolling.
I don't understand this point. How can something be hidden with less 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.
Seems that most people stop looking after 10 results.
So lets improve the situation for the people who keep looking.
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.
Agree, if we can help the few without harming the many, it's good to take 👍
}, | ||
})); | ||
}), | ||
{ name: 'AppSearch' }, |
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 to provide a name?
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.
Better DX. IMO I would add a lint rule against omitting the name. Makes CSS debugging hard.
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.
Maybe we need a Babel plugin that adds it automatically based on the filename 🤔
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.
Makes sense Probably based on the var name since this will automatically work for multiple components per file.
* [docs] Batch small changes (mui#17435) * [docs] Add synonyms for brand icons (mui#17455) * [docs] Add synonyms for brand icons * Remove Ic prefixed icons * [docs] Improve in-site search (mui#17450) * [ButtonBase] Fix blurry text issue (mui#17453) * [docs] Revert hits per page change (mui#17458) * [docs] Fix heading format in CONTRIBUTING.md (mui#17460) * [Chip] Load the right version of Avatar (mui#17469) * [TablePagination] Merge root classes properly (mui#17467) * [Breadcrumbs] Improve API docs (mui#17468) * [TextField] Handle Chrome autofill (mui#17436) * [docs] Clarify props spread for ListItem when button flag is set (mui#17466)
Ref: #16502
At some point we probably want to use our own combobox implementation. autocomplete.js has some a11y (nvda announces non-descriptive label when browsing through list) as well as UX issues (scroll when browsing should be handled by the package not the app author)