Skip to content
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

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

dan-lee
Copy link
Contributor

@dan-lee dan-lee commented Mar 28, 2025

No description provided.

@dan-lee dan-lee added the feature Feature label Mar 28, 2025
@dan-lee dan-lee requested review from mosch and Copilot March 28, 2025 13:44
Copy link

linear bot commented Mar 28, 2025

Copy link

vercel bot commented Mar 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zudoku-cosmo-cargo ✅ Ready (Inspect) Visit Preview Mar 28, 2025 2:01pm
zudoku-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2025 2:01pm
zudoku-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 28, 2025 2:01pm

Copy link

nx-cloud bot commented Mar 28, 2025

View your CI Pipeline Execution ↗ for commit 2327797.

Command Status Duration Result
nx run-many -t build --projects=tag:example ✅ Succeeded 1m 13s View ↗
nx run-many -t lint:ci format:ci build:ci test ✅ Succeeded 24s View ↗

☁️ Nx Cloud last updated this comment at 2025-03-28 14:02:51 UTC

Copy link
Contributor

@Copilot Copilot AI left a 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") {

Comment on lines +51 to +53
requestIdleCallback(() => {
commandListRef.current?.scrollTo({ top: 0 });
});
Copy link
Preview

Copilot AI Mar 28, 2025

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.

Suggested change
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.

@dan-lee dan-lee merged commit 488ab35 into main Mar 28, 2025
8 checks passed
@dan-lee dan-lee deleted the feat/zup-4254-search-authentication branch March 28, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature
Development

Successfully merging this pull request may close these issues.

2 participants