-
Notifications
You must be signed in to change notification settings - Fork 66
Add public shareable chats #130
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 Git ↗︎
|
Signed-off-by: Alexis Rico <sferadev@gmail.com>
Signed-off-by: Alexis Rico <sferadev@gmail.com>
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 adds public shareable chats by introducing a new visibility property for chats and updating related middleware, database access, and UI components. Key changes include:
- Updating the middleware matcher to allow shareable chats.
- Adding a new "visibility" column, anonymous user role, and associated policy for public chats.
- Enhancing UI components to include visibility control and share functionality.
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
apps/dbagent/src/middleware.ts | Updated matcher to include a public share route. |
apps/dbagent/src/lib/monitoring/scheduler.ts | Fixed missing await for getAdminAccess. |
apps/dbagent/src/lib/db/schema.ts | Added visibility column and anonymous user role with corresponding policy. |
apps/dbagent/src/lib/db/db.ts | Introduced anonymous DB access and made admin access async. |
apps/dbagent/src/lib/db/chats.ts | Adjusted saveChat function signature to support the new visibility property. |
apps/dbagent/src/components/ui/side-nav.tsx | Added share functionality with new icons and toast notifications. |
apps/dbagent/src/components/chat/visibility-selector.tsx | Introduced a VisibilitySelector component for managing chat visibility. |
apps/dbagent/src/components/chat/header.tsx | Updated header to include VisibilitySelector and refactored navigation. |
apps/dbagent/src/components/chat/chat.tsx | Updated Chat component to pass project & chat IDs and added ReadOnlyChat. |
apps/dbagent/src/app/api/chat/route.ts | Modified PATCH handler to validate and persist title and visibility changes. |
apps/dbagent/src/app/(main)/share/[chat]/page.tsx | Added a new page for displaying public, read-only chats. |
Files not reviewed (2)
- apps/dbagent/migrations/0008_public-chats.sql: Language not supported
- apps/dbagent/migrations/meta/_journal.json: Language not supported
); | ||
}); | ||
|
||
export function ReadOnlyChat({ messages }: { messages: Array<UIMessage> }) { |
Copilot
AI
Apr 22, 2025
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 unimplemented functions for setMessages and reload in ReadOnlyChat throw errors, which might lead to runtime issues if accidentally invoked. Consider providing safe no-op implementations or ensuring these callbacks are never triggered in read-only mode.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.