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 22, 14:30 UTC
fix(web,mobile): bot approvals are visible on the PR summary (#25829)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 27, 2026 at 01:38 UTC
1702d55214bdbae12278462e572b35e7c0eb4a46
6 files changed
+91
-7
apps/mobile/src/features/pull-requests/pullRequestActivityFilter.test.ts
+15
@@ -57,4 +57,19 @@ describe("mobile activity filters", () => {
57
.activity.reviewThreads,
58
).toEqual([]);
59
});
60
+
61
+ it("keeps bot review verdicts when bot comments are hidden", () => {
62
+ const result = filterPullRequestActivity(
63
+ {
64
+ ...activity,
65
+ comments: [
66
+ comment("approved", bot, "APPROVED"),
67
+ comment("changes", bot, "CHANGES_REQUESTED"),
68
+ comment("commented", bot, "COMMENTED"),
69
+ ],
70
+ },
71
+ DEFAULT_ACTIVITY_FILTER,
72
+ );
73
+ expect(result.activity.comments.map((entry) => entry.id)).toEqual(["approved", "changes"]);
74
+ });
75
});
apps/mobile/src/features/pull-requests/pullRequestActivityFilter.ts
+7
-1
@@ -18,6 +18,12 @@ function isBot(actor: PullRequestActor | null) {
18
return actor?.isBot === true;
19
}
20
21
+// A bot's approval or change request is a verdict, not chatter.
22
+function isVerdict(reviewState: string | null) {
23
+ const state = reviewState?.trim().toUpperCase().replaceAll("-", "_");
24
+ return state === "APPROVED" || state === "CHANGES_REQUESTED";
25
+}
26
+
27
function eventCount(activity: PullRequestActivity) {
28
const discussionIds = new Set(
29
activity.reviewThreads.flatMap((thread) => thread.comments.map((comment) => comment.id)),
@@ -50,7 +56,7 @@ export function filterPullRequestActivity(activity: PullRequestActivity, filter:
56
: activity.comments.filter(
57
(comment) =>
58
!allDiscussionIds.has(comment.id) &&
53
- (filter.bots || !isBot(comment.author)) &&
59
+ (filter.bots || !isBot(comment.author) || isVerdict(comment.reviewState)) &&
60
(filter.resolved || comment.reviewState?.trim().toLowerCase() !== "dismissed"),
61
);
62
const filtered = {
apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx
+12
-5
@@ -49,6 +49,7 @@ import {
49
PullRequestLabelChip,
50
PullRequestReviewOutcomeBadge,
51
pullRequestReviewOutcomeLabel,
52
+ PullRequestReviewOutcomeAvatarBadge,
53
pullRequestReviewOutcomeRingClassName,
54
pullRequestReviewOutcomeStaleLabel,
55
} from "./pullRequestPresentation";
@@ -689,11 +690,17 @@ export function PullRequestSummaryTab({
690
variant="avatar"
691
/>
692
{entry.outcome ? (
692
- <span className="sr-only">
693
- {entry.stale
694
- ? pullRequestReviewOutcomeStaleLabel(entry.outcome)
695
- : pullRequestReviewOutcomeLabel(entry.outcome)}
696
- </span>
693
+ <>
694
+ <PullRequestReviewOutcomeAvatarBadge
695
+ outcome={entry.outcome}
696
+ stale={entry.stale}
697
+ />
698
+ <span className="sr-only">
699
+ {entry.stale
700
+ ? pullRequestReviewOutcomeStaleLabel(entry.outcome)
701
+ : pullRequestReviewOutcomeLabel(entry.outcome)}
702
+ </span>
703
+ </>
704
) : null}
705
</TooltipTrigger>
706
<TooltipPopup side="bottom">
apps/web/src/components/pullRequest/pullRequestDetail.logic.test.ts
+22
@@ -561,6 +561,28 @@ describe("review thread conversations", () => {
561
);
562
});
563
564
+ it("keeps bot review verdicts when bot comments are hidden", () => {
565
+ const review = (id: string, reviewState: string) => ({
566
+ ...comment(id, 9),
567
+ author: bot,
568
+ kind: "review" as const,
569
+ reviewState,
570
+ });
571
+ const items = pullRequestConversationItems(
572
+ [
573
+ review("approved", "APPROVED"),
574
+ review("changes", "CHANGES_REQUESTED"),
575
+ review("commented", "COMMENTED"),
576
+ ],
577
+ [],
578
+ );
579
+ expect(
580
+ filterPullRequestConversationItems(items, { bots: false, resolved: false }).map(
581
+ (item) => item.id,
582
+ ),
583
+ ).toEqual(["approved", "changes"]);
584
+ });
585
+
586
it("distinguishes unloaded replies from complete threads, even when the host only supplies a cursor", () => {
587
const timeline = (reviewThread: PullRequestReviewThread) =>
588
buildPullRequestTimeline({
apps/web/src/components/pullRequest/pullRequestDetail.logic.ts
+9
-1
@@ -621,6 +621,11 @@ export function isPullRequestCommentFinished(
621
);
622
}
623
624
+function isPullRequestVerdict(reviewState: string | null): boolean {
625
+ const outcome = pullRequestReviewOutcome(reviewState);
626
+ return outcome === "approved" || outcome === "changes-requested";
627
+}
628
+
629
export function filterPullRequestConversationItems(
630
items: ReadonlyArray<PullRequestConversationItem>,
631
filter: { readonly bots: boolean; readonly resolved: boolean },
@@ -629,7 +634,10 @@ export function filterPullRequestConversationItems(
634
// Matching any member keeps the finding beside a human reply to a bot.
635
pullRequestConversationItemComments(item).some(
636
(comment) =>
632
- (filter.bots || comment.author?.isBot !== true) &&
637
+ // A bot's approval or change request is a verdict, not chatter.
638
+ (filter.bots ||
639
+ comment.author?.isBot !== true ||
640
+ isPullRequestVerdict(comment.reviewState)) &&
641
(filter.resolved ||
642
!isPullRequestCommentFinished(comment, item.kind === "thread" ? item.thread : undefined)),
643
),
apps/web/src/components/pullRequest/pullRequestPresentation.tsx
+26
@@ -279,6 +279,7 @@ const REVIEW_OUTCOME_PRESENTATION = {
279
ringClassName: "ring-2 ring-emerald-500 dark:ring-emerald-400",
280
staleRingClassName:
281
"ring-2 ring-[color-mix(in_srgb,var(--color-emerald-500)_35%,var(--background))] dark:ring-[color-mix(in_srgb,var(--color-emerald-400)_35%,var(--background))]",
282
+ fillClassName: "fill-emerald-500 dark:fill-emerald-400",
283
badgeVariant: "success",
284
},
285
"changes-requested": {
@@ -287,6 +288,7 @@ const REVIEW_OUTCOME_PRESENTATION = {
288
toneClassName: "text-destructive",
289
ringClassName: "ring-2 ring-destructive",
290
staleRingClassName: "ring-2 ring-[color-mix(in_srgb,var(--destructive)_35%,var(--background))]",
291
+ fillClassName: "fill-destructive",
292
badgeVariant: "error",
293
},
294
dismissed: {
@@ -296,6 +298,7 @@ const REVIEW_OUTCOME_PRESENTATION = {
298
ringClassName: "ring-2 ring-muted-foreground/60",
299
staleRingClassName:
300
"ring-2 ring-[color-mix(in_srgb,var(--contrast-muted-foreground)_30%,var(--background))]",
301
+ fillClassName: "fill-muted-foreground",
302
badgeVariant: "outline",
303
},
304
} as const satisfies Record<
@@ -306,6 +309,7 @@ const REVIEW_OUTCOME_PRESENTATION = {
309
toneClassName: string;
310
ringClassName: string;
311
staleRingClassName: string;
312
+ fillClassName: string;
313
badgeVariant: "success" | "error" | "outline";
314
}
315
>;
@@ -343,6 +347,28 @@ export function PullRequestReviewOutcomeIcon({
347
);
348
}
349
350
+// Ring color alone blends into colorful bot avatars; the glyph gives each verdict a shape.
351
+export function PullRequestReviewOutcomeAvatarBadge({
352
+ outcome,
353
+ stale = false,
354
+}: {
355
+ outcome: PullRequestReviewOutcome;
356
+ stale?: boolean;
357
+}) {
358
+ const presentation = REVIEW_OUTCOME_PRESENTATION[outcome];
359
+ return (
360
+ <presentation.Icon
361
+ aria-hidden
362
+ strokeWidth={3}
363
+ className={cn(
364
+ "absolute -right-1 -bottom-1 size-3 text-background",
365
+ presentation.fillClassName,
366
+ stale && "opacity-50",
367
+ )}
368
+ />
369
+ );
370
+}
371
+
372
export function pullRequestReviewOutcomeLabel(outcome: PullRequestReviewOutcome): string {
373
return REVIEW_OUTCOME_PRESENTATION[outcome].label;
374
}