docs: Implementation plan for instance rename in HQ

This commit is contained in:
2026-08-12 09:53:40 +00:00
parent de7350fce9
commit 71a4f53bed
2 changed files with 1004 additions and 7 deletions
@@ -143,7 +143,7 @@ Refusals, in the order checked:
| Condition | Status | Body |
|---|---|---|
| `deployment != cloud` | 409 | `self_hosted` |
| `deployment != cloud` | 400 | `selfHostedRefusal`, the same constant and status the member endpoints already answer with |
| `placeholder` | 409 | instance is not provisioned yet |
| within 24h of `renamed_at` | 429 | includes the UTC time it unlocks |
| `provision.ErrNameRejected` | 422 | the wrapped reason, verbatim |
@@ -175,24 +175,28 @@ warning as `web/lib/targets.ts`: it is a second implementation and must change i
the same commit as the Go one. The preview can disagree with the server — the
409 is the answer that counts.
### `components/RenameInstanceModal.tsx`
### `components/RenamePanel.tsx`
An inline panel, not a modal — `adminsite` has no modal component, and the
codebase's idiom for a destructive-ish action with one input is `RelinkPanel`:
a control that expands in place inside a `Panel`.
Prefilled with the current name. Below the input, a live line reading
`acme-ltd.vantage.hostxtra.co.uk` as the customer types, and a note that they
will need to sign in again on the new host. Submit is disabled while the derived
slug is unchanged or invalid.
Mounted from a `Rename` action in `PageHeader` on
`app/(customer)/instances/[id]/page.tsx`, rendered only when the instance is
cloud and `account_role` is `owner` or `admin`. The staff instance page mounts
the same component against the staff route.
It lives in an "Address" panel on `app/(customer)/instances/[id]/page.tsx`,
rendered only when the instance is cloud and `account_role` is `owner` or
`admin`. The staff instance page mounts the same component against the staff
route.
`InstanceRecord` on the Overview page is not touched: it stays a summary, and
the rename is a decision that deserves the detail page.
### After a successful rename
Invalidate `["account"]`, close the modal, and let the page redraw with the new
Invalidate `["account"]`, collapse the panel, and let the page redraw with the new
name and host. The Console rail card shows the new host, with a note:
> This instance now lives at `acme-ltd.vantage.hostxtra.co.uk`. You will need to