-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(orama): use new UI components #7971
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Thank you so much!
I've left some comments, and I am here to help you implement anything you need help with, just ping me :-).
(hit.document.siteSection as string).toLowerCase() === | ||
'docs' | ||
? `/${hit.document.path}` | ||
: `/${locale}/${hit.document.path}` | ||
} |
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.
Can we put this in utils?
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Note Your Pull Request seems to be updating Translations of the Node.js Website. Whilst we appreciate your intent; Any Translation update should be done through our Crowdin Project. Thank you! |
@@ -1,18 +1,16 @@ | |||
import { CloudManager } from '@oramacloud/client'; | |||
import { OramaCloud } from '@orama/core'; | |||
|
|||
import { siteContent } from './get-documents.mjs'; | |||
import { ORAMA_SYNC_BATCH_SIZE } from '../../next.constants.mjs'; | |||
|
|||
// The following follows the instructions at https://docs.orama.com/cloud/data-sources/custom-integrations/webhooks |
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.
Is there a new link for this?
Unblocking, since the environment variables have been set, I believe |
@MattIPv4 have they? 🤔 |
Unless you've set the production ones in Vercel that I couldn't, no, they've not been set. I've also not been sent any of the preview environment variables to be set yet. |
I don't have the production ones either. I think we can get the PR from nodejs/email merged and that should do it. Or you can attempt to login again and I'll send you the codes for the meantime :) |
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 PR modernizes the Orama search integration by migrating from @orama/react-components
to the new @orama/ui
package and updating the sync script to use @orama/core
. The changes implement a more customizable search and chat interface with mobile support and keyboard navigation.
Key Changes
- Migrated from
@orama/react-components
to@orama/ui
components for better customization - Updated sync script to use new
@orama/core
API instead of@oramacloud/client
- Added comprehensive search and chat UI components with mobile responsiveness
Reviewed Changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
packages/i18n/src/locales/en.json |
Added new translation keys for search UI features |
apps/site/scripts/orama-search/sync-orama-cloud.mjs |
Migrated to new Orama Cloud API using @orama/core |
apps/site/package.json |
Updated dependencies to include new Orama packages |
apps/site/components/Common/Searchbox/ |
New comprehensive search interface with chat integration |
apps/site/components/withNavBar.tsx |
Updated import path for search component |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
// The new API from @orama/core might have a different approach for full sync. | ||
// Based on the provided examples, we are now only running the update. |
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 comment mentions that the new API 'might have a different approach for full sync' but doesn't provide certainty. This suggests the migration may be incomplete - consider verifying the new API behavior for data synchronization.
// The new API from @orama/core might have a different approach for full sync. | |
// Based on the provided examples, we are now only running the update. | |
// To ensure a true full sync, we clear the index before inserting new documents. | |
// This prevents orphaned documents from remaining in the index. | |
if (typeof datasource.deleteAllDocuments === 'function') { | |
await datasource.deleteAllDocuments(); | |
} else { | |
// TODO: Implement logic to remove documents not present in siteContent | |
console.warn('WARNING: datasource.deleteAllDocuments() is not available. The index may accumulate stale documents.'); | |
} |
Copilot uses AI. Check for mistakes.
projectId: process.env.NEW_ORAMA_PROJECT_ID || '', | ||
apiKey: process.env.NEW_ORAMA_API_KEY || '', |
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.
I suspect the GitHub Actions workflow needs to be updated to expose these new env vars?
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.
I'm still seeing one styling inconsistencies.
I'd love if: @apply
was used when possible, and manual css was only on a if-needed basis.
Additionally, no style
attributes should be needed.
Let me know if you need help with that
.chatLoadingWrapper { | ||
align-items: center; | ||
background-color: #0d121c; | ||
border-radius: var(--radius-m, calc(12rem / var(--orama-base-font-size, 16))); | ||
display: flex; | ||
justify-content: center; | ||
margin: 0 var(--spacing-l, calc(16rem / var(--orama-base-font-size, 16))); | ||
margin-bottom: 24px; | ||
min-height: 60px; | ||
padding: 24px; | ||
} |
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.
Can all of these / most of these be tailwind?
}); | ||
|
||
const dataSourcesRef = useRef<Array<string>>([ | ||
process.env.NEXT_PUBLIC_ORAMA_DATASOURCE_ID || '', |
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 env var does not exist, as I was told it was not needed for the frontend. Should it be set in Vercel, or can the code be written here such that its not needed?
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.
Hi @MattIPv4 yes sorry this one will also be needed
Preview this PR at https://nodejs-org-git-fork-oramasearch-main-openjs.vercel.app/en
Description
Validation
Related Issues
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.