---
id: w1/m11.5/t004
title: Delete (per-row kebab menu) + platform subdomain display section
worker: worker1
status: done
estimate: 30m
depends_on: [w1/m11.5/t003]
---

## Objective

Two sub-tasks that complete the Custom Domains section:

1. **Per-row kebab "Menu" button** with a "Delete" action → `AlertDialog` confirmation
   → `deleteCustomDomain` mutation → row removed.
2. **Platform Subdomain section** below the table: always-on `.onbex.co` subdomain
   display, analogous to Render's "Render Subdomain" toggle (which bex doesn't need
   to toggle — it's always enabled).

## Context

- **Render capture (2026-07-09):** each domain row has a `Button "Menu"` (kebab /
  ellipsis) that presumably opens a dropdown with Delete (and possibly Edit).
  Below the domains table is a "Render Subdomain" section: heading + description
  ("If enabled, your service remains reachable at its onrender.com subdomain…") +
  a toggle (currently checked/enabled) + the URL in text.
- **bex equivalent:** the platform subdomain is `<service-url>` (already in
  `AppView.URL` from bex-api — the `.onbex.co` hostname). It is always active;
  render a read-only section: "Platform URL" or "bex Subdomain" heading + the URL
  as a link + a note "Always enabled — your service is always reachable here."
- Use shadcn `DropdownMenu` for the kebab menu and `AlertDialog` for the deletion
  confirmation (pattern already used in `src/features/services/`).
- `deleteCustomDomain` returns `Boolean`; on success, remove the row from the
  table with `refetchQueries: ["CustomDomains"]` or a cache update.

## Steps

1. Add a `DropdownMenu` in the Actions column of the domains table:
   - Trigger: a "Menu" icon button (three dots, `MoreHorizontal` from lucide-react).
   - Menu item: "Delete" — opens an `AlertDialog` asking "Delete www.example.com?
     This cannot be undone."
   - On confirm: call `useDeleteCustomDomainMutation` → refetch `CustomDomains`.
   - Show a toast on error; close the `AlertDialog` on success.
2. Below the `CustomDomainsSection` card, add a `PlatformSubdomainSection` component:
   - Heading: "Platform Subdomain" (or "bex Subdomain").
   - Description: "Your service is always reachable at its bex platform subdomain."
   - URL: `<a href={service.url}>{service.url}</a>` (sourced from the `useServer`
     hook already called by the settings page).
3. Add locale keys for delete dialog and platform subdomain section.

## Files

- `dashboard/src/features/services/components/custom-domains-section.tsx` (extend)
- `dashboard/src/features/services/components/platform-subdomain-section.tsx` (new)
- `dashboard/src/routes/services.$serviceId.settings.tsx` (add platform section)
- `dashboard/src/features/services/locales/{en,zh}.ts` (locale keys)

## Acceptance criteria

- [ ] Each domain row has a kebab menu with "Delete".
- [ ] Confirming deletion calls the mutation; the domain disappears from the table.
- [ ] Cancelling the confirmation does nothing.
- [ ] An error from the API surfaces as a toast.
- [ ] "Platform Subdomain" section is visible below the domains table, showing the
      service's `.onbex.co` URL as an external link.

## Out of scope

- DNS CNAME instructions (post-add flow). Disabling the platform subdomain (bex
  always keeps it on). Per-domain "Edit" action.
