From 10e9cdd1f4db0bcf5b797fd7ec79e6b3cd0a9bac Mon Sep 17 00:00:00 2001 From: Danny White <3104761+dnywh@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:29:23 +1100 Subject: [PATCH] chore(studio): webhooks UI cleanup (#43797) ## What kind of change does this PR introduce? UI updates to platform webhooks. ## What is the new behavior? - `Webhooks` icon on empty state - Better text wrapping/overflow handling on table - Clearer endpoint deletion dialog | After | | --- | | Webhooks Toolshed
Supabase-A3AF1CE1-B489-450F-9FD7-AE1B1BC0C999 | | Webhooks Toolshed
Supabase-00EF8F02-A3F2-477C-ADDB-68996D6C16E3 | | Webhooks Toolshed
Supabase-902AC0EC-D0D2-471A-B241-C90FA8F50883 | --- .../Webhooks/PlatformWebhooks.mock.ts | 2 +- .../Webhooks/PlatformWebhooksEndpointList.tsx | 13 ++++++--- .../Webhooks/PlatformWebhooksHeader.tsx | 13 +-------- .../Webhooks/PlatformWebhooksPage.tsx | 28 ++++++++++++------- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts index e08791bbef6..06cea016399 100644 --- a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts +++ b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooks.mock.ts @@ -30,7 +30,7 @@ export const PLATFORM_WEBHOOKS_MOCK_DATA: Record

Endpoints

+
onSearchChange(event.target.value)} /> + @@ -109,6 +111,7 @@ export const PlatformWebhooksEndpointList = ({ {filteredEndpoints.length === 0 ? ( @@ -171,15 +174,17 @@ export const PlatformWebhooksEndpointList = ({

{displayName}

{hasName && ( -

{endpoint.url}

+

+ {endpoint.url} +

)}
{formatEventCount(endpoint.eventTypes)} - + -

+

by {endpoint.createdBy}

diff --git a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksHeader.tsx b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksHeader.tsx index 1e1d08101d9..30acfbc864b 100644 --- a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksHeader.tsx +++ b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksHeader.tsx @@ -74,18 +74,7 @@ export const PlatformWebhooksHeader = ({ {headerDescription} - {hasSelectedEndpoint ? ( - endpointActions - ) : ( - <> - - - - )} + {hasSelectedEndpoint ? endpointActions : } diff --git a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksPage.tsx b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksPage.tsx index 513f2340c7c..388cfe7f814 100644 --- a/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksPage.tsx +++ b/apps/studio/components/interfaces/Platform/Webhooks/PlatformWebhooksPage.tsx @@ -128,9 +128,18 @@ export const PlatformWebhooksPage = ({ scope, endpointId }: PlatformWebhooksPage () => endpoints.find((endpoint) => endpoint.id === endpointIdPendingDelete) ?? null, [endpoints, endpointIdPendingDelete] ) + const endpointPendingDeleteHasName = endpointPendingDelete + ? endpointPendingDelete.name.trim().length > 0 + : false const endpointPendingDeleteDisplayName = endpointPendingDelete ? getWebhookEndpointDisplayName(endpointPendingDelete) : '' + let deleteEndpointDescription = 'This action cannot be undone.' + if (endpointPendingDelete) { + deleteEndpointDescription = endpointPendingDeleteHasName + ? `Deleting “${endpointPendingDeleteDisplayName}” stops all deliveries to the URL below. This can’t be undone.` + : 'Deleting this endpoint stops all deliveries to the URL below. This can’t be undone.' + } useEffect(() => { if (!platformWebhooksEnabled) { @@ -233,7 +242,7 @@ export const PlatformWebhooksPage = ({ scope, endpointId }: PlatformWebhooksPage setDeliverySearch('') } setEndpointIdPendingDelete(null) - toast.success(`Deleted endpoint "${endpointPendingDeleteDisplayName}"`) + toast.success('Endpoint deleted') } const handleUpsertEndpoint = (values: EndpointFormValues) => { @@ -333,14 +342,14 @@ export const PlatformWebhooksPage = ({ scope, endpointId }: PlatformWebhooksPage className="gap-x-2" onClick={() => setShowRegenerateSecretConfirm(true)} > - + Regenerate secret setEndpointIdPendingDelete(selectedEndpoint.id)} > - + Delete endpoint @@ -420,14 +429,13 @@ export const PlatformWebhooksPage = ({ scope, endpointId }: PlatformWebhooksPage Delete endpoint - - {endpointPendingDelete - ? endpointPendingDelete.name.trim().length > 0 - ? `This will delete endpoint "${endpointPendingDeleteDisplayName}" with URL ${endpointPendingDelete.url}. This action cannot be undone.` - : `This will delete endpoint ${endpointPendingDelete.url}. This action cannot be undone.` - : 'This action cannot be undone.'} - + {deleteEndpointDescription} + {endpointPendingDelete && ( +
+              {endpointPendingDelete.url}
+            
+ )} Cancel