@devries-cameron20 / t3code Mirror · read-only / commits / 5e191059bb
Fork 0

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, 08:15 UTC

fix(mobile): single-comment PR discussions say "1 comment", not "1 comments" (#22926)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

MarcoDotIO committed Nov 1, 2026 at 15:54 UTC 5e191059bb24cb96d9e3127b5da2199f4640c341
3 files changed +22 -2
apps/mobile/src/features/pull-requests/PullRequestTimeline.tsx
+2 -1
@@ -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 { discussionCommentCountLabel } from "./pullRequestDiffComments";
18 import { normalizedReviewState } from "./pullRequestStatus";
19 import type { PullRequestParams } from "./usePullRequestDiff";
20
@@ -250,7 +251,7 @@ export function pullRequestTimelineRows(
251 <Text className="text-xs text-foreground-muted">
252 {thread.isResolved ? "Resolved" : "Unresolved"}
253 {thread.isOutdated ? " · Outdated" : ""} ·{" "}
253 - {thread.commentCount ?? thread.comments.length} comments
254 + {discussionCommentCountLabel(thread.commentCount ?? thread.comments.length)}
255 </Text>
256 </Pressable>
257 </TimelineEvent>
apps/mobile/src/features/pull-requests/pullRequestDiffComments.test.ts
+16
@@ -96,6 +96,22 @@ describe("PR comments in continuous native diffs", () => {
96 ]);
97 expect(annotated.commentTargetsByRowId).toBe(data.commentTargetsByRowId);
98 });
99 + it("counts a single-comment discussion in the singular", () => {
100 + const annotated = annotatePullRequestDiff(
101 + data,
102 + [
103 + { ...thread, commentCount: 1 },
104 + { ...thread, id: "right", side: "right", commentCount: 2 },
105 + ],
106 + [],
107 + "abc",
108 + );
109 + expect(
110 + annotated.rows
111 + .filter((row) => row.kind === "comment")
112 + .map((row) => row.commentText?.split("\n").at(-1)),
113 + ).toEqual(["1 comment · Tap to open", "2 comments · Tap to open"]);
114 + });
115 it("uses the old line number for left-side context when the line numbers differ", () => {
116 const position = { kind: "context" as const, side: "left" as const, oldLine: 7, newLine: 8 };
117 const annotated = annotatePullRequestDiff(
apps/mobile/src/features/pull-requests/pullRequestDiffComments.ts
+4 -1
@@ -18,6 +18,9 @@ export function reviewPosition(row: NativeReviewDiffRow): PullRequestReviewPosit
18 };
19 return null;
20 }
21 +export function discussionCommentCountLabel(count: number) {
22 + return `${count} ${count === 1 ? "comment" : "comments"}`;
23 +}
24 export function reviewPositionLabel(position: PullRequestReviewPosition) {
25 const oldSide =
26 position.kind === "deleted" || (position.kind === "context" && position.side === "left");
@@ -79,7 +82,7 @@ export function annotatePullRequestDiff(
82 attach(
83 anchor,
84 `discussion:${thread.id}`,
82 - `${first?.author?.login ?? "Discussion"}${thread.isResolved ? " · Resolved" : ""}\n${first?.body ?? ""}\n${thread.commentCount ?? thread.comments.length} comments · Tap to open`,
85 + `${first?.author?.login ?? "Discussion"}${thread.isResolved ? " · Resolved" : ""}\n${first?.body ?? ""}\n${discussionCommentCountLabel(thread.commentCount ?? thread.comments.length)} · Tap to open`,
86 thread.line === null ? "file" : String(thread.line),
87 );
88 }