Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

add close button to assistant (#31029)

Saxon Fletchera6433bc310b1
diff --git a/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx b/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
index 6ed7ca0a9d7..e8e00f70abe 100644
--- a/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
+++ b/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
@@ -1,7 +1,7 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { AnimatePresence, motion } from 'framer-motion'
import { last } from 'lodash'
-import { FileText, Info } from 'lucide-react'
+import { FileText, Info, X } from 'lucide-react'
import { memo, useEffect, useMemo, useRef, useState } from 'react'
import { toast } from 'sonner'
@@ -201,6 +201,10 @@ export const AIAssistant = ({
}
}
+ const closeAssistant = () => {
+ setAiAssistantPanel({ open: false })
+ }
+
const confirmOptInToShareSchemaData = async () => {
if (!canUpdateOrganization) {
return toast.error('You do not have the required permissions to update this organization')
@@ -328,12 +332,14 @@ export const AIAssistant = ({
: 'Project metadata is not being shared. Opt in to improve Assistant responses.'}
</TooltipContent_Shadcn_>
</Tooltip_Shadcn_>
-
- {(hasMessages || suggestions || sqlSnippets) && (
- <Button type="default" disabled={isChatLoading} onClick={onResetConversation}>
- Reset
- </Button>
- )}
+ <div className="flex gap-2">
+ {(hasMessages || suggestions || sqlSnippets) && (
+ <Button type="default" disabled={isChatLoading} onClick={onResetConversation}>
+ Reset
+ </Button>
+ )}
+ <Button type="default" className="w-7" onClick={closeAssistant} icon={<X />} />
+ </div>
</div>
</div>
{!includeSchemaMetadata && selectedOrganization && (