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, 09:30 UTC
fix(mobile): Bitbucket and GitCafe approvals show as approved on the PR timeline (#23138)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net>
MarcoDotIO committed
Oct 31, 2026 at 22:23 UTC
6d18edd9635d653191ebce58b1e86cb02023f13d
3 files changed
+28
-5
apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx
+4
-2
@@ -14,6 +14,7 @@ import { PullRequestAvatar } from "./PullRequestPresentation";
14
import { PullRequestMarkdown } from "./PullRequestMarkdown";
15
import { PullRequestCommentFooter } from "./PullRequestReactions";
16
import { pullRequestDescriptionContent } from "./pullRequestDescriptionContent";
17
+import { normalizedReviewState } from "./pullRequestStatus";
18
import type { PullRequestParams } from "./usePullRequestDiff";
19
20
function TimelineEvent(props: {
@@ -80,8 +81,9 @@ function TimelineComment({
81
[comment.body],
82
);
83
const preview = content.preview;
83
- const approved = comment.reviewState === "APPROVED";
84
- const changes = comment.reviewState === "CHANGES_REQUESTED";
84
+ const state = normalizedReviewState(comment.reviewState);
85
+ const approved = state === "APPROVED";
86
+ const changes = state === "CHANGES_REQUESTED";
87
return (
88
<TimelineEvent
89
icon={approved ? "checkmark" : changes ? "doc.text" : "text.bubble"}
apps/mobile/src/features/pull-requests/pullRequestStatus.test.ts
+17
-1
@@ -1,6 +1,10 @@
1
import type { PullRequestActivity, PullRequestCheck, PullRequestComment } from "@t3tools/contracts";
2
import { describe, expect, it } from "vite-plus/test";
3
-import { pullRequestChecksSummary, pullRequestReviewSummary } from "./pullRequestStatus";
3
+import {
4
+ normalizedReviewState,
5
+ pullRequestChecksSummary,
6
+ pullRequestReviewSummary,
7
+} from "./pullRequestStatus";
8
9
const author = { login: "julius", name: null, avatarUrl: null };
10
function review(state: string, at: string): PullRequestComment {
@@ -76,6 +80,18 @@ describe("mobile overview review status", () => {
80
});
81
});
82
83
+describe("mobile review state spelling", () => {
84
+ it("reads GitHub's uppercase and Bitbucket's or GitCafe's lowercase verdicts alike", () => {
85
+ expect(normalizedReviewState("APPROVED")).toBe("APPROVED");
86
+ expect(normalizedReviewState("approved")).toBe("APPROVED");
87
+ expect(normalizedReviewState("CHANGES_REQUESTED")).toBe("CHANGES_REQUESTED");
88
+ expect(normalizedReviewState("changes_requested")).toBe("CHANGES_REQUESTED");
89
+ expect(normalizedReviewState("changes-requested")).toBe("CHANGES_REQUESTED");
90
+ expect(normalizedReviewState("commented")).toBe("COMMENTED");
91
+ expect(normalizedReviewState(null)).toBeUndefined();
92
+ });
93
+});
94
+
95
describe("mobile overview check status", () => {
96
it("prioritizes failed checks while others are running", () => {
97
expect(
apps/mobile/src/features/pull-requests/pullRequestStatus.ts
+7
-2
@@ -135,6 +135,11 @@ export function pullRequestChecksSummary(pr: Pick<PullRequestDetail, "checks">)
135
} as const;
136
}
137
138
+// GitHub and Forgejo send uppercase review states; Bitbucket and GitCafe send lowercase.
139
+export function normalizedReviewState(reviewState: string | null) {
140
+ return reviewState?.toUpperCase().replaceAll("-", "_");
141
+}
142
+
143
export function pullRequestReviewSummary(
144
pr: Pick<PullRequestDetail, "reviewers">,
145
activity: Pick<PullRequestActivity, "comments" | "commits"> | null,
@@ -142,8 +147,8 @@ export function pullRequestReviewSummary(
147
const latest = new Map<string, PullRequestActivity["comments"][number]>();
148
const comments = new Map<string, PullRequestActivity["comments"][number]>();
149
for (const review of activity?.comments ?? []) {
145
- if (review.kind !== "review" || !review.reviewState) continue;
146
- const state = review.reviewState.toUpperCase().replaceAll("-", "_");
150
+ const state = normalizedReviewState(review.reviewState);
151
+ if (review.kind !== "review" || !state) continue;
152
const key = review.author?.login ?? review.id;
153
if (state === "COMMENTED") {
154
const previous = comments.get(key);