Files
supabase/apps/studio/components
Monica Khoury 12440e62a9 feat(studio): add Test badge to webhook deliveries for test events (#52510)
## Problem

Test deliveries in the webhook deliveries table look the same as real
ones. Test events are sent with `is_test: true` in the event payload,
but the UI doesn't surface it, so there's no way to tell them apart at a
glance.

Closes FE-4710.

## Solution

- Added an `isTestDelivery` helper that checks `eventPayload.is_test ===
true`. It uses a strict comparison, so values like the string `"true"`
don't count.
- Show a green "Test" badge next to the event name in the deliveries
table.
- Show the same badge in the header of the delivery details sheet, next
to the status badge.
- Added unit tests for the helper and component tests for the table and
the sheet, each covering a test delivery and a real one.

## Review instructions

1. Open a project's webhooks page and select an endpoint.
2. Click the button to send a test event and wait for its delivery to
appear in the Deliveries table.
3. Check that the new row has a green "Test" badge next to its event
name, and that existing rows without it have no badge.
4. Click the test row and check that the delivery details sheet shows
the "Test" badge next to the status badge in the header.
5. Click a non-test row and check that its sheet has no "Test" badge.
2026-11-05 15:58:56 +02:00
..

Writing components

Where to create your components

  • For components that declare the general structure and layout of a page:
    • /components/layouts/xxx
  • For components that are tightly coupled to a specific interface:
    • /components/interfaces/xxx
  • For components that are meant to be reusable across multiple pages:
    • /components/ui/xxx
  • Note: We're gradually moving files out of the to-be-cleaned folder into the respective folders as we refactor

Component structure

  • If a component has constants and utility methods that are tightly coupled to itself, keep them close to the component and enclose them in a folder with an index.tsx as an entry point
  • Otherwise it can just be a file on its own
  • For example:
    • components/ui
      - SampleComponentA
        - SampleComponentA.tsx
        - SampleComponentA.constants.ts
        - SampleComponentA.utils.ts
        - SampleComponentA.types.ts
        - index.ts
      - SampleComponentB.tsx
      

Template for building components


// Declare the prop types of your component
interface ComponentAProps {
  sampleProp: string
}

// Name your component accordingly — use a named export, not a default export
export const ComponentA = ({ sampleProp }: ComponentAProps) => {
  return <div>ComponentA: {sampleProp}</div>
}