-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: add autocomplete suggestions feature in search page #1030
feat: add autocomplete suggestions feature in search page #1030
Conversation
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 @Yash-1511 , thanks for the useful PR. I've left some comments, feel free to ask any clarifications if required. Looking forward to get this PR in soon!
Hey @debanjum , I have made changes according to your review. Changes Made
Technical Implementation
ExamplesNow supports queries like:
Testing
Performance Impact
Related IssuesCloses #1024 |
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.
Hey @Yash-1511, I played around with your updates, changes look good! I just left one comment to improve the file filter dropdown
value={searchQuery} | ||
/> | ||
{showSuggestions && fileSuggestions.length > 0 && ( | ||
<div className="absolute z-10 w-full mt-1 bg-background border rounded-md shadow-lg"> |
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 options dropdown expands to the right edge of the screen, which feels a bit too wide in my opinion.
Maybe we can use the same Command
and Popover
dropdown UI components here? You can check how the slash commands uses them in chatInputArea.tsx
.
khoj/src/interface/web/app/components/chatInputArea/chatInputArea.tsx
Lines 497 to 501 in 8fe08ee
{showCommandList && ( | |
<div className="flex justify-center text-center"> | |
<Popover open={showCommandList} onOpenChange={setShowCommandList}> | |
<PopoverTrigger className="flex justify-center text-center"></PopoverTrigger> | |
<PopoverContent |
If that is too annoying to use, it may still be a good idea to restrict width of the file filter dropdown to not expand to the right edge of the screen.
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 wasn't able to reproduce the bug you're mentioning. In my view, the suggestions are only as wide as the input box. Let's sync up about it separately.
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.
Thanks for this, @Yash-1511 ! Definitely makes the search process easier for larger knowledge bases. I'll merge it, and we can handle any UI improvements on our end.
value={searchQuery} | ||
/> | ||
{showSuggestions && fileSuggestions.length > 0 && ( | ||
<div className="absolute z-10 w-full mt-1 bg-background border rounded-md shadow-lg"> |
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 wasn't able to reproduce the bug you're mentioning. In my view, the suggestions are only as wide as the input box. Let's sync up about it separately.
File Path Autocompletion in Search
Closes #1024
Description
Added file path autocompletion to enhance the search experience in Khoj. Users can now easily search for specific files by typing "file:" followed by the file name, with real-time suggestions appearing as they type.
Changes
Features
Screenshots
[Add screenshots showing the file path autocompletion in action]
Testing
Dependencies
No new dependencies were added.
Notes