Files
supabase/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectPanel.tsx
Danny White 36e8bda235 fix(studio): align deletion panels (#53190)
## Problem

Account, project and organisation deletion settings use different
warning layouts and action placement. In the organisation panel, the
button sits inside the admonition description, so it stays below the
copy at wide widths.

## Solution

```text
Delete account / project / organisation
└─ Danger admonition
   ├─ Consequence and supporting copy
   └─ Action below the copy at narrow widths, beside it at wide widths
```

Standardise the affected settings section descriptions and preserve the
Vercel Marketplace action for partner-managed organisations. The account
confirmation flow is reviewed separately in #52350. Both PRs target
`master`.

| Before | After |
| --- | --- |
| <img width="1458" height="484" alt="CleanShot 2026-11-10 at 14 15
06@2x"
src="https://github.com/user-attachments/assets/2e7e627d-5079-464c-b7ef-51b93ca62e9a"
/> | <img width="1450" height="410" alt="CleanShot 2026-11-10 at 14 13
15@2x"
src="https://github.com/user-attachments/assets/88cdcd4a-463c-47be-9c95-3eab172bed29"
/> |
| <img width="1462" height="430" alt="CleanShot 2026-11-10 at 14 14
51@2x"
src="https://github.com/user-attachments/assets/84109e7e-2e42-4252-9f1b-9760ded1f2e7"
/> | <img width="1452" height="392" alt="CleanShot 2026-11-10 at 14 13
37@2x"
src="https://github.com/user-attachments/assets/d2238d64-5a32-456f-addc-6fd3ce1de1fe"
/> |
| <img width="1868" height="394" alt="CleanShot 2026-11-10 at 14 15
22@2x"
src="https://github.com/user-attachments/assets/a2ab7a9d-2d79-46fc-b600-ace07e098e55"
/> | <img width="1872" height="412" alt="CleanShot 2026-11-10 at 13 26
40@2x"
src="https://github.com/user-attachments/assets/fad70041-d0ea-4da6-b429-2b2fc39d2103"
/> |

## Review instructions

1. Open the deletion sections in **Account preferences**, a project's
**Settings → General** and an organisation's **General settings**.
2. At narrow and wide widths, check that the buttons sit below and
beside the copy respectively.
3. For a Vercel-managed organisation, check that the panel still directs
users to Vercel Marketplace.
4. In project and branch general settings, check the updated punctuation
in the affected section descriptions.
2026-11-11 09:41:12 +11:00

53 lines
1.8 KiB
TypeScript

import { Admonition } from 'ui-patterns/Admonition'
import {
PageSection,
PageSectionContent,
PageSectionDescription,
PageSectionMeta,
PageSectionSummary,
PageSectionTitle,
} from 'ui-patterns/PageSection'
import { DeleteProjectButton } from './DeleteProjectButton'
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
export const DeleteProjectPanel = () => {
const { data: project } = useSelectedProjectQuery()
const { data: selectedOrganization } = useSelectedOrganizationQuery()
if (project === undefined) return null
const title =
selectedOrganization?.managed_by === 'vercel-marketplace'
? 'Deleting this project will also remove your database and uninstall the resource on Vercel'
: 'Deleting this project will also remove your database'
const description =
selectedOrganization?.managed_by === 'vercel-marketplace'
? 'Make sure you have made a backup if you want to keep your data, and that no Vercel project is connected to this resource.'
: 'Make sure you have made a backup if you want to keep your data.'
return (
<PageSection id="delete-project">
<PageSectionMeta>
<PageSectionSummary>
<PageSectionTitle>Delete project</PageSectionTitle>
<PageSectionDescription>
Permanently remove your project and its database.
</PageSectionDescription>
</PageSectionSummary>
</PageSectionMeta>
<PageSectionContent>
<Admonition
type="danger"
title={title}
description={description}
actions={<DeleteProjectButton />}
layout="responsive"
/>
</PageSectionContent>
</PageSection>
)
}