Skip to content

Commit 45d29b4

Browse files
authored
fix(web): a refused review shows GitHub's reason (#22382)
1 parent fa81fac commit 45d29b4

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎apps/web/src/components/pullRequest/PullRequestReviewForm.tsx‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import { CheckIcon, MessageSquareIcon, XCircleIcon } from "lucide-react";
55
import { useState, type ReactNode, type RefObject } from "react";
66

77
import { pullRequestEnvironment } from "~/state/pullRequests";
8+
import { squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
89

910
import { Button } from "../ui/button";
1011
import { Select, SelectItem, SelectPopup, SelectTrigger } from "../ui/select";
1112
import { Textarea } from "../ui/textarea";
1213
import { toastManager } from "../ui/toast";
14+
import { readableFailure } from "./pullRequestDetail.logic";
1315
import {
1416
pullRequestReviewKey,
1517
usePendingReviewComments,
@@ -95,7 +97,14 @@ export function PullRequestReviewForm({
9597
});
9698
onPendingChange(false);
9799
if (result._tag === "Failure") {
98-
toastManager.add({ type: "error", title: "The review could not be submitted" });
100+
toastManager.add({
101+
type: "error",
102+
title: "The review could not be submitted",
103+
description: readableFailure(
104+
squashAtomCommandFailure(result),
105+
"The host refused the review. Your draft is still here to try again.",
106+
),
107+
});
99108
return;
100109
}
101110
// Preserve comments and summary edits made during submission.

0 commit comments

Comments
 (0)