The best way to control Claude Code, Codex and more from any computer or phone
fix(web): ask before Close with comment closes a pull request (#18175)
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
IlyaL committed
Oct 19, 2026 at 19:49 UTC
098eb55cc377fe8a7f3b990bdf960f9c87e54d91
1 file changed
+25
-8
apps/web/src/components/pullRequest/PullRequestCommentForm.tsx
+25
-8
@@ -9,6 +9,8 @@ import { Button } from "../ui/button";
9
import { Textarea } from "../ui/textarea";
10
import { toastManager } from "../ui/toast";
11
import { PullRequestGlyph } from "./pullRequestIcons";
12
+import { pullRequestReviewKey } from "./pullRequestReviewStore";
13
+import { useInlineActionConfirm } from "./useInlineActionConfirm";
14
15
export function PullRequestCommentForm({
16
environmentId,
@@ -37,6 +39,7 @@ export function PullRequestCommentForm({
39
const postComment = useAtomCommand(pullRequestEnvironment.comment, {
40
reportFailure: false,
41
});
42
+ const inlineConfirm = useInlineActionConfirm(pullRequestReviewKey(reference));
43
const followUpAction =
44
detail.state === "open" &&
45
detail.capabilities.actions.includes("close") &&
@@ -111,20 +114,34 @@ export function PullRequestCommentForm({
114
size="xs"
115
variant={followUpAction === "close" ? "destructive-outline" : "outline"}
116
disabled={body.trim().length === 0 || submitting !== null || actionPending}
114
- onClick={() => void submit(followUpAction)}
117
+ {...(followUpAction === "close"
118
+ ? inlineConfirm.props("close", () => void submit("close"))
119
+ : { onClick: () => void submit("reopen") })}
120
>
121
{followUpAction === "close" ? (
122
<PullRequestGlyph.closed className="size-3.5" />
123
) : (
124
<PullRequestGlyph.reopen className="size-3.5" />
125
)}
121
- {submitting === followUpAction
122
- ? followUpAction === "close"
123
- ? "Closing..."
124
- : "Reopening..."
125
- : followUpAction === "close"
126
- ? "Close with comment"
127
- : "Reopen with comment"}
126
+ {followUpAction === "close" ? (
127
+ // The longest label holds the width, so the confirming click lands on the button.
128
+ <span className="inline-grid">
129
+ <span aria-hidden className="invisible col-start-1 row-start-1">
130
+ Close with comment
131
+ </span>
132
+ <span className="col-start-1 row-start-1">
133
+ {submitting === "close"
134
+ ? "Closing..."
135
+ : inlineConfirm.isArmed("close")
136
+ ? "Confirm close?"
137
+ : "Close with comment"}
138
+ </span>
139
+ </span>
140
+ ) : submitting === "reopen" ? (
141
+ "Reopening..."
142
+ ) : (
143
+ "Reopen with comment"
144
+ )}
145
</Button>
146
)}
147
<Button