@devries-cameron20 / t3code-1 / commits / 48ba76bc26
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): collapse oldest pull request comments (#9323)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>

maria committed Sep 3, 2026 at 01:43 UTC 48ba76bc26337f23d1f0991bbac51f996a3333dc
1 file changed +14 -16
apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx
+14 -16
@@ -468,6 +468,18 @@ export function PullRequestSummaryTab({
468 const hiddenCommentCount = detail.comments.length - recentComments.length;
469 const [commentOrder, setCommentOrder] = useState<"newest" | "oldest">("newest");
470 const visibleComments = orderPullRequestComments(recentComments, commentOrder);
471 + const showOldestCommentsButton =
472 + hiddenCommentCount > 0 ? (
473 + <Button
474 + size="sm"
475 + variant="outline"
476 + className="w-full"
477 + onClick={() => setShown({ url: detail.url, count: shownComments + COMMENT_PAGE })}
478 + >
479 + Show {Math.min(hiddenCommentCount, COMMENT_PAGE)} oldest{" "}
480 + {hiddenCommentCount === 1 ? "comment" : "comments"}
481 + </Button>
482 + ) : null;
483 // Read from the whole conversation, not the window shown below it: a verdict older than the
484 // last thirty comments still stands.
485 const reviewOutcomes = latestPullRequestReviewOutcomes(detail.comments, detail.commits);
@@ -864,22 +876,7 @@ export function PullRequestSummaryTab({
876 <p className="py-2 text-xs text-muted-foreground">No comments yet.</p>
877 ) : (
878 <div className="space-y-3">
867 - {hiddenCommentCount > 0 ? (
868 - // Hundreds of comments are hundreds of markdown renders, and the ones worth
869 - // opening a pull request for are the recent ones. The rest are one press away and
870 - // stay rendered once asked for.
871 - <Button
872 - size="sm"
873 - variant="outline"
874 - className="w-full"
875 - onClick={() =>
876 - setShown({ url: detail.url, count: shownComments + COMMENT_PAGE })
877 - }
878 - >
879 - Show {Math.min(hiddenCommentCount, COMMENT_PAGE)} earlier{" "}
880 - {hiddenCommentCount === 1 ? "comment" : "comments"}
881 - </Button>
882 - ) : null}
879 + {commentOrder === "oldest" ? showOldestCommentsButton : null}
880 {visibleComments.map((comment) => {
881 const thread = threadByCommentId.get(comment.id);
882 const body = visibleBody(comment.body);
@@ -991,6 +988,7 @@ export function PullRequestSummaryTab({
988 </article>
989 );
990 })}
991 + {commentOrder === "newest" ? showOldestCommentsButton : null}
992 </div>
993 )}
994 </>