-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
feat(theme-search-algolia): add support for DocSearch v4.3.2 and new Suggested Questions #11541
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
feat(theme-search-algolia): add support for DocSearch v4.3.2 and new Suggested Questions #11541
Conversation
…ew Suggested Questions
|
Hi @NatanTechofNY! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
slorber
left a comment
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.
LGTM thanks 👍
Although it works, I find the UX a bit confusing, and it was hard for me to figure out how to see those suggested questions on our own website. As far as I understand, it only shows after clicking the "Start New Conversation" button, so you have to ask something to the LLM first before being able to see anything suggested.
Also a bit annoying to have the types breaking again and needing as any, but we'll figure this out later for Docusaurus v4.
Pre-flight checklist
Motivation
This PR adds support for the new
suggestedQuestionsparameter introduced in DocSearch v4.3, which allows users to enable or disable suggested questions in the Ask AI interface. Additionally, it updates the DocSearch dependency from^4.1.0to^4.3.2to support this new feature while maintaining backward compatibility with DocSearch v3.9+.The
suggestedQuestionsoption provides users with pre-configured questions they can click to quickly get started with Ask AI, improving the user experience when using the Ask AI feature.Test Plan
Code Changes
Type Definitions (
packages/docusaurus-theme-search-algolia/src/theme-search-algolia.d.ts):suggestedQuestions?: booleanto theAskAiConfigtypeValidation Schema (
packages/docusaurus-theme-search-algolia/src/validateThemeConfig.ts):suggestedQuestions: Joi.boolean().optional()validationUnit Tests (
packages/docusaurus-theme-search-algolia/src/__tests__/validateThemeConfig.test.ts):suggestedQuestions: truesuggestedQuestions: falseComponent Updates:
SearchBar/index.tsxanduseAlgoliaAskAi.tswith proper type handlingDocumentation (
website/docs/search.mdxandwebsite/versioned_docs/version-3.9.2/search.mdx):suggestedQuestionsparameterDependency Update (
packages/docusaurus-theme-search-algolia/package.json):"@docsearch/react": "^3.9.0 || ^4.1.0""@docsearch/react": "^3.9.0 || ^4.3.2"Manual Testing
To test the new feature:
Backward Compatibility
✅ Fully backward compatible with:
Screenshots
v4.3.2 includes the following new features:
Test links
Deploy preview: https://deploy-preview-11541--docusaurus-2.netlify.app/