The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 08:00 UTC
perf(web): pull request review annotations compile with the React Compiler (#20493)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 18:53 UTC
5abf7bf6327f13ee32558a756cef0991e85146f2
2 files changed
+39
-38
apps/web/reactCompiledFiles.ts
+1
@@ -68,4 +68,5 @@ export const REACT_COMPILED_FILES = [
68
"apps/web/src/components/desktop/SshPasswordPromptDialog.tsx",
69
"apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx",
70
"apps/web/src/components/pullRequest/usePullRequestActions.ts",
71
+ "apps/web/src/components/pullRequest/PullRequestReviewAnnotation.tsx",
72
] as const;
apps/web/src/components/pullRequest/PullRequestReviewAnnotation.tsx
+38
-38
@@ -10,6 +10,7 @@ import type {
10
import { HammerIcon, MessageSquareIcon, Trash2Icon } from "lucide-react";
11
import { Circle, CircleCheck } from "lucide";
12
import { useRef, useState } from "react";
13
+import { settlePromise, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
14
15
import { formatRelativeTimeLabel } from "~/timestampFormat";
16
import { cn } from "~/lib/utils";
@@ -177,42 +178,39 @@ export function ReviewThreadCard({
178
const trimmed = reply.trim();
179
if (trimmed.length === 0 || pending || sendingRef.current) return;
180
sendingRef.current = true;
180
- try {
181
- if (await onReply(trimmed)) {
182
- // The mutation returns no comment. Keep what the reader loaded and reopen its cursor so
183
- // the new reply remains reachable without spending requests until they ask to load it.
184
- setLoadedPage((previous) =>
185
- previous?.threadId === thread.id
186
- ? {
187
- ...previous,
188
- nextCursor: previous.nextCursor ?? thread.nextCommentsCursor ?? null,
189
- }
190
- : previous,
191
- );
192
- setReply("");
193
- setReplying(false);
194
- }
195
- } finally {
196
- sendingRef.current = false;
197
- }
181
+ const result = await settlePromise(() => onReply(trimmed));
182
+ sendingRef.current = false;
183
+ if (result._tag === "Failure") throw squashAtomCommandFailure(result);
184
+ if (!result.value) return;
185
+ // The mutation returns no comment. Keep what the reader loaded and reopen its cursor so
186
+ // the new reply remains reachable without spending requests until they ask to load it.
187
+ setLoadedPage((previous) =>
188
+ previous?.threadId === thread.id
189
+ ? {
190
+ ...previous,
191
+ nextCursor: previous.nextCursor ?? thread.nextCommentsCursor ?? null,
192
+ }
193
+ : previous,
194
+ );
195
+ setReply("");
196
+ setReplying(false);
197
};
198
const loadMore = async () => {
199
if (nextCommentsCursor === null || loadingMore) return;
200
setLoadingMore(true);
202
- try {
203
- const page = await onLoadMore(nextCommentsCursor);
204
- if (page === null) return;
205
- setLoadedPage((previous) => ({
206
- threadId: thread.id,
207
- comments: mergePullRequestThreadComments(
208
- previous?.threadId === thread.id ? previous.comments : [],
209
- page.comments,
210
- ),
211
- nextCursor: page.nextCursor,
212
- }));
213
- } finally {
214
- setLoadingMore(false);
215
- }
201
+ const result = await settlePromise(() => onLoadMore(nextCommentsCursor));
202
+ setLoadingMore(false);
203
+ if (result._tag === "Failure") throw squashAtomCommandFailure(result);
204
+ const page = result.value;
205
+ if (page === null) return;
206
+ setLoadedPage((previous) => ({
207
+ threadId: thread.id,
208
+ comments: mergePullRequestThreadComments(
209
+ previous?.threadId === thread.id ? previous.comments : [],
210
+ page.comments,
211
+ ),
212
+ nextCursor: page.nextCursor,
213
+ }));
214
};
215
216
return (
@@ -332,12 +330,14 @@ export function ReviewThreadCard({
330
placeholder="Reply"
331
aria-label="Reply to this conversation"
332
onChange={(event) => setReply(event.target.value)}
335
- onKeyDown={submitKeys({
336
- value: reply,
337
- pending,
338
- onSubmit: () => void send(),
339
- onCancel: () => setReplying(false),
340
- })}
333
+ onKeyDown={(event) =>
334
+ submitKeys({
335
+ value: reply,
336
+ pending,
337
+ onSubmit: () => void send(),
338
+ onCancel: () => setReplying(false),
339
+ })(event)
340
+ }
341
/>
342
<div className="mt-2 flex justify-end gap-2">
343
<Button size="xs" variant="ghost" onClick={() => setReplying(false)}>