- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6.4k
feat(search): use new Orama components #8175
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
          
     Open
      
      
            micheleriva
  wants to merge
  117
  commits into
  nodejs:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
oramasearch:review-orama-searchbox
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
      
        
          +2,454
        
        
          −409
        
        
          
        
      
    
  
  
     Open
                    Changes from 102 commits
      Commits
    
    
            Show all changes
          
          
            117 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      7c4f8e5
              
                feat: add new searchbox - initial setup
              
              
                g-francesca e4d0c1d
              
                style: search button
              
              
                g-francesca 086dd84
              
                style: searchbox empty state
              
              
                g-francesca 8451f80
              
                style: modal search
              
              
                g-francesca 8ecdf9e
              
                style: prompt wrapper
              
              
                g-francesca 6ac3d65
              
                fix: layout sliding panel
              
              
                g-francesca 87db2f9
              
                style: chat sources
              
              
                g-francesca 40ea1c8
              
                refactor: search component
              
              
                g-francesca 31273fd
              
                feat: add translations for search component
              
              
                g-francesca 31e2db8
              
                update orama core and update logo
              
              
                aileenvl 2a22940
              
                update sync
              
              
                aileenvl 65ecd9f
              
                update pnpm-lock
              
              
                aileenvl 834636f
              
                Update apps/site/components/Common/Searchbox/Chat.tsx
              
              
                aileenvl f088203
              
                Update apps/site/components/Common/Searchbox/Chat.tsx
              
              
                aileenvl 3d582dd
              
                Update apps/site/components/Common/Searchbox/Search.tsx
              
              
                aileenvl b1fff6a
              
                Update apps/site/components/Common/Searchbox/Search.tsx
              
              
                aileenvl e09fa32
              
                Update apps/site/components/Common/Searchbox/Search.tsx
              
              
                aileenvl d37297f
              
                fix height and pr comments
              
              
                aileenvl 954ee99
              
                Merge branch 'main' of https://github.com/oramasearch/nodejs.org
              
              
                aileenvl ff59f5b
              
                fix import and add directories for Search and Chat
              
              
                aileenvl 8d7657e
              
                update icon and orama ui components
              
              
                aileenvl 43c56bd
              
                rollback translation changes
              
              
                aileenvl 83a0c1b
              
                update on datasource and ui components
              
              
                aileenvl f4e51bf
              
                update env variables
              
              
                aileenvl 242c667
              
                pr comments and facets added
              
              
                aileenvl 535d6a8
              
                pr comments
              
              
                aileenvl 992f1fe
              
                fixes in styles and facets
              
              
                aileenvl d73687a
              
                facets search fix
              
              
                aileenvl e7a64b9
              
                push facets query fix
              
              
                aileenvl dbd4637
              
                feat: adds filters to search
              
              
                micheleriva aab05d1
              
                Merge branch 'main' of github.com:oramasearch/nodejs.org
              
              
                micheleriva 5a7c885
              
                fix facet count
              
              
                aileenvl 7aa8350
              
                reset searchTerm
              
              
                aileenvl 89d9d71
              
                old logo
              
              
                aileenvl 80065bf
              
                fix mobile search
              
              
                aileenvl 78c4f3f
              
                chat mobile
              
              
                aileenvl 29f2faf
              
                mobile enhacements
              
              
                aileenvl 4892e1d
              
                fix blur
              
              
                aileenvl db4f272
              
                env variables and dispatcher
              
              
                aileenvl e7c235e
              
                change css to tailwind, remove inline styles and add env constant
              
              
                aileenvl 5e3d6e5
              
                update orama core and add data source
              
              
                aileenvl 43d8cac
              
                fixes css
              
              
                aileenvl ec1c340
              
                Revert "fixes css"
              
              
                aileenvl f1d7ac0
              
                Add .env to gitignore to prevent accidental commits
              
              
                aileenvl 3a209c7
              
                Merge remote-tracking branch 'upstream/main'
              
              
                g-francesca d4e0f12
              
                chore: update @orama/ui version
              
              
                g-francesca 43fc70e
              
                style: review modal style
              
              
                g-francesca 053ee98
              
                style: review search results style
              
              
                g-francesca dc2fbba
              
                fix: arrow navigation and focus style
              
              
                g-francesca 8fe9b47
              
                feat: open modal via CMD+k
              
              
                g-francesca 55500e8
              
                fix: SlidingPanel classes
              
              
                g-francesca bf19060
              
                fix: chat scroll behaviour
              
              
                g-francesca 91509d2
              
                refactor: chat interface
              
              
                g-francesca 76dfd16
              
                fix: sources style not applied
              
              
                g-francesca fafbd2b
              
                fix: style of chat panel in light mode
              
              
                g-francesca e6e5779
              
                style: fix sources and scroll to bottom style
              
              
                g-francesca 33c7e7e
              
                fix: collapse source text link
              
              
                g-francesca 59e3513
              
                style: add chat loading animation
              
              
                g-francesca e1acf25
              
                style: mobile toggle search/chat
              
              
                g-francesca 41d8a78
              
                fix: toggle animation
              
              
                g-francesca 4a3de89
              
                refactor: search modal layout composition
              
              
                g-francesca 5ce485e
              
                refactor: search footer and chat actions
              
              
                g-francesca a82d0f7
              
                fix: chat scrollbar style
              
              
                g-francesca ec17ab7
              
                Merge branch 'nodejs:main' into main
              
              
                g-francesca 72faa73
              
                style: mobile fixes for chat panel
              
              
                g-francesca 1fdda0e
              
                fix: markdown style
              
              
                g-francesca 962df65
              
                chore: update env var name
              
              
                g-francesca 73cc27b
              
                fix: chat scrollbar style
              
              
                g-francesca 5661437
              
                Merge branch 'nodejs:main' into main
              
              
                g-francesca 61451b0
              
                chore: update @orama/ui version
              
              
                g-francesca 73140c6
              
                style: fix mobile scrollbar style
              
              
                g-francesca 93ed85b
              
                chore: update @orama/ui to 1.2.0
              
              
                g-francesca 9490cf0
              
                feat: improve search loading
              
              
                g-francesca d1b3b8b
              
                fix: remove default public orama key
              
              
                g-francesca 668b475
              
                Merge branch 'main' into review-orama-searchbox
              
              
                g-francesca 15b51b6
              
                fix: use tailwind utility classes
              
              
                g-francesca b9e45be
              
                style: review searchbar scrollbar style
              
              
                g-francesca 259017e
              
                fix: minor syntax improvements
              
              
                g-francesca e56a289
              
                fix: use translated label
              
              
                g-francesca 3c78cb0
              
                fix: document type
              
              
                g-francesca 808383f
              
                fix: use translated labels for suggestions
              
              
                g-francesca 09875a1
              
                fix: gitignore comment
              
              
                g-francesca 8ecfd75
              
                style: add motion-safe variant
              
              
                g-francesca 6805449
              
                style: use size class
              
              
                g-francesca a0e121c
              
                fix: separate type imports
              
              
                g-francesca 0e28da9
              
                style: use vertcal tw classes
              
              
                g-francesca c95a223
              
                style: minor style fixes
              
              
                g-francesca 760b468
              
                fix: color contrast
              
              
                g-francesca 9d131c3
              
                fix: modal search focus trap
              
              
                g-francesca 4836c80
              
                style: fix color contrast
              
              
                g-francesca 950d7ad
              
                fix: disable search button when no env vars
              
              
                g-francesca 6c23e1c
              
                fix: ssr searchbox
              
              
                g-francesca 8667e5c
              
                fix: clean up code
              
              
                g-francesca 347abf6
              
                fix: import get documents
              
              
                g-francesca 7f252e0
              
                fix: playwright tests for search
              
              
                g-francesca 6182176
              
                fix: get documents
              
              
                g-francesca af1e659
              
                fix: search results element targeted for test
              
              
                g-francesca 57579d1
              
                Merge remote-tracking branch 'upstream/main'
              
              
                g-francesca 75784a7
              
                Merge branch 'main' into review-orama-searchbox
              
              
                g-francesca 7492efa
              
                fix: update workflow with the new vars
              
              
                g-francesca 974e5b8
              
                Merge remote-tracking branch 'upstream/main'
              
              
                g-francesca 247e240
              
                Merge branch 'main' into review-orama-searchbox
              
              
                g-francesca 6e29a35
              
                fix: remove querySelectorAll
              
              
                g-francesca ba531b9
              
                fix: cleanup sliding panel props
              
              
                g-francesca 37f36fb
              
                refactor: move orama instance to provider
              
              
                g-francesca 89601f8
              
                refactor: manage orama searchbox state via reducer
              
              
                g-francesca fa5d521
              
                fix: orama git workflow step
              
              
                g-francesca c1ba121
              
                refactor: clean up Search component and add searchbox provider
              
              
                g-francesca 15a8e1d
              
                Merge remote-tracking branch 'upstream/main'
              
              
                g-francesca 9d3e982
              
                Merge branch 'main' into review-orama-searchbox
              
              
                g-francesca 1d7016a
              
                Merge remote-tracking branch 'upstream/main'
              
              
                g-francesca 17b9e26
              
                Merge branch 'main' into review-orama-searchbox
              
              
                g-francesca 0299d36
              
                fix: remove orama tests
              
              
                g-francesca fd57021
              
                Merge remote-tracking branch 'upstream/main'
              
              
                g-francesca 49c409e
              
                Merge branch 'main' into review-orama-searchbox
              
              
                g-francesca ab6a1a1
              
                chore: update @orama/core
              
              
                g-francesca 46f2124
              
                refactor: minor fixes and clean up
              
              
                g-francesca File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  
        
          
  
    
      
          
            44 changes: 44 additions & 0 deletions
          
          44 
        
  apps/site/components/Common/Searchbox/ChatActions/index.module.css
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| @reference "../../../../styles/index.css"; | ||
|  | ||
| .chatActionsContainer { | ||
| @apply flex | ||
| items-center | ||
| justify-end; | ||
| } | ||
|  | ||
| .chatActionsList { | ||
| @apply flex | ||
| list-none | ||
| items-center | ||
| gap-2 | ||
| p-0; | ||
| } | ||
|  | ||
| .chatAction { | ||
| @apply cursor-pointer | ||
| rounded-full | ||
| p-2 | ||
| text-neutral-800 | ||
| duration-300 | ||
| hover:bg-neutral-300 | ||
| focus:bg-neutral-300 | ||
| focus:outline-none | ||
| motion-safe:transition-colors | ||
| dark:text-neutral-400 | ||
| dark:hover:bg-neutral-900 | ||
| dark:focus:bg-neutral-900; | ||
|  | ||
| svg { | ||
| @apply size-4; | ||
| } | ||
| } | ||
|  | ||
| .chatActionIconSelected { | ||
| @apply text-green-600 | ||
| dark:text-green-400; | ||
| } | ||
|  | ||
| .chatActionDisaliked { | ||
| @apply text-neutral-900 | ||
| dark:text-neutral-800; | ||
| } | 
        
          
  
    
      
          
            70 changes: 70 additions & 0 deletions
          
          70 
        
  apps/site/components/Common/Searchbox/ChatActions/index.tsx
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| 'use client'; | ||
|  | ||
| import { | ||
| DocumentCheckIcon, | ||
| ClipboardIcon, | ||
| ArrowPathIcon, | ||
| HandThumbDownIcon, | ||
| } from '@heroicons/react/24/solid'; | ||
| import type { Interaction } from '@orama/core'; | ||
| import { ChatInteractions } from '@orama/ui/components'; | ||
| import classNames from 'classnames'; | ||
| import type { FC } from 'react'; | ||
| import { useState } from 'react'; | ||
|  | ||
| import styles from './index.module.css'; | ||
|  | ||
| type ChatActionsProps = { | ||
| interaction: Interaction; | ||
| }; | ||
|  | ||
| export const ChatActions: FC<ChatActionsProps> = ({ interaction }) => { | ||
|         
                  avivkeller marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| const [isDisliked, setIsDisliked] = useState(false); | ||
|  | ||
| const dislikeMessage = () => setIsDisliked(!isDisliked); | ||
|  | ||
| if (!interaction.response) { | ||
| return null; | ||
| } | ||
|  | ||
| return ( | ||
| <div className={styles.chatActionsContainer}> | ||
| <ul className={styles.chatActionsList}> | ||
| <li> | ||
| <ChatInteractions.RegenerateLatest | ||
| className={styles.chatAction} | ||
| interaction={interaction} | ||
| > | ||
| <ArrowPathIcon /> | ||
| </ChatInteractions.RegenerateLatest> | ||
| </li> | ||
| <li> | ||
| <ChatInteractions.CopyMessage | ||
| className={styles.chatAction} | ||
| interaction={interaction} | ||
| > | ||
| {(copied: boolean) => | ||
| copied ? ( | ||
| <DocumentCheckIcon className={styles.chatActionIconSelected} /> | ||
| ) : ( | ||
| <ClipboardIcon /> | ||
| ) | ||
| } | ||
| </ChatInteractions.CopyMessage> | ||
| </li> | ||
| {!interaction.loading && ( | ||
| <li> | ||
| <button | ||
| className={classNames(styles.chatAction, { | ||
| [styles.chatActionDisaliked]: isDisliked, | ||
| })} | ||
| onClick={dislikeMessage} | ||
| > | ||
| <HandThumbDownIcon /> | ||
| </button> | ||
| </li> | ||
| )} | ||
| </ul> | ||
| </div> | ||
| ); | ||
| }; | ||
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.