The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix(studio): keep edit secret sheet footer visible with long values (#52014)
supabase-vercel-tedd[bot]601c091d8f99
diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.test.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.test.tsxindex 7e6d0eaafc4..47bd82c96cb 100644--- a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.test.tsx+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.test.tsx@@ -30,6 +30,21 @@ describe('EditSecretSheet', () => {await waitFor(() => expect(save).toBeEnabled())})+ test('enables Save for a long multi-line value', async () => {+ renderSheet()++ const save = await screen.findByRole('button', { name: 'Save' })+ const longValue = Array.from({ length: 200 }, (_, i) => `line-${i}-${'x'.repeat(60)}`).join(+ '\n'+ )++ await userEvent.click(screen.getByPlaceholderText('my-secret-value'))+ await userEvent.paste(longValue)++ expect(screen.getByPlaceholderText('my-secret-value')).toHaveValue(longValue)+ await waitFor(() => expect(save).toBeEnabled())+ })+test('posts the secret and closes on success', async () => {const requests: Array<{ ref: string | undefined; body: unknown }> = []addAPIMock({diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.tsxindex 5f5bccf58bb..299f542c640 100644--- a/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.tsx+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionSecrets/EditSecretSheet.tsx@@ -7,6 +7,7 @@ import { useLatest } from 'react-use'import { toast } from 'sonner'import {Button,+ ExpandingTextArea,Form,FormControl,FormField,@@ -17,7 +18,6 @@ import {SheetHeader,SheetSection,SheetTitle,- Textarea,} from 'ui'import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'import z from 'zod'@@ -85,7 +85,7 @@ export function EditSecretSheet({ secret, visible, onClose }: EditSecretSheetPro<SheetTitle>Edit secret</SheetTitle></SheetHeader>- <SheetSection className="h-full">+ <SheetSection className="grow min-h-0 overflow-y-auto"><Form {...form}><formid={FORM_ID}@@ -118,37 +118,24 @@ export function EditSecretSheet({ secret, visible, onClose }: EditSecretSheetPro><FormControl><div className="relative">- <Textarea+ <ExpandingTextArea{...field}- rows={1}- ref={(el) => {- field.ref(el)- if (el) {- el.style.height = 'auto'- el.style.height = Math.max(40, el.scrollHeight) + 'px'- }- }}+ value={field.value ?? ''}placeholder="my-secret-value"data-1p-ignoredata-lpignore="true"data-form-type="other"data-bwignore- className="min-h-0 resize-none"+ className="font-mono max-h-[320px] overflow-y-auto pr-10"style={{WebkitTextSecurity: showSecretValue ? undefined : 'disc',} as React.CSSProperties}- onChange={(e) => {- field.onChange(e)- e.currentTarget.style.height = 'auto'- e.currentTarget.style.height =- Math.max(40, e.currentTarget.scrollHeight) + 'px'- }}/><Buttonvariant="text"- className="absolute right-1 top-1 px-1"+ className="absolute right-3 top-2 px-1"icon={showSecretValue ? <EyeOffIcon /> : <EyeIcon />}onClick={() => setShowSecretValue(!showSecretValue)}/>