diff --git a/services/hackbot-ui/components/RunDetail.tsx b/services/hackbot-ui/components/RunDetail.tsx index c6c7e865c4..c10bf68bcf 100644 --- a/services/hackbot-ui/components/RunDetail.tsx +++ b/services/hackbot-ui/components/RunDetail.tsx @@ -22,15 +22,17 @@ import { parseTestPlan, TestPlanView } from "./TestPlanView"; // approves the actual text and not just an action type. A comment carries its // body in params.text; a Phabricator submission carries the title and summary of // the revision it would open for the patch (previewed by PatchView). -function actionPreview(a: RunAction): { label: string; text: string } | null { +function actionPreview( + action: RunAction +): { label: string; text: string } | null { const text = (v: unknown): string => typeof v === "string" && v.trim() ? v : ""; - if (a.type === "bugzilla.add_comment") { - const body = text(a.params?.text); + if (action.type === "bugzilla.add_comment") { + const body = text(action.params?.text); return body ? { label: "Comment preview", text: body } : null; } - if (a.type === "phabricator.submit_patch") { - const body = [text(a.params?.title), text(a.params?.summary)] + if (action.type === "phabricator.submit_patch") { + const body = [text(action.params?.title), text(action.params?.summary)] .filter(Boolean) .join("\n\n"); return body ? { label: "Revision preview", text: body } : null; @@ -192,9 +194,9 @@ export function RunDetail({ // Both pending and failed actions are (re)applied by the apply endpoint — it // skips only already-applied ones — so one button covers applying and retry. const pendingActions = - actions?.filter((a) => a.status === "pending").length ?? 0; + actions?.filter((action) => action.status === "pending").length ?? 0; const failedActions = - actions?.filter((a) => a.status === "failed").length ?? 0; + actions?.filter((action) => action.status === "failed").length ?? 0; const applyLabel = pendingActions && failedActions ? "Apply pending & retry failed actions" @@ -296,21 +298,27 @@ export function RunDetail({

Actions ({actions.length})

{applyError &&
{applyError}
}