-
Notifications
You must be signed in to change notification settings - Fork 18
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
Pass auth and context to Pagefind search filter #847
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
View your CI Pipeline Execution ↗ for commit 2327797.
☁️ Nx Cloud last updated this comment at |
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.
Pull Request Overview
This pull request updates the search functionality by passing additional authentication and context data to the Pagefind search filter, and it refines the UI and documentation accordingly.
- Modified getResults and searchResultGenerator to accept and forward auth and context parameters.
- Updated search UI in ResultList and PagefindSearch to improve user experience.
- Enhanced documentation to describe search result transformation with the new parameters.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/zudoku/src/lib/plugins/search-pagefind/get-results.tsx | Updated function signatures to pass auth and context to search and transform functions. |
packages/zudoku/src/lib/plugins/search-pagefind/ResultList.tsx | Added a scroll ref and conditional UI adjustments for better UX. |
packages/zudoku/src/lib/plugins/search-pagefind/PagefindSearch.tsx | Integrated auth and context in the search query and added a clear search button. |
packages/zudoku/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx | Minor UI padding and button type adjustment. |
docs/pages/configuration/search.md | Expanded documentation to cover transforming and filtering search results. |
Comments suppressed due to low confidence (2)
packages/zudoku/src/lib/plugins/search-pagefind/get-results.tsx:14
- [nitpick] Consider using a consistent generic type for AuthState between getResults and searchResultGenerator (e.g., AuthState vs. AuthState) to ensure type consistency.
auth: AuthState;
packages/zudoku/src/lib/plugins/search-pagefind/PagefindSearch.tsx:61
- Consider defining a constant for the 'NOT_BUILT_YET' error message to improve clarity and maintainability.
if (result.isError && result.error.message !== "NOT_BUILT_YET") {
requestIdleCallback(() => { | ||
commandListRef.current?.scrollTo({ top: 0 }); | ||
}); |
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.
requestIdleCallback is not supported in all browsers; consider adding a fallback solution or polyfill for broader compatibility.
requestIdleCallback(() => { | |
commandListRef.current?.scrollTo({ top: 0 }); | |
}); | |
const callback = () => { | |
commandListRef.current?.scrollTo({ top: 0 }); | |
}; | |
if (typeof requestIdleCallback === 'function') { | |
requestIdleCallback(callback); | |
} else { | |
setTimeout(callback, 0); | |
} |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
3452672
to
cc4ae37
Compare
cc4ae37
to
2327797
Compare
No description provided.