Skip to content

Conversation

aileenvl
Copy link

@aileenvl aileenvl commented Jul 9, 2025

Preview this PR at https://nodejs-org-git-fork-oramasearch-main-openjs.vercel.app/en

Description

Validation

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@aileenvl aileenvl requested review from a team as code owners July 9, 2025 19:07
Copy link

vercel bot commented Jul 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Aug 26, 2025 7:12pm

Copy link
Member

@avivkeller avivkeller left a 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 :-).

Comment on lines 141 to 145
(hit.document.siteSection as string).toLowerCase() ===
'docs'
? `/${hit.document.path}`
: `/${locale}/${hit.document.path}`
}
Copy link
Member

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?

@avivkeller avivkeller marked this pull request as draft July 9, 2025 20:00
@avivkeller avivkeller changed the title DRAFT: Orama core updates feat(orama): use new UI components Jul 9, 2025
aileenvl and others added 5 commits July 9, 2025 19:24
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]>
Copy link
Contributor

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.
We recommend giving a read on our Translation Guidelines.

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
Copy link
Member

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?

@avivkeller
Copy link
Member

Unblocking, since the environment variables have been set, I believe

@ovflowd
Copy link
Member

ovflowd commented Aug 25, 2025

Unblocking, since the environment variables have been set, I believe

@MattIPv4 have they? 🤔

@MattIPv4
Copy link
Member

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.

@ovflowd
Copy link
Member

ovflowd commented Aug 25, 2025

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 :)

@Copilot Copilot AI review requested due to automatic review settings August 26, 2025 18:42
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 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.

Comment on lines +37 to +38
// 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.
Copy link
Preview

Copilot AI Aug 26, 2025

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.

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

Comment on lines +9 to +10
projectId: process.env.NEW_ORAMA_PROJECT_ID || '',
apiKey: process.env.NEW_ORAMA_API_KEY || '',
Copy link
Member

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?

Copy link
Member

@avivkeller avivkeller left a 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

Comment on lines +12 to +22
.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;
}
Copy link
Member

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 || '',
Copy link
Member

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?

Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants