Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion apps/web/src/components/pullRequest/PullRequestReviewForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { CheckIcon, MessageSquareIcon, XCircleIcon } from "lucide-react";
import { useState, type ReactNode, type RefObject } from "react";

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

import { Button } from "../ui/button";
import { Select, SelectItem, SelectPopup, SelectTrigger } from "../ui/select";
import { Textarea } from "../ui/textarea";
import { toastManager } from "../ui/toast";
import { readableFailure } from "./pullRequestDetail.logic";
import {
pullRequestReviewKey,
usePendingReviewComments,
Expand Down Expand Up @@ -94,7 +96,14 @@ export function PullRequestReviewForm({
});
onPendingChange(false);
if (result._tag === "Failure") {
toastManager.add({ type: "error", title: "The review could not be submitted" });
toastManager.add({
type: "error",
title: "The review could not be submitted",
description: readableFailure(
squashAtomCommandFailure(result),
"The host refused the review. Your draft is still here to try again.",
),
});
return;
}
// More remarks may have been added while the host was accepting this snapshot. Leave those,
Expand Down
Loading