Bring up the migration where somebody runs into it

Taking back a site had one way in: a button in Settings under Deploy, which said
the same thing to everybody and could not say whether anything was actually
waiting. On the gateway this was built for, two people out of eight hundred and
seven have used it.

The moment it is needed is the one somebody types a name they used to own, and
until now that moment did the opposite — the name came back taken and the button
went dead, because a name being held for its previous owner looks exactly like a
stranger's to anyone who does not ask. The gateway can now be asked, so the field
says the name is being held for them and offers the step that gets it back, in
place of a refusal with nowhere to go. The deploy dialog owns that list rather
than the field, because one recognised name is rarely all somebody has waiting.

npanel also refuses to add a name it is holding, saying to take it back instead —
a sentence that was being shown as a flat red alert with no way to act on it.
That refusal now carries the same offer.

And the settings card asks how many are waiting instead of guessing. It costs a
signature on a page nobody asked to sign on, which is the thing this deliberately
did not do before; the difference is that it is now two counted rows rather than
a read of every claimed deploy, and that the card says nothing at all unless
there is something to say. A card that cannot tell whether it applies to you is
one most people learn to ignore before it ever does.
This commit is contained in:
Alex Gleason committed 2026-09-13 22:27:18 -05:00
1 parent 4928819a0e
commit 344a73c6c3
8 files changed
+334 -26

No files matched your search

+46 -18
View File
@@ -15,6 +15,7 @@ import { ProviderConfigDialog } from '@/components/ProviderConfigDialog';
import { AddDeployProviderDialog } from '@/components/AddDeployProviderDialog';
import { AddCustomProviderDialog } from '@/components/AddCustomProviderDialog';
import { NpanelMigrationDialog } from '@/components/deploy/NpanelMigrationDialog';
import { useNpanelClaimCount } from '@/hooks/useNpanelClaims';
import { Button } from '@/components/ui/button';
import {
DndContext,
@@ -344,27 +345,13 @@ export function DeploySettings() {
</div>
)}
{/* Sites held for their previous owner on a gateway that took over a
domain. Shown without asking the gateway first: finding out costs
a signature, and a signing prompt nobody asked for is worse than a
button that sometimes opens an empty list. */}
{user && settings.providers.map((provider) => (
provider.type === 'npanel' ? (
<div
<HeldSites
key={`migrate-${provider.id}`}
className="rounded-lg border border-dashed p-4 flex flex-wrap items-center justify-between gap-3"
>
<div className="space-y-1">
<h4 className="text-sm font-medium">Sites from before {provider.name}</h4>
<p className="text-sm text-muted-foreground">
Names you published on {provider.domain} under the old host are being served
from an archive until you take them back.
</p>
</div>
<Button variant="outline" onClick={() => setMigratingProvider(provider)}>
Take back sites
</Button>
</div>
provider={provider}
onOpen={() => setMigratingProvider(provider)}
/>
) : null
))}
@@ -440,4 +427,45 @@ export function DeploySettings() {
);
}
/**
* Sites held for their previous owner on a gateway that took over a domain.
*
* The count is asked for on load, rather than the card standing there saying
* "you may have sites waiting" to everyone forever. Almost nobody does, and a
* card that cannot tell them apart is one most people learn to ignore before
* it ever applies to them — while the person it does apply to has a few names
* being served from an archive under a key that is not theirs, which is worth
* one signature to say out loud.
*
* It is only the count: {@link useNpanelClaimCount} is two counted rows, not
* the deploy-by-deploy read the dialog does when somebody opens it.
*/
function HeldSites({ provider, onOpen }: { provider: NpanelProvider; onOpen: () => void }) {
const { data } = useNpanelClaimCount(provider);
// Nothing to say until the gateway says there is something, so a gateway with
// no migration behind it — every gateway but the one — shows nothing at all.
if (!data?.waiting) return null;
return (
<div className="rounded-lg border border-dashed p-4 flex flex-wrap items-center justify-between gap-3">
<div className="space-y-1">
<h4 className="text-sm font-medium">
{data.waiting === 1
? `One name is waiting for you on ${provider.domain}`
: `${data.waiting} names are waiting for you on ${provider.domain}`}
</h4>
<p className="text-sm text-muted-foreground">
You published {data.waiting === 1 ? 'it' : 'them'} before {provider.domain} moved to{' '}
{provider.name}. {data.waiting === 1 ? 'It is' : 'They are'} being served from an archive
until you take {data.waiting === 1 ? 'it' : 'them'} back.
</p>
</div>
<Button variant="outline" onClick={onOpen}>
Take back sites
</Button>
</div>
);
}
export default DeploySettings;