Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(autopilots): align trash icon with action buttons in webhook trigger row (#2805)
Bohan Jiangb97cc3cb6e03
diff --git a/packages/views/autopilots/components/autopilot-detail-page.tsx b/packages/views/autopilots/components/autopilot-detail-page.tsxindex 5da9d14fef..e9e4aa0950 100644--- a/packages/views/autopilots/components/autopilot-detail-page.tsx+++ b/packages/views/autopilots/components/autopilot-detail-page.tsx@@ -314,6 +314,25 @@ function TriggerRow({ trigger, autopilotId }: { trigger: AutopilotTrigger; autop};const Icon = isWebhook ? Webhook : isApi ? Zap : Clock;+ const showWebhookUrlRow = isWebhook && webhookUrl;++ // Delete control extracted so a webhook trigger can render it inline+ // with Copy / Rotate on the URL action row (where the other action+ // buttons live), while schedule / api triggers — which have no URL row+ // — keep it pinned to the row's top-right corner. Without this the+ // trash icon visually floats above the URL action buttons because the+ // outer flex uses `items-start`.+ const deleteButton = (+ <Button+ size="icon"+ variant="ghost"+ className="h-7 w-7 shrink-0"+ onClick={() => setConfirmOpen(true)}+ title={t(($) => $.trigger_row.delete_dialog.confirm)}+ >+ <Trash2 className="h-3.5 w-3.5 text-muted-foreground" />+ </Button>+ );return (<div className="flex items-start gap-3 rounded-md border px-3 py-2">@@ -346,7 +365,7 @@ function TriggerRow({ trigger, autopilotId }: { trigger: AutopilotTrigger; autop{t(($) => $.trigger_row.next_label, { date: formatDate(trigger.next_run_at) })}</div>)}- {isWebhook && webhookUrl && (+ {showWebhookUrlRow && (<div className="mt-1.5 flex items-center gap-1.5"><code className="flex-1 min-w-0 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-foreground">{webhookUrl}@@ -370,17 +389,11 @@ function TriggerRow({ trigger, autopilotId }: { trigger: AutopilotTrigger; autop><RotateCw className={cn("h-3.5 w-3.5 text-muted-foreground", rotateToken.isPending && "animate-spin")} /></Button>+ {deleteButton}</div>)}</div>- <Button- size="icon"- variant="ghost"- className="h-7 w-7 shrink-0"- onClick={() => setConfirmOpen(true)}- >- <Trash2 className="h-3.5 w-3.5 text-muted-foreground" />- </Button>+ {!showWebhookUrlRow && deleteButton}<AlertDialog open={confirmOpen} onOpenChange={(v) => { if (!v && !deleting) setConfirmOpen(false); }}><AlertDialogContent><AlertDialogHeader>