Skip to content

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

move create edge function via assistant (#34777)

Saxon Fletcher5a6b4b497366
diff --git a/apps/studio/pages/project/[ref]/functions/index.tsx b/apps/studio/pages/project/[ref]/functions/index.tsx
index 4d7c4dbe337..5c71c8697ab 100644
--- a/apps/studio/pages/project/[ref]/functions/index.tsx
+++ b/apps/studio/pages/project/[ref]/functions/index.tsx
@@ -103,6 +103,36 @@ const EdgeFunctionsPage: NextPageWithLayout = () => {
</DialogSection>
</DialogContent>
</Dialog>
+ <DropdownMenuItem
+ className="gap-4"
+ onSelect={() => {
+ snap.newChat({
+ name: 'Create new edge function',
+ open: true,
+ initialInput: `Create a new edge function that ...`,
+ suggestions: {
+ title:
+ 'I can help you create a new edge function. Here are a few example prompts to get you started:',
+ prompts: [
+ 'Create a new edge function that processes payments with Stripe',
+ 'Create a new edge function that sends emails with Resend',
+ 'Create a new edge function that generates PDFs from HTML templates',
+ ],
+ },
+ })
+ sendEvent({
+ action: 'edge_function_ai_assistant_button_clicked',
+ properties: { origin: 'secondary_action' },
+ groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' },
+ })
+ }}
+ >
+ <AiIconAnimation className="shrink-0" size={16} />
+ <div>
+ <span className="text-foreground">Via AI Assistant</span>
+ <p>Let the Assistant write and deploy for you</p>
+ </div>
+ </DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
)
@@ -118,39 +148,6 @@ const EdgeFunctionsPage: NextPageWithLayout = () => {
Examples
</a>
</Button>,
- <ButtonTooltip
- key="edge-function-create"
- type="default"
- className="px-1 pointer-events-auto"
- icon={<AiIconAnimation size={16} />}
- onClick={() => {
- snap.newChat({
- name: 'Create new edge function',
- open: true,
- initialInput: `Create a new edge function that ...`,
- suggestions: {
- title:
- 'I can help you create a new edge function. Here are a few example prompts to get you started:',
- prompts: [
- 'Create a new edge function that processes payments with Stripe',
- 'Create a new edge function that sends emails with Resend',
- 'Create a new edge function that generates PDFs from HTML templates',
- ],
- },
- })
- sendEvent({
- action: 'edge_function_ai_assistant_button_clicked',
- properties: { origin: 'secondary_action' },
- groups: { project: ref ?? 'Unknown', organization: org?.slug ?? 'Unknown' },
- })
- }}
- tooltip={{
- content: {
- side: 'bottom',
- text: 'Create with Supabase Assistant',
- },
- }}
- />,
]
return (