## Problem
The deliveries table loaded one page from the API and split it into
pages of 5 in the browser, so older deliveries could not be reached.
Linear:
[FE-3750](https://linear.app/supabase/issue/FE-3750/add-pagination-to-platform-webhooks-deliveries-table)
## Solution
- **Cursor pagination:** the table requests deliveries 5 at a time
(`page[after]`), and Next and Previous load the next or previous page.
It asks for 6 and shows 5, so Next is never enabled on an empty page.
Previous uses the history of cursors we visited, because the API's
`prev` link can skip a row or land on an empty page.
- The footer reads "Showing N deliveries" (the API returns no total).
The delivery search still filters only the loaded page.
- **Loading and errors:** skeleton rows show while a page loads, and a
failed load shows an error with a Try again button instead of "No
deliveries found", and polling stops until you retry. If a later refresh
fails, the loaded rows stay with a notice that they may be out of date,
and polling continues.
- Retry and Send test event refresh every cached page of the endpoint's
deliveries. Switching endpoints starts again on page 1.
- Retry from the details sheet now works for a delivery that is not on
the current page.
- A pending delivery has no result yet, so its row no longer opens the
details sheet. Its Retry button is unchanged.
- Removed the "Attempt" field from the details sheet. It was the row's
position on the page, not an attempt number. A real one needs the API to
return it (CTRL-1974).
## Review instructions
1. Enable the Platform Webhooks feature preview, open an endpoint, and
send 7 test events (limited to 10 per minute).
2. Page 1 shows 5 deliveries, Previous is disabled and Next is enabled.
Next shows the other 2 and disables Next. Previous goes back to the
first 5.
3. On an endpoint with exactly 5 deliveries, both buttons are disabled.
4. In DevTools > Network, set throttling to "Slow 4G" and click Next.
Skeleton rows show. Then block the `deliveries` request and click Next.
"Failed to retrieve deliveries" shows with a Try again button. Wait 10
seconds: no new `deliveries` requests are sent. Unblock the request and
click Try again to load the rows. Also block the request while rows are
loaded: they stay, and an "Unable to refresh deliveries" notice appears
within about 5 seconds and clears once you unblock.
5. Open the details sheet from the bottom row of page 1. In a second
tab, send a test event and wait about 5 seconds. Click Retry delivery in
the first tab. A toast and a `POST .../retry` request appear, even
though the row has moved off page 1.
6. Set the endpoint URL to `https://httpbin.org/delay/10` and send a
test event. While the new row shows `pending` (about 10 seconds),
clicking it does nothing. Once it shows `success`, it opens the sheet.
## What
Wires the existing (mocked) Platform Webhooks UI to the real Management
API backend, per FE-3749.
- New `data/platform-webhooks/` query/mutation hooks, calling the real
`/v2/organizations/{slug}/webhooks/...` and
`/v2/projects/{ref}/webhooks/...` endpoints
- Updated `PlatformWebhooks.types.ts` to match the real API contract
(field names, shapes)
- Added a signing secret field to the create-endpoint form (API requires
a user-provided secret, not server-generated like the mock assumed)
- Removed the event-type column from the deliveries table (the real
list-deliveries endpoint doesn't return event type, only the
single-delivery endpoint does)
- Removed `PlatformWebhooks.mock.ts` / `.store.ts` and their tests
## Why
UI was built ~80% against mock data months ago; this closes the gap to a
real, working feature.
## Known open items (not blocking, tracked separately)
- `name` field has no backend storage yet — client-only for now, open
question with Ali/Paweł
- Deliveries table only fetches the backend's default single page — real
server-side pagination not yet wired (see FE-3750)
## Follow-up PR (stacked)
Tests for the new `data/platform-webhooks/` hooks (MSW-based), per the
ticket's own scope split.
## Testing
Manually tested end-to-end against local backend: created/edited/deleted
an endpoint, verified the real signature using webhook.site,
independently recomputed the HMAC and confirmed it matches the
`webhook-signature` header.
Linear: FE-3749
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>