-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: add chat search implementation #857
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
@tobiasbueschel is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
return { | ||
id: result.id, | ||
title: result.title || "Untitled", | ||
// TODO: Strip any markdown formatting from the preview |
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.
We could use something like https://www.npmjs.com/package/remove-markdown or switch react-markdown entirely to use a unified pipeline across the app and then have some custom handler to strip out any formatting (the latter would give more flexibility for other features too).
0256d78
to
2fa9291
Compare
package.json
Outdated
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.
FYI - I ran pnpm lint:fix
and pnpm format
to ensure the new code is compliant to all linting and formatting rules and noticed there were a lot of unrelated changes. This is due to the fact that the codebase currently doesn't correctly enforce these rules on new PRs and code that gets merged.
Perhaps it is worth to tackle this in a separate PR and enable biome ci
to run in a GitHub Action instead of the current biome lint
as described here:
- https://biomejs.dev/recipes/continuous-integration/#github-actions
- https://github.com/vercel/ai-chatbot/blob/main/.github/workflows/lint.yml#L25C12-L25C21
This would ensure that all future code is following the same format & linting rules!
This is pretty cool +1 |
# Conflicts: # lib/utils.ts
@@ -38,13 +38,6 @@ export const fetcher = async (url: string) => { | |||
return res.json(); | |||
}; | |||
|
|||
export function getLocalStorage(key: string) { |
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.
FYI - this wasn't used anymore, hence, I've removed it!
Also, as ai-chatbot uses usehooks-ts
as a dependency, we could use its local storage hook instead if we need it again in the future: https://usehooks-ts.com/react-hook/use-local-storage
@@ -53,98 +46,17 @@ export function generateUUID(): string { | |||
}); | |||
} | |||
|
|||
function addToolMessageToChat({ |
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.
FYI - with the recent update on the main
branch, the addToolMessageToChat
and sanitizeResponseMessages
functions are no longer used.
Hence, I've removed it, but @jeremyphilemon let me know if you plan on using this for something else in the future and I'll add it back in if needed.
Thanks
Hi @jeremyphilemon 👋 happy Tuesday - I've fixed up any recent merge conflicts. Let me know if there's any other change you'd like me to make? Thanks! |
This PR implements the ability to search chats, inspired by how it works in the ChatGPT user interface.
CMD
+K
orCTRL
+K
to open search dialog depending on the operating system usedsearch.mov
Potential future improvements:
chat-search.tsx
component to thetests/
folder?)artifact:sheet
orartifact:text
visibility:public
@jeremyphilemon & @jaredpalmer: please let me know what else you'd like me to add / change in this PR 🙏